
這段程式碼是從在這裡找到解決方案。
你如何讓桌子像這樣向左齊平:?
這是代碼:
\documentclass{article}
\usepackage[acronym,toc]{glossaries}
\makeglossaries
\newacronym{uri}{URI}{Unique Resonance Identifier}
\newacronym{led}{LED}{light-emitting diode}
\newacronym{eeprom}{EEPROM}{electrically erasable programmable
read-only memory}
\glsaddall[types=\acronymtype]
\newglossarystyle{custom_acronyms}
{
\setglossarystyle{long3colheader}%
\renewcommand*{\glossaryheader}{}%
\renewcommand{\glossentry}[2]{%
\textbf{\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}}
& \glossentrydesc{##1}
& ##2
\tabularnewline}%
}
\begin{document}
No acronyms here.
%\printglossaries
\printglossary[type=acronym,style=custom_acronyms]
\end{document}
答案1
詞彙表實際上使用 longtable 來產生詞彙表,因此您需要做的是告訴 LaTeX 您不想要表格的預設邊距設定。這是由 完成的\setlength{\LTleft}{0pt}
。如果這仍然不夠,您可以使用負數將表格進一步向左推,例如\setlength{\LTleft}{-5pt}
這是我的 MWE
\documentclass{article}
\usepackage[acronym,toc]{glossaries}
\makeglossaries
\newacronym{uri}{URI}{Unique Resonance Identifier}
\newacronym{led}{LED}{light-emitting diode}
\newacronym{eeprom}{EEPROM}{electrically erasable programmable
read-only memory}
\glsaddall[types=\acronymtype]
\newglossarystyle{custom_acronyms}
{
\setglossarystyle{long3col}%
\renewcommand*{\glossaryheader}{}%
\renewcommand{\glossentry}[2]{%
\textbf{\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}}
& \glossentrydesc{##1}
& ##2
\tabularnewline}%
}
\begin{document}
Acronyms here (so that the glo file will be generated): \gls{uri}, \gls{led}, \gls{eeprom}.
%\printglossaries
\setlength\LTleft{-5pt}
\printglossary[type=acronym,style=custom_acronyms]
\end{document}
哪個產生