
我想在我的術語表中包含“小節”,或者只是一個接一個的兩個術語表。然而,我總是在詞彙表之間得到一個空白頁面(或者,因為我使用的是twoside & openright,甚至是兩個!)。
我找到了以下主題
簡短的版本是(我認為)任何基於“章節”的類別都會引入一個clearpage,我應該能夠使用它來刪除它
\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=section
作為詞彙表包。然後詞彙表的標題就會達到水平section
。
\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-Script 命令將本地的for\RedeclareSectionCommand
更改為.然後就沒有分頁符,而術語表標題仍然使用字體元素並在標題前後具有相同的空格。此解決方法至少需要 KOMA-Script 版本 3.18(目前版本為 3.19a)。style
chapter
section
chapter
chapter
\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
您可能需要以下幾種可能的東西:
- 術語表是章節,而不是章節;
- 術語表是章節,但採用自訂格式,不會像其他章節那樣插入空白頁;
- 當術語表是文件中唯一的內容時,術語表將成為章節,但在第一個術語表之前不要有額外的空白頁。
esdd的回答解決了前兩種可能性。
在第三種情況下,問題在於,\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}