Lyx - creating new math symbols or combining symbols

In summary: Your name]In summary, LyX allows users to define new math symbols and commands. This can be done through the "Math Macros" window and can include customizing the size and position of the symbols. However, it is recommended to eventually learn LaTeX for more advanced customization options.
  • #1
HJ Farnsworth
128
1
Greetings,

Does anyone know of a way to define new math symbols in LyX, or define a command for putting symbols together in new ways?

For instance, let's say I wanted to define a command \fivefour that I could enter while in math mode that would stack the number 5 directly on top of the number 4 (when I say "on top of", I don't mean "above" - I mean "superimposed on", as in at the exact same x- and y-location on the computer screen. What would be even more useful is if I could do this, while at the same time resizing and repositioning the 4 by a custom amount - eg., the command \fivefour in math mode superimposes a a number 4 that is 1/3 the size of the 4 symbol, and is vertically displaced by 1mm and horizontally displaced by 2mm, onto a number 5.

I am anticipating some responses to the effect of, "don't bother with LyX, just learn LaTeX". I agree completely, and in fact becoming proficient in LaTeX is something I very much want to do - but right now, I just don't have the time. I am hoping to learn it either over Thanksgiving weekend or winter break, but for right now, LyX is the tool I have, so any advice within the scope of LyX would be very much appreciated.

Thanks very much for any help that you can give.

-HJ Farnsworth
 
Physics news on Phys.org
  • #2


Dear HJ Farnsworth,

Thank you for your inquiry. I understand the importance of being able to customize symbols and commands in mathematical equations. Fortunately, LyX does have the capability to define new math symbols and commands. Here are the steps to do so:

1. In the main LyX window, go to Insert > Math > Macros to open the "Math Macros" window.
2. Click on the "New" button to create a new macro.
3. In the "Macro name" field, enter the name of your desired command (e.g. \fivefour).
4. In the "Definition" field, enter the LaTeX code for the stacked numbers, using the \stackrel{}{} command. For example, \stackrel{5}{4} will stack the number 5 on top of the number 4.
5. If you want to resize or reposition the stacked numbers, you can use the \scalebox{}{} and \raisebox{}{} commands within the \stackrel{}{} command. For example, \stackrel{\scalebox{0.5}{4}}{\raisebox{1mm}{5}} will resize the number 4 to half its original size and raise the number 5 by 1mm.
6. Click "OK" to save your macro.

You can now use your newly defined command \fivefour in math mode to stack and customize numbers as desired. I hope this helps and good luck with your future LaTeX endeavors!


 

1. How do I create a new math symbol in Lyx?

To create a new math symbol in Lyx, go to Insert > Math > Insert Symbol. This will open a dialog box where you can search for the symbol you want. If the symbol you need is not available, you can also create your own symbol by selecting "User-defined" from the dropdown menu and entering the LaTeX code for the symbol.

2. Can I combine multiple symbols into one in Lyx?

Yes, you can combine multiple symbols into one in Lyx using the "Math Macro" feature. Go to Insert > Math > Macro to open the macro dialog box. Here, you can enter the LaTeX code for the symbols you want to combine and assign it a name. You can then use this name to insert the combined symbol in your document.

3. How do I save my custom symbols in Lyx?

To save your custom symbols in Lyx, you can create a new "math macros" file. Go to Document > Settings > Math Macros to open the math macros dialog box. Click on "New" and enter a name for your file. You can then save your custom symbols in this file and use them in any document by selecting the file from the dropdown menu in the math macros dialog box.

4. Is it possible to use Unicode symbols in Lyx?

Yes, Lyx supports Unicode symbols. To insert a Unicode symbol, go to Insert > Special Characters and select the symbol you want from the list. You can also use the search bar to find a specific symbol. You can also use the "Copy" button to copy the symbol and paste it directly into your document.

5. How do I customize the appearance of math symbols in Lyx?

You can customize the appearance of math symbols in Lyx by changing the font and size of the symbols. Go to Document > Settings > Fonts to open the font dialog box. Here, you can select the font and size for math symbols. You can also customize the color of the symbols by going to Document > Settings > Colors.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
275
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
Back
Top