I use Mathstackexchange frequently and usually I write down my question on Lyx and then copy to the website. However, I must insert a $ sign before and after every equation while I am writing it down with Lyx. Is there a smart way to do this without inserting it every time? Thank you.
Here's how it looks like. As you can see I want to insert a $ symbol everytime.
1 Answer
Sort answer: Ctrl+M already insert $ $
in LaTeX code.
Long answer:
In LaTeX $
is an active character that start/end the inline math mode.
In Lyx, $
is not a active character that will do nothing except print that symbol, and it will we exported to LaTeX as\$
(the inactive symbol) in text mode or in math mode.
Therefore you cannot write in LyX $...$
to make an equation like in LaTeX, except if you are in a TeX box, aka Evil Red Tex (ERT), using Ctrl+L but then you must work with LateX code in the red box, that do not show anything except what you write. Be careful with ERTs, some typo here can produce a fatal error (= no PDF preview).
To write in math mode in LyX use the blue ∑ butttom or Ctrl+M. This make a blue box, warning you that a math environment equivalent to $...$
in LaTeX is already done, then you can write the equation with LaTeX commands as \simeq
but is showed the correspondent symbol ≃
.
You can also write the equation "as is" in text mode (e.g.: A \simeq B
), then select the equation with the cursor and use Ctrl+M to convert to math mode (i.e.,A≃B
).
But as show your screenshot, all you equations are already in math mode, so you are trying is not only wrong, but also absolutely unnecessary.
$
? I do not really get it, but maybe there are some Lyx experts who can manage it. (Btw: Macros could also refer to TeX commands.)$
myself. Entering math inline mode is enough (the CTRL+M shortcut you speak of).