为了节省页面空间,我还使用\usepackage{glossary-mcols}
将首字母缩略词打印成两列。同样的空间技巧来自这里 (Nicola 回答)不幸的是,调用后不起作用\setglossarystyle{mcolindex}
。如何将相同的距离放入两列缩写中?MWE:
\documentclass[oneside]{scrbook}
\usepackage[english,ngerman]{babel} % Multilingual support -> ctan.org/pkg/babel?lang=en
%TOSET Modify list of (glossar, acronyms, symbols) appearance
\usepackage[acronyms,nopostdot,nonumberlist]{glossaries} % Make custom, multiple, sorted lists (abbreviation, glossary(explaining terms), symbols)
\setacronymstyle{long-short} % behaviour: first time use long term, then use abbreviation
\newglossary*{mysyms}{Symbolverzeichnis} % custom glossary, type=mysmys
\makenoidxglossaries % initialize, the main(def.) glossary gets dedicated to definitions
\newglossaryentry{potato}{name={potato},plural={potatoes}, description={starchy tuber}} % From the text reference with \gls{<label>}, for headings \glsentrytext{<label>}
\newglossaryentry{cabbage}{name={cabbage},description={vegetable with thick green or purple leaves}}
\newglossaryentry{ROS_def}{name={ROS},description={Operating system connecting various C++ nodes}}
\newacronym{ac:ros}{ROS}{Roboter Operating System}
\newacronym{ac:svm}{SVM}{support vector machine}
\newacronym{ac:II}{II}{Interconnected Intersection}
\newglossaryentry{R}{type=mysyms,name={R},description={rational number amount}}
\usepackage{glossary-mcols}
\renewcommand*{\glsmcols}{2}
\begin{document}
\tableofcontents
\glstoctrue
\glsglossarymark{Glossar} % change header if wanted
\setglossarystyle{alttree}
\glssetwidest{cabbage}
\printnoidxglossary % Shortcut to display all glossaries at once
\setglossarysection{section} % get them on one page
\setglossarystyle{mcolindex}
\glssetwidest{ROS}
\printnoidxglossary[type=acronym]
\printnoidxglossary[type=mysyms]
\chapter{title}
Test use: \acrfull{ac:ros} \acrfull{ac:svm} \gls{R} \gls{cabbage} \gls{potato} \gls{ROS_def} \acrfull{ac:II}
\end{document}
答案1
该命令\glssetwidest
仅适用于alttree
样式(参见树状样式)。该glossary-mcols
包提供了与 中的样式类似的样式glossary-tree
,因此\glssetwidest
也可以与mcolalttree
样式一起使用,但不能与任何其他样式一起使用。
最简单的解决方案就是替换mcolindex
为mcolalttree
:
\documentclass[oneside]{scrbook}
\usepackage[acronyms,nopostdot,nonumberlist,toc]{glossaries}
\setacronymstyle{long-short}
\newglossary*{mysyms}{Symbolverzeichnis}
\makenoidxglossaries
\newglossaryentry{potato}{name={potato},plural={potatoes}, description={starchy tuber}}
\newglossaryentry{cabbage}{name={cabbage},description={vegetable with thick green or purple leaves}}
\newglossaryentry{ROS_def}{name={ROS},description={Operating system connecting various C++ nodes}}
\newacronym{ac:ros}{ROS}{Roboter Operating System}
\newacronym{ac:svm}{SVM}{support vector machine}
\newacronym{ac:II}{II}{Interconnected Intersection}
\newglossaryentry{R}{type=mysyms,name={R},description={rational number amount}}
\usepackage{glossary-mcols}
\renewcommand*{\glsmcols}{2}
\begin{document}
\tableofcontents
\glsglossarymark{Glossar}
\setglossarystyle{alttree}
\glssetwidest{cabbage}
\printnoidxglossary
\setglossarysection{section}
\setglossarystyle{mcolalttree}
\glssetwidest{ROS}
\printnoidxglossary[type=acronym]
\printnoidxglossary[type=mysyms]
\chapter{title}
Test use: \acrfull{ac:ros} \acrfull{ac:svm} \gls{R} \gls{cabbage} \gls{potato} \gls{ROS_def} \acrfull{ac:II}
\end{document}