词汇表 - 调整列宽/列间距

词汇表 - 调整列宽/列间距

我需要你的帮助。

我尝试制作一个首字母缩略词词汇表。我正在使用 LuaLaTeX 进行编译,目前使用 printnoidxglossaries 和 glossary-longbooktabs 包,因为 long-booktabs 自定义样式正是我想要的。

但是,我不确定如何进一步定制这个词汇表。

首先,我想重新调整列间距,这样列之间的间距就更大了,同时右侧的空白空间也更小了。特别是“描述”列的宽度太长,这有点让人不爽,尤其是对于非常短的描述。是否可以调整水平线的长度?

对于高级定制:有人知道是否也可以将文本居中吗?

多谢!

代码片段示例:

\RequirePackage[l2tabu,orthodox]{nag}

\documentclass[headsepline,footsepline,footinclude=false,oneside,fontsize=11pt,paper=a4,listof=totoc,bibliography=totoc,DIV=12]{scrbook} % one-sided

\PassOptionsToPackage{table,svgnames,dvipsnames}{xcolor}

\usepackage[ngerman,english]{babel} % english is the same as american or USenglish
\usepackage[autostyle]{csquotes}
\usepackage[%
backend=biber,
url=true,
style=chem-angew, % alphabetic, numeric
sorting=none, % default == nty, https://tex.stackexchange.com/questions/51434/biblatex-citation-order
maxnames=4,
minnames=3,
maxbibnames=99,
giveninits,
uniquename=init]{biblatex} 
%\addbibresource{bibliography.bib}

\setlength{\parindent}{0pt}

\usepackage{scrhack} % necessary for listings package
\usepackage{listings}
\usepackage{lstautogobble}

\usepackage{booktabs} % for better looking table creations, but bad with vertical lines by design (package creator despises vertical lines)
\usepackage[final]{microtype} %resize the text
\usepackage{caption}


\usepackage{fontspec}

\usepackage{longtable}


\usepackage[acronym,xindy,toc,symbols]{glossaries} 
\usepackage{glossaries-extra}
\usepackage{glossary-longbooktabs}

\setabbreviationstyle[acronym]{long-short}
\makenoidxglossaries

\newacronym{Exp1}{Exp1}{Test 1}
\newacronym{Exp2}{Exp2}{Test 2}
\newacronym{Exp3}{Exp3}{Test 3}



\begin{document}


\selectlanguage{english}

\frontmatter{}

\microtypesetup{protrusion=false}


\printnoidxglossary[type=acronym, nogroupskip, style=long-booktabs, nonumberlist]
 %style=long-booktabs
\microtypesetup{protrusion=true}

\mainmatter{}

\gls{Exp1}
\gls{Exp2}
\gls{Exp3}

\end{document}

![间距问题] (https://i.stack.imgur.com/1gjVn.png

答案1

以下是一个例子:

\RequirePackage[l2tabu,orthodox]{nag}

\documentclass[headsepline,footsepline,footinclude=false,oneside,fontsize=11pt,paper=a4,listof=totoc,bibliography=totoc,DIV=12]{scrbook} % one-sided

\PassOptionsToPackage{table,svgnames,dvipsnames}{xcolor}

\usepackage[ngerman,english]{babel} % english is the same as american or USenglish
\usepackage[autostyle]{csquotes}
\usepackage[%
backend=biber,
url=true,
style=chem-angew, % alphabetic, numeric
sorting=none, % default == nty, https://tex.stackexchange.com/questions/51434/biblatex-citation-order
maxnames=4,
minnames=3,
maxbibnames=99,
giveninits,
uniquename=init]{biblatex} 
%\addbibresource{bibliography.bib}

\setlength{\parindent}{0pt}

\usepackage{scrhack} % necessary for listings package
\usepackage{listings}
\usepackage{lstautogobble}

\usepackage{booktabs} % for better looking table creations, but bad with vertical lines by design (package creator despises vertical lines)
\usepackage[final]{microtype} %resize the text
\usepackage{caption}


\usepackage{fontspec}

\usepackage{longtable}


\usepackage[acronym,xindy,toc,symbols]{glossaries} 
\usepackage{glossaries-extra}
\usepackage{glossary-longbooktabs}

%%%%%%%%%%%%
% Solution %
%%%%%%%%%%%%
\newglossarystyle{my-long-booktabs}{
\setglossarystyle{long-booktabs}
\renewenvironment{theglossary}%
{\begin{longtable}{>{\centering\arraybackslash}p{3.5cm}>{\centering\arraybackslash}p{\glsdescwidth}}}
{\end{longtable}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setabbreviationstyle[acronym]{long-short}
\makenoidxglossaries

\newacronym{Exp1}{Exp1}{Test 1}
\newacronym{Exp2}{Exp2}{Test 2}
\newacronym{Exp3}{Exp3}{Test 3}
\newacronym{Exp4}{Long Example notation}{very very very very very very long description for this example}



\begin{document}


\selectlanguage{english}

\frontmatter

\microtypesetup{protrusion=false}


\printnoidxglossary[type=acronym, nogroupskip, style=my-long-booktabs, nonumberlist]
 %style=long-booktabs
\microtypesetup{protrusion=true}

\mainmatter

\gls{Exp1}
\gls{Exp2}
\gls{Exp3}
\gls{Exp4}

\end{document}

在此处输入图片描述

相关内容