
現在、複数の列と列ヘッダーを持つ頭字語を書くのに問題があります。列ヘッダーのみの頭字語を書くことはできましたが、複数の列で書く方法がわかりません。これが 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}
答え1
long
スタイルのバージョンを持つことはできませんmcols
。longtable
環境は環境内では許可されておらず、モードmulticols
で使用することもできませんtwocolumn
(クラス オプションとともに、\twocolumn
またはクラス オプションとして)。
longtable
これを実装する最も簡単な方法は、4 つの列 (頭字語と説明のペア 2 つ)を持つことです。
\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}
残念ながら、テーブルは行ごとに構築されているため、順序が間違っています。
エントリを上から下への順序で並べ替える簡単な方法はありませんmakeindex
。エントリ数が少ない場合は、手動で順序付けを行い、 を使用しますglossaries-extra
(\printunstglossary
番号リストは必要ないため)。例:
\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}
エントリが多数ある場合、これは特に便利ではありません。別の方法としては、並列環境を構築することですが、正しい行数を決定する必要があります。以下の例では、用語集を埋めるためにパッケージtabular
に付属するテスト エントリを読み込んでいます。glossaries
\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}