用語集の前に空白ページを削除する

用語集の前に空白ページを削除する

用語集に「サブセクション」を入れたい、または単純に 2 つの用語集を連続して表示したいのですが、用語集の間には常に空白ページ (twoside と openright を使用しているため、2 つ) が表示されます。

次のトピックを見つけました

用語集の前の改ページを削除

簡単に言うと、(私が思うに)「章」ベースのクラスではクリアページが導入され、それを削除できるはずです。

\renewcommand*{\glsclearpage}{}

ただし、これは私の場合は機能しません。または、正しく呼び出していない可能性があります。

次のようなミニ例を作成しました。

\documentclass[11pt,a4paper,twoside,openright]{scrreprt}

% Include Glossary Package
\usepackage[style=alttree,nonumberlist,acronym]{glossaries}
\glssetwidest{ABCD}% widest name
\renewcommand*{\glsclearpage}{}

% Create Glossaries
\newglossary{type1}{gls1}{glo1}{Glossary 1}
\newglossary{type2}{gls2}{glo2}{Glossary 2}

% Generate Glossary Entries
\newglossaryentry{Entry1}{type = type1, name = $aaaa$, description = Position}
\newglossaryentry{Entry2}{type = type1, name = $bbbb$, description = Velocity}
\newglossaryentry{Entry3}{type = type2, name = $cccc$, description = Position}
\newglossaryentry{Entry4}{type = type2, name = $dddd$, description = Velocity}

% Generate Glossaries
\makeglossaries


\begin{document}

% Print Glossaries
\glsaddall
\printglossary[type=type1]
\printglossary[type=type2]

\end{document} 

何が間違っているのでしょうか?

どうもありがとう!乾杯


編集、解決策: 以下の提案を参考にして、いくつかの特定の用語集「セクション」を含むメインの用語集の章を作成することができました。

\documentclass[11pt,a4paper]{scrreprt}

% Include Glossary Package
\usepackage[toc,style=alttree,nonumberlist,acronym,section=section]{glossaries}
\glssetwidest{ABCD}% widest name[![enter image description here][2]][2]

% Create Glossaries
\newglossary{type1}{gls1}{glo1}{Accronyms}
\newglossary{type2}{gls2}{glo2}{Nomenclature}

% Generate Glossary Entries
\newglossaryentry{Entry1}{type = type1, name = $aaaa$, description = Position}
\newglossaryentry{Entry2}{type = type1, name = $bbbb$, description = Velocity}
\newglossaryentry{Entry3}{type = type2, name = $cccc$, description = Position}
\newglossaryentry{Entry4}{type = type2, name = $dddd$, description = Velocity}

% Generate Glossaries
\makeglossaries
\glsaddall

\begin{document}

\tableofcontents

% First, start main glossary chapter
\addchap{My Glossaries}
Some introductory text if desired.
% Now print actual glossaries
\printglossary[type=type1]
\printglossary[type=type2]
\bigskip\noindent
Some concluding text if desired.

\end{document} 

出力

(フォーラムの出力を短くするために「twoside,openright」オプションを削除しただけで、他の影響はありません)

答え1

用語集パッケージにはオプションsectionまたは を使用できます。すると、用語集はレベル の見出しを取得します。section=sectionsection

    \documentclass[11pt,a4paper,twoside,openright]{scrreprt}
    % Include Glossary Package
    \usepackage[style=alttree,nonumberlist,acronym,
        section=section% <- added
    ]{glossaries}
    \glssetwidest{ABCD}% widest name
    % Create Glossaries
    \newglossary{type1}{gls1}{glo1}{Glossary 1}
    \newglossary{type2}{gls2}{glo2}{Glossary 2}
    % Generate Glossary Entries
    \newglossaryentry{Entry1}{type = type1, name = $aaaa$, description = Position}
    \newglossaryentry{Entry2}{type = type1, name = $bbbb$, description = Velocity}
    \newglossaryentry{Entry3}{type = type2, name = $cccc$, description = Position}
    \newglossaryentry{Entry4}{type = type2, name = $dddd$, description = Velocity}
    % Generate Glossaries
    \makeglossaries
    \begin{document}
    % Print Glossaries
    \glsaddall
    \printglossary[type=type1]
    \printglossary[type=type2]
    \end{document} 

ここに画像の説明を入力してください

