0

Simply put, the nomencl package sees | as a special character (as mentioned here). I am interested in inserting a table with vertical lines. If I use | to denote a vertical line, the entry wouldn't show in the nomenclature list.

The ideas that I can think of to overcome this is generating the table as a standalone and importing the pdf in the entry or generate the entire table using TikZ, as shown here.

Is there a simpler approach to adapt to?

Here is a minimal example:

%pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex
%makeindex %.nlo -s nomencl.ist -o %.nls
%pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex
\documentclass[12pt]{article}
\usepackage{nomencl}

\makenomenclature
\makeindex

\begin{document} \printnomenclature[1in]

\nomenclature{Entry 1}{
    \begin{tabular}{ccc}
        a & a & a \\
        a & a & a \\
        a & a & a
    \end{tabular}
}
\nomenclature{Entry 2}{
    \begin{tabular}{|ccc|}
        b & b & b \\
        b & b & b \\
        b & b & b
    \end{tabular}
}

\end{document}

M. Al Jumaily
  • 4,035
  • 2
  • 11
  • 26

1 Answers1

1

Thanks to F. Pantigny and David Carlisle for directing me to get to the solution.

I used the array package and declared my own newcolumntype as:

\newcolumntype{~}{!{\vrule width 1pt}}

or (as egreg's comment suggestion)

\newcolumntype{~}{|}

and used \begin{tabular}{~c~c~c~}...\end{tabular}.

Output

%pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex
%makeindex %.nlo -s nomencl.ist -o %.nls
%pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex
\documentclass[12pt]{article}
\usepackage{nomencl}
\usepackage{array}
\newcolumntype{~}{!{\vrule width 1pt}}

\makenomenclature
\makeindex

\begin{document} \printnomenclature[1in]

\nomenclature{Entry 1}{
    \begin{tabular}{ccc}
        a & a & a \\
        a & a & a \\
        a & a & a
    \end{tabular}
}
\nomenclature{Entry 2}{
    \begin{tabular}{~c~c~c~}
        b & b & b \\
        b & b & b \\
        b & b & b
    \end{tabular}
}

\end{document}

M. Al Jumaily
  • 4,035
  • 2
  • 11
  • 26