ヘッダー内にヘッダーの説明を含む複数列の用語集を実現するにはどうすればよいですか?

ヘッダー内にヘッダーの説明を含む複数列の用語集を実現するにはどうすればよいですか?

現在、複数の列と列ヘッダーを持つ頭字語を書くのに問題があります。列ヘッダーのみの頭字語を書くことはできましたが、複数の列で書く方法がわかりません。これが 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スタイルのバージョンを持つことはできませんmcolslongtable環境は環境内では許可されておらず、モード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}

用語集の画像

関連情報