# Defining macros in LyX

I am having a problem defining a script that I got as a macro in LyX (or even making it "work" in LyX).
The script I have is the following:

\newcommand{\from}{\mathbin{\vbox{\baselineskip=3pt\lineskiplimit=0pt
\hbox{.}\hbox{.}\hbox{.}}}}


It suppose to be three dots, kind of like \vdots, but just lower.. Do you have a clue how to make it work in LyX? I don't even know if this script (which is I suppose in Latex) is suitable to LyX.

• What do you want to do? Do you want to know how to make Lyx accept that definition? Do you want to know how to run user-supplied Tex macros in Lyx? Do you want to know how to add symbols to the symbols Lyx recognises? – Charles Stewart Apr 2 '14 at 11:42
• Oh, sorry, I forgot to tell that.. I would like to know how to make lyx accept that definition – Buzi Apr 2 '14 at 12:10

For your case, you can go to Document --> Settings --> LaTeX preamble, and add your \newcommand there. To use it in a document just type \from, but note that this only works in math mode.
To use macros, do Insert > Math > Macro and insert your to be defined command and its content.
Alternatively, or if something goes haywire while the content is being typed, you can write out the entire \newcommand... in normal text mode, and then in one fell swoop convert it to a macro by highlighting it, and then applying Insert > Math > Inline formula (or the corresponding keyboard shortcut).