2

I am trying to create a list of notations in which the symbols are on the left of the page but they have an alignment on the right while the meanings are on the right of the page but they have an alignment on the left. On the page there should be a nice rectangular block separating the symbols and the meanings when I am done. I have been using \hskip, \vskip and \quad but the alignments are not perfect. Is there a way to get neater alignments?

3

You could make a table for this.

If you use the column specification {r@{\hspace{10mm}}l}, then the first column will be right-aligned (r), the second column will be left-aligned (l), and between them there will be a 10mm gap.

As set_kwr has suggested, you could use the tabbing environment. One advantage of the tabular environment is that it calculates the width of each column automatically from the text that you put into it.

Normally, tables can only be on a single page. If you would like your table to break over multiple pages, you can use the longtable package.

Code

\documentclass{article}
\usepackage{longtable}
\begin{document}
\begin{longtable}{r@{\hspace{10mm}}l} 
Praesent quis & sagittis nunc. Suspendisse posuere \\
diam & a augue volutpat euismod. Phasellus odio est, \\
consequat sed ullamcorper vel & commodo et est. \\
Phasellus & commodo blandit dolor, sed sodales.
\end{longtable}
\end{document}

Result

enter image description here

1

Try using the tabbing environment:

\documentclass[12pt]{article}
\begin{document}
\begin{tabbing}
  \makebox[3cm][r]{$x_1$ }\= : The first variable \\
  \makebox[3cm][r]{$x_2$ }\> : The second variable which is really important\\
  \makebox[3cm][r]{$Y_3=x_1+x_2$ }\> : a simple equation 
\end{tabbing}
\end{document}

enter image description here

0

For such things packages like nomencl or glossaries are well suitable.

Using such packages hava a lot of advantages. E.g.:

  • automatic sorting
  • manipulation of strings can be done global
  • formatting is much easier
  • it's more flexible to use it for other articles
  • ...

Here an example using glossaries:

\listfiles
\documentclass{article}
\usepackage{glossaries}
\newglossary[nlg]{notation}{not}{ntn}{Notation}
\makeglossaries
\newcommand*{\notationentry}[2]{\newglossaryentry{#1}{type=notation,#2}}
\notationentry{ohm}{name=ohm,symbol={\ensuremath{\Omega}},description=unit of electrical resistance}
\notationentry{sigma}{name=sigma,symbol={\ensuremath{\sigma}},description=Newton---}
\glsaddall[types={notation}]

\newglossarystyle{listnotation}{%
  \glossarystyle{long}%
  \renewcommand*{\glossaryentryfield}[5]{%
    \glsentryitem{##1}\glstarget{##1}{##4} & ##3\glspostdescription\\}%
}

\begin{document}
Text
\printglossary[type=notation,style=listnotation]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.