用語集の見出しを同じchapterレベルにする必要がある場合は、KOMA スクリプト コマンドを使用して、ローカルで を に\RedeclareSectionCommand変更できます。すると、フォント要素を使用して用語集の見出しが同じレベルにあり、見出しの前後に同じスペースがある間は、改ページは発生しません。この回避策styleには、少なくとも KOMA スクリプト バージョン 3.18 (現在は 3.19a) が必要です。chaptersectionchapterchapter

    \documentclass[11pt,a4paper,twoside,openright]{scrreprt}
    % Include Glossary Package
    \usepackage[style=alttree,nonumberlist]{glossaries}
    \glssetwidest{ABCD}% widest name
    % Create Glossaries
    \newglossary{type1}{gls1}{glo1}{Glossary 1}
    \newglossary{type2}{gls2}{glo2}{Glossary 2}
    % Generate Glossary Entries
    \newglossaryentry{Entry1}{type = type1, name = $aaaa$, description = Position}
    \newglossaryentry{Entry2}{type = type1, name = $bbbb$, description = Velocity}
    \newglossaryentry{Entry3}{type = type2, name = $cccc$, description = Position}
    \newglossaryentry{Entry4}{type = type2, name = $dddd$, description = Velocity}
    % Generate Glossaries
    \makeglossaries
    \begin{document}
    % Print Glossaries
    \glsaddall
    \begingroup
        \RedeclareSectionCommand[style=section,indent=0pt]{chapter}
        \printglossary[type=type1]
        \printglossary[type=type2]
    \endgroup
    \chapter{Chapter}
    \end{document} 

ここに画像の説明を入力してください

どちらの例でも、コマンドは\glsaddall最初の用語集の見出しの前に追加の水平スペースを挿入することに注意してください。したがって、以下も参照してください。cfrの回答


最初の用語集の前の空白ページを削除すると、cfrの回答用語集間の空のページを削除することもできます:\KOMAoptions{open=any}ローカルで使用します。

\documentclass[11pt,a4paper,twoside,openright]{scrreprt}
\usepackage{showframe}

% Include Glossary Package
\usepackage[style=alttree,nonumberlist]{glossaries}
\glssetwidest{ABCD}% widest name
% Create Glossaries
\newglossary{type1}{gls1}{glo1}{Glossary 1}
\newglossary{type2}{gls2}{glo2}{Glossary 2}
% Generate Glossary Entries
\newglossaryentry{Entry1}{type = type1, name = $aaaa$, description = Position}
\newglossaryentry{Entry2}{type = type1, name = $bbbb$, description = Velocity}
\newglossaryentry{Entry3}{type = type2, name = $cccc$, description = Position}
\newglossaryentry{Entry4}{type = type2, name = $dddd$, description = Velocity}
% Generate Glossaries
\makeglossaries\glsaddall% < see https://tex.stackexchange.com/a/300060/43317
\begin{document}
% Print Glossaries
\begingroup
    \KOMAoptions{open=any}
    \printglossary[type=type1]
    \printglossary[type=type2]
\endgroup
\chapter{First Chapter}
\chapter{Second Chapter}
\end{document} 

ここに画像の説明を入力してください

答え2

ここで必要なことがいくつかあります:

  1. 用語集は章ではなくセクションにする。
  2. 用語集を章にしますが、他の章のように空白ページが挿入されないカスタム形式を使用します。
  3. 用語集は章として扱われますが、文書内に用語集のみが含まれる場合は、最初の用語集の前に空白ページを追加しないでください。

esddの回答最初の 2 つの可能性について説明します。

3 番目のケースでは、\glsaddall実際には何もタイプセットされていないにもかかわらず、コンテンツとしてカウントされるように見えるという問題があります。これはバグだと思います。私の知る限り、この動作は発生しないはずです。

ただし、簡単な解決策があるため、これ以上調べませんでした。ドキュメントではなく、プリアンブルでコマンドを使用すれば、すべてうまくいきます。

\documentclass[11pt,a4paper,twoside,openright]{scrreprt}
\usepackage[style=alttree,nonumberlist,acronym]{glossaries}
\glssetwidest{ABCD}% widest name
\renewcommand*{\glsclearpage}{}

\newglossary{type1}{gls1}{glo1}{Glossary 1}
\newglossary{type2}{gls2}{glo2}{Glossary 2}

\newglossaryentry{Entry1}{type = type1, name = $aaaa$, description = Position}
\newglossaryentry{Entry2}{type = type1, name = $bbbb$, description = Velocity}
\newglossaryentry{Entry3}{type = type2, name = $cccc$, description = Position}
\newglossaryentry{Entry4}{type = type2, name = $dddd$, description = Velocity}

\makeglossaries
\glsaddall

\begin{document}

\printglossary[type=type1]
\printglossary[type=type2]

\end{document}

余分な空白のない通常の章

関連情報