目录中词汇表和索引的缩进与其他未编号章节不同步

目录中词汇表和索引的缩进与其他未编号章节不同步

我想将目录中未编号章节的缩进同步到章节号的位置(首选)或者至少在使用 KOMA-Script、词汇表和 LuLaTex 下的 imakeindex 时同步它们。

toc=indentunnumbered 没有帮助(索引缩进有问题)

以下是 MWE:

\documentclass{scrbook}
%\documentclass[toc=indentunnumbered]{scrbook}

\usepackage{csquotes}
\usepackage{polyglossia}

\setdefaultlanguage[
    variant     =   german,
    spelling    =   new,
]{german}

\usepackage{biblatex}

\usepackage[
    acronym     =   true,
    toc         =   true,
    numberline  =   true,
    nopostdot   =   true,
    section     =   chapter,
    nomain      =   true,
]{glossaries}

\makeglossaries
\usepackage{imakeidx}

\usepackage{hyperref}       

\newglossaryentry{apig}{name={API},
    description={An Application Programming Interface (API) is a particular set
        of rules and specifications that a software program can follow to access and
        make use of the services and resources provided by another particular software
        program that implements that API}}

\newglossaryentry{api}{type=\acronymtype, name={API}, description={Application
        Programming Interface}, first={Application
        Programming Interface (API)\glsadd{apig}}, see=[Glossary:]{apig}}
\makeindex[intoc]
\begin{document}

\tableofcontents    

\printglossary[                                     
    type            =   \acronymtype,
    title           =   Acronyms,
    toctitle        =   Acronyms,
    style           =   list,
    nonumberlist    =   true,
]

\addchap{Motivation}
\chapter{Chapter}
\index{Alpha}
\index{Alpha!Beta}
\index{Alpha!Beta1}
\index{Alpha!Beta2}
\index{Alpha!Gamma!Gamma}
\index{Alpha!Gamma!Delta}
\index{Alpha}
\section{First}
\section{Second}
\addchap{Abstract}

\printindex

\end{document}

在此处输入图片描述 在此处输入图片描述

答案1

要删除目录中首字母缩略词的缩进,请numberline=trueglossaries选项中删除:

\documentclass{scrbook}
%\documentclass[toc=indentunnumbered]{scrbook}

\usepackage{csquotes}
\usepackage{polyglossia}

\setdefaultlanguage[
    variant     =   german,
    spelling    =   new,
]{german}

\usepackage{biblatex}

\usepackage[
    acronym     =   true,
    toc         =   true,
    %numberline  =   true,% <- remove this
    nopostdot   =   true,
    section     =   chapter,
    nomain      =   true,
]{glossaries}

\makeglossaries
\usepackage{imakeidx}

\usepackage{hyperref}       

\newglossaryentry{apig}{name={API},
    description={An Application Programming Interface (API) is a particular set
        of rules and specifications that a software program can follow to access and
        make use of the services and resources provided by another particular software
        program that implements that API}}

\newglossaryentry{api}{type=\acronymtype, name={API}, description={Application
        Programming Interface}, first={Application
        Programming Interface (API)\glsadd{apig}}, see=[Glossary:]{apig}}
\makeindex[intoc]
\begin{document}

\tableofcontents    

\printglossary[                                     
    type            =   \acronymtype,
    title           =   Acronyms,
    toctitle        =   Acronyms,
    style           =   list,
    nonumberlist    =   true,
]

\addchap{Motivation}
\chapter{Chapter}
\index{Alpha}
\index{Alpha!Beta}
\index{Alpha!Beta1}
\index{Alpha!Beta2}
\index{Alpha!Gamma!Gamma}
\index{Alpha!Gamma!Delta}
\index{Alpha}
\section{First}
\section{Second}
\addchap{Abstract}

\printindex

\end{document}

结果:

截屏


如果索引应尊重选项toc=indentunnumbered添加\indexsetup{level=\addchap}和删除intoc选项\makeindex

%\documentclass{scrbook}
\documentclass[toc=indentunnumbered]{scrbook}

\usepackage{csquotes}
\usepackage{polyglossia}

\setdefaultlanguage[
    variant     =   german,
    spelling    =   new,
]{german}

\usepackage{biblatex}

\usepackage[
    acronym     =   true,
    toc         =   true,
    numberline  =   true,
    nopostdot   =   true,
    section     =   chapter,
    nomain      =   true,
]{glossaries}

\makeglossaries
\usepackage{imakeidx}
\indexsetup{level=\addchap}% <- added

\usepackage{hyperref}       

\newglossaryentry{apig}{name={API},
    description={An Application Programming Interface (API) is a particular set
        of rules and specifications that a software program can follow to access and
        make use of the services and resources provided by another particular software
        program that implements that API}}

\newglossaryentry{api}{type=\acronymtype, name={API}, description={Application
        Programming Interface}, first={Application
        Programming Interface (API)\glsadd{apig}}, see=[Glossary:]{apig}}
\makeindex% <- remove option intoc
\begin{document}

\tableofcontents

\printglossary[                                     
    type            =   \acronymtype,
    title           =   Acronyms,
    toctitle        =   Acronyms,
    style           =   list,
    nonumberlist    =   true,
]

\addchap{Motivation}
\chapter{Chapter}
\index{Alpha}
\index{Alpha!Beta}
\index{Alpha!Beta1}
\index{Alpha!Beta2}
\index{Alpha!Gamma!Gamma}
\index{Alpha!Gamma!Delta}
\index{Alpha}
\section{First}
\section{Second}
\addchap{Abstract}

\printindex

\end{document}

结果:

截屏

相关内容