水平对齐列(多列)

水平对齐列(多列)

我遇到了多列问题。我正在写一篇文档,并使用了 Thesis.cls 类这里

我有以下代码:

\documentclass[11pt, a4paper, twoside]{Thesis}
\usepackage[noprefix,norefeq]{nomencl} 
\usepackage{multicol}
\makenomenclature
\usepackage{ifthen}
\renewcommand{\nomgroup}[1]{%
\item[\bfseries
\ifthenelse{\equal{#1}{C}}{Acronyms}{%
\ifthenelse{\equal{#1}{A}}{Subscripts}{%
\ifthenelse{\equal{#1}{N}}{Notation}{%
\ifthenelse{\equal{#1}{G}}{Greek Letters}{}}}}%
]}

\renewcommand{\nomname}{List of Symbols}
\newcommand{\nomunit}[1]{%
\renewcommand{\nomentryend}{\hspace*{\fill}#1}}    

\begin{document}

\begin{multicols}{2}    
\printnomenclature    
\end{multicols}

\nomenclature[N]{A}{Somthing}
\nomenclature[N]{A}{Somthing}
\nomenclature[N]{A}{Somthing}
\nomenclature[N]{A}{Somthing}
\end{document}

但我遇到了一个问题。打印出来的列没有对齐(见下图)。“下标”前面有一个多余的空格。

在此处输入图片描述

答案1

您需要在环境multicols内部打开和关闭环境thenomenclature,这可以使用\nompreamble\nompostamble挂钩来完成。

\documentclass[11pt, a4paper, twoside]{book}
\usepackage[noprefix,norefeq]{nomencl} 
\usepackage{multicol}
\makenomenclature
\usepackage{ifthen}
\renewcommand{\nomgroup}[1]{%
\item[\bfseries
\ifthenelse{\equal{#1}{C}}{Acronyms}{%
\ifthenelse{\equal{#1}{A}}{Subscripts}{%
\ifthenelse{\equal{#1}{N}}{Notation}{%
\ifthenelse{\equal{#1}{G}}{Greek Letters}{}}}}%
]}

\renewcommand{\nomname}{List of Symbols}
\newcommand{\nomunit}[1]{%
\renewcommand{\nomentryend}{\hspace*{\fill}#1}}
\renewcommand{\nompreamble}{\begin{multicols}{2}}
\renewcommand{\nompostamble}{\end{multicols}}

\begin{document}

Some text

\printnomenclature    

% populate the nomenclature with dummy entries    
\count255=0
\loop\ifnum\count255<60
\advance\count255 1
\edef\temp{\noexpand\nomenclature[N]{A}{\romannumeral\count255}}\temp
\repeat

\end{document}

在此处输入图片描述

相关内容