在不破坏布局的情况下合并命名条目

在不破坏布局的情况下合并命名条目

我正在尝试为论文中使用的所有符号生成命名法。一些具有相同索引的变量应该分组,因为它们属于同一组。但是,当我尝试对它们进行分组时,命名法的布局变得一团糟。参见下面的 MWE:

\documentclass{report}
\usepackage{nomencl}

% create the lsymb command
\newcommand{\lsymb}[2]{#1\nomenclature[b ]{#1}{\MakeUppercase#2}}

% make the nomenclature
\makenomenclature
\makeindex


\begin{document}
I would like to have the variables \lsymb{$a_f$, $b_f$, $c_f$ and $d_f$}{The variables I am trying to group} group on two lines in the nomenclature.

However, when I add more variables such as \lsymb{$a_b$}{another variable} and \lsymb{$c_f$}{yet another variable}, the lay-out gets quite messy.

I could try grouping the variables, like I did with \lsymb{$d_a$, $e_a$,}{a group of variables}\lsymb{$g_a$, and $h_a$}{{}}. But that grouping order will be broken if a variable \lsymb{$f$}{some annoying variable} were to come along.

\printnomenclature
\end{document}

输出如下:

文本 对应命名法

因此基本上发生的情况是:

  • 将变量归入一个组会扭曲布局
  • 将变量拆分到多行上会因自动字母排序而变得混乱(我希望保留)。

我正在寻找的解决方案:

  • 加宽包含变量的列,以便所有描述都对齐
  • 以某种方式将分组变量变成多行对象,这样其他变量就不会弄乱排序。

答案1

调用时添加可选参数,即长度,\printnomenclature例如

\printnomenclature[3cm]

梅威瑟:

\documentclass{report}
\usepackage{nomencl}

% create the lsymb command
\newcommand{\lsymb}[2]{#1\nomenclature[b ]{#1}{\MakeUppercase#2}}

% make the nomenclature
\makenomenclature
\makeindex


\begin{document}
I would like to have the variables \lsymb{$a_f$, $b_f$, $c_f$ and $d_f$}{The variables I am trying to group} group on two lines in the nomenclature.

However, when I add more variables such as \lsymb{$a_b$}{another variable} and \lsymb{$c_f$}{yet another variable}, the lay-out gets quite messy.

I could try grouping the variables, like I did with \lsymb{$d_a$, $e_a$,}{a group of variables}\lsymb{$g_a$, and $h_a$}{{}}. But that grouping order will be broken if a variable \lsymb{$f$}{some annoying variable} were to come along.

\printnomenclature[3cm]
\end{document} 

输出:

在此处输入图片描述

相关内容