
Ich habe derzeit Probleme, Akronyme mit mehreren Spalten und Spaltenüberschriften zu schreiben. Ich habe es geschafft, Akronyme nur mit Spaltenüberschriften zu schreiben, kann aber nicht herausfinden, wie ich sie in mehreren Spalten schreiben kann. Dies ist das MWE:
\documentclass[a4paper,openany]{report}
\usepackage[breaklinks,draft]{hyperref}
\usepackage[acronym,section,nopostdot,nonumberlist,nogroupskip,nostyles]
{glossaries}
\usepackage{glossary-mcols}
\makeglossaries
\begin{document}
\newglossaryentry{cur}{name=cur, description={Just a random name.}}
\newglossaryentry{mmee}{name=mmee, description={Just a random name.}}
\newglossaryentry{fsda}{name=fs, description={Just a random name.}}
\newglossaryentry{dcsc}{name=ddad, description={Just a random name.}}
\newglossaryentry{ccs}{name=adax, description={Just a random name.}}
\newglossaryentry{ccc}{name=acDc, description={Just a random name.}}
\newglossaryentry{vfvv}{name=gegfvv, description={Just a random name.}}
\newglossaryentry{fvafv}{name=gdgdfv, description={Just a random name.}}
\newglossaryentry{bgbb}{name=gegvf, description={Just a random name.}}
\newglossaryentry{gfvfv}{name=qefrwfav, description={Just a random name.}}
\gls{cur}
\gls{mmee}
\gls{fsda}
\gls{dcsc}
\gls{ccs}
\gls{ccc}
\gls{vfvv}
\gls{fvafv}
\gls{gfvfv}
\gls{bgbb}
\printglossary[style=mcolindex,title=List of Acronyms]
\end{document}
Antwort1
long
Es ist nicht möglich, eine Version eines Stils zu haben mcols
. Die longtable
Umgebung ist weder innerhalb einer multicols
Umgebung zulässig, noch kann sie im Modus verwendet werden twocolumn
(weder mit \twocolumn
noch als Klassenoption).
Die einfachste Möglichkeit zur Implementierung wäre eine Version longtable
mit vier Spalten (als zwei Paare aus Akronym und Beschreibung):
\documentclass[a4paper,openany]{report}
\usepackage{array}
\usepackage{longtable}
\usepackage[breaklinks,draft]{hyperref}
\usepackage[acronym,section,nostyles,entrycounter]
{glossaries}
\makeglossaries
\newlength\descwidth
\setlength{\descwidth}{0.25\textwidth}
\renewcommand*{\glsentrycounterlabel}{}%
\newglossarystyle{pairedtable}%
{%
\renewenvironment{theglossary}%
{\begin{longtable}{l>{\raggedright}p{\descwidth}l>{\raggedright}p{\descwidth}}}%
{\end{longtable}}%
\renewcommand*{\glossaryheader}{%
\bfseries \entryname & \bfseries
\descriptionname &
\bfseries \entryname & \bfseries
\descriptionname
\tabularnewline\endhead
}%
\renewcommand*{\glsgroupheading}[1]{}% no letter group headings
\renewcommand*{\glsgroupskip}{}% no gap between letter groups
\renewcommand{\glossentry}[2]{%
\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
\glossentrydesc{##1}% number list omitted
\ifodd\value{glossaryentry}\def\next{&}\else\def\next{\tabularnewline}\fi
\next
}%
\renewcommand{\subglossentry}[3]{\glossentry{##2}{##3}}%
}
\newglossaryentry{cur}{name=cur, description={Just a random name.}}
\newglossaryentry{mmee}{name=mmee, description={Just a random
name.}}
\newglossaryentry{fsda}{name=fs, description={Just a random name.}}
\newglossaryentry{dcsc}{name=ddad, description={Just a random
name.}}
\newglossaryentry{ccs}{name=adax, description={Just a random
name.}}
\newglossaryentry{ccc}{name=acDc, description={Just a random
name.}}
\newglossaryentry{vfvv}{name=gegfvv, description={Just a random
name.}}
\newglossaryentry{fvafv}{name=gdgdfv, description={Just a random
name.}}
\newglossaryentry{bgbb}{name=gegvf, description={Just a random
name.}}
\newglossaryentry{gfvfv}{name=qefrwfav, description={Just a random
name.}}
\begin{document}
\gls{cur}
\gls{mmee}
\gls{fsda}
\gls{dcsc}
\gls{ccs}
\gls{ccc}
\gls{vfvv}
\gls{fvafv}
\gls{gfvfv}
\gls{bgbb}
\printglossary[style=pairedtable,title=List of Acronyms]
\end{document}
Leider ist die Reihenfolge falsch, da die Tabelle zeilenweise aufgebaut ist:
Es gibt keine einfache Möglichkeit, makeindex
die Einträge so zu sortieren, dass sie von oben nach unten sortiert sind. Wenn Sie nur eine kleine Anzahl von Einträgen haben, können Sie die Sortierung manuell vornehmen und glossaries-extra
's verwenden \printunstglossary
(da Sie keine Zahlenliste möchten). Beispiel:
\documentclass[a4paper,openany]{report}
\usepackage{array}
\usepackage{longtable}
\usepackage[breaklinks,draft]{hyperref}
\usepackage[acronym,section,nostyles,entrycounter]
{glossaries-extra}
\newlength\descwidth
\setlength{\descwidth}{0.25\textwidth}
\renewcommand*{\glsentrycounterlabel}{}%
\newglossarystyle{pairedtable}%
{%
\renewenvironment{theglossary}%
{\begin{longtable}{l>{\raggedright}p{\descwidth}l>{\raggedright}p{\descwidth}}}%
{\end{longtable}}%
\renewcommand*{\glossaryheader}{%
\bfseries \entryname & \bfseries
\descriptionname &
\bfseries \entryname & \bfseries
\descriptionname
\tabularnewline\endhead
}%
\renewcommand*{\glsgroupheading}[1]{}% no letter group headings
\renewcommand*{\glsgroupskip}{}% no gap between letter groups
\renewcommand{\glossentry}[2]{%
\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
\glossentrydesc{##1}% number list omitted
\ifodd\value{glossaryentry}\def\next{&}\else\def\next{\tabularnewline}\fi
\next
}%
\renewcommand{\subglossentry}[3]{\glossentry{##2}{##3}}%
}
\newglossaryentry{ccc}{name=acDc, description={Just a random
name.}}
\newglossaryentry{fvafv}{name=gdgdfv, description={Just a random
name.}}
\newglossaryentry{ccs}{name=adax, description={Just a random
name.}}
\newglossaryentry{vfvv}{name=gegfvv, description={Just a random
name.}}
\newglossaryentry{cur}{name=cur, description={Just a random name.}}
\newglossaryentry{bgbb}{name=gegvf, description={Just a random
name.}}
\newglossaryentry{dcsc}{name=ddad, description={Just a random
name.}}
\newglossaryentry{mmee}{name=mmee, description={Just a random
name.}}
\newglossaryentry{fsda}{name=fs, description={Just a random name.}}
\newglossaryentry{gfvfv}{name=qefrwfav, description={Just a random
name.}}
\begin{document}
\gls{cur}
\gls{mmee}
\gls{fsda}
\gls{dcsc}
\gls{ccs}
\gls{ccc}
\gls{vfvv}
\gls{fvafv}
\gls{gfvfv}
\gls{bgbb}
\printunsrtglossary[style=pairedtable,title=List of Acronyms]
\end{document}
Dies ist nicht besonders praktisch, wenn Sie viele Einträge haben. Eine Alternative besteht darin, Side-by-Side- tabular
Umgebungen zu erstellen, aber Sie müssen die richtige Anzahl von Zeilen bestimmen. Im folgenden Beispiel habe ich mit dem glossaries
Paket bereitgestellte Testeinträge geladen, um das Glossar aufzufüllen:
\documentclass[a4paper,openany]{report}
\usepackage{array}
\usepackage[breaklinks,draft]{hyperref}
\usepackage[acronym,section,nostyles]{glossaries}
\makeglossaries
\loadglsentries[\acronymtype]{example-glossaries-acronym}% dummy entries
\newlength\descwidth
\setlength{\descwidth}{0.25\textwidth}
\newcounter{rowcount}
\newglossarystyle{table}%
{%
\renewenvironment{theglossary}%
{%
\setcounter{rowcount}{0}%
\begin{tabular}[t]{l>{\raggedright}p{\descwidth}}%
\bfseries \entryname & \bfseries
\descriptionname \tabularnewline
}
{\end{tabular}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}% no letter group headings
\renewcommand*{\glsgroupskip}{}% no gap between letter groups
\renewcommand{\glossentry}[2]{%
\stepcounter{rowcount}%
\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
\glossentrydesc{##1}% number list omitted
\ifnum\value{rowcount}=25 % 25 entries per column
\def\next{%
\end{tabular}\hfill
\setcounter{rowcount}{0}%
\begin{tabular}[t]{l>{\raggedright}p{\descwidth}}%
\bfseries \entryname & \bfseries
\descriptionname \tabularnewline
}%
\else
\def\next{\tabularnewline}%
\fi
\next
}%
\renewcommand{\subglossentry}[3]{\glossentry{##2}{##3}}%
}
\begin{document}
\glsaddall
\printglossary[type=\acronymtype,style=table,title=List of Acronyms]
\end{document}