LyXNomenclature with units

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Thorondor
Posts: 1
Joined: Sun May 12, 2013 2:18 pm

Nomenclature with units

Post by Thorondor »

Hi people!

I'm trying to make a nomenclature with the units after the description. The Lyx wiki says:
Adding Units and lining them up on the right

The code shown here defines a new command (\nomunit) which can be used in the description box following the description. Usage is as \nomunit{unit}, or my preferred \nomunit{[unit]} to encapsulate the units in square brackets.
\newcommand{\nomunit}[1]{%
\renewcommand{\nomentryend}{\hspace*{\fill}#1}}
Do I paste this in the Description box every time? Because testing this with a description box containing
time
\newcommand{\nomunit}[s]{%
\renewcommand{\nomentryend}{\hspace*{\fill}#1}}
gives me the error
LaTeX Error: \begin{thenomenclature} on input line 1 ended by \end{document}.
What am I doing wrong? :?
I wish there were some examples on the wiki.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

abelle
Posts: 5
Joined: Fri Nov 07, 2014 4:25 am

Re: Nomenclature with units

Post by abelle »

Put it in the Document>Settings>LaTeX Preamble.
Post Reply