我如何将ToC
、LoF
、gls
和idx
列表bib
设为子部分?
我使用 lualatex 和tocbibind 包。但是参考书目没有显示,ToC
我需要获取“参考文献”部分下子部分中所有列表的条目。这可能吗?
编辑:[WIP](x = 完成)
[x] 批号
[x] LOF 数量
[x] 号码簿
[x] GLS 数量
[x] 将 BIB 列为子部分
[x] 将 GLS 列为子节
[ ] 将 LOT 列为子部分
[ ] 将 LOF 列为子节
[ ] 将 IDX 列为子部分
[ ] 数字 IDX
mwe编辑:
\documentclass{article}
\usepackage{geometry}
\usepackage[ngerman]{babel}
\usepackage{fontspec}
\usepackage{caption}
\usepackage[
nottoc, % TOC in TOC as line with Pagenumber
numbib, % Number bib
numindex, % Number Idx
]{tocbibind} % add line to TOC with Fig,Tab,Ind,
\usepackage{tikz} %Support for more advanced Graphics
\usepackage{biblatex}
\usepackage{imakeidx} % Word Index
\makeindex[
intoc, % this adds the Index to TOC!
]
\usepackage[
toc,% this adds the Index to TOC!
section=subsection,
numberedsection
]{glossaries}
\makeglossaries
\usepackage{filecontents}
\begin{filecontents}{bib.bib}
@online{wikipedia,
title = {Wikipedia},
month = {10},
year = {2018},
url = {https://de.wikipedia.org/wiki/Wikipedia},
}
\end{filecontents}
\addbibresource{bib.bib}
\begin{filecontents}{glossary.tex}
\newglossaryentry{testing}{
name={testing},
description={t.b.d.},
text={testing}
}
\end{filecontents}
\input{glossary}
\renewcommand{\listoftables}{\begingroup
\tocsection
\tocfile{\listtablename}{lot}
\endgroup}
\renewcommand{\listoffigures}{\begingroup
\tocsection
\tocfile{\listfigurename}{lot}
\endgroup}
\renewcommand{\listoffigures}{\begingroup
\tocsection
\tocfile{\listfigurename}{lot}
\endgroup}
\begin{document}
\tableofcontents
\section{Section one}
test (idx)\index{test}(reference)\ref{sample}(cite)\cite{wikipedia}(glossary)\gls{testing}
\begin{figure}[!ht]
\includegraphics[width=5cm]{example-image}
\caption{sample}
\label{sample}
\end{figure}
\begin{table}[htp]
\begin{center}
\begin{tabular}{p{0.03\linewidth}}
sample table
\end{tabular}
\end{center}
\caption{default}
\label{default}
\end{table}
\section{Referenzen (German for References)}
\printbibliography[heading=subbibnumbered]
\listoffigures
\listoftables
\printindex
\printglossaries[toclevel=subsection,numberedsection]
\end{document}
答案1
没有包的建议tocbibind
:使用\indexsetup{level=\subsection
包提供的imakeidx
并且使用包tocbasic
将 LoF 和 LoT 编号为子部分。
\documentclass{article}
\usepackage{geometry}
\usepackage[ngerman]{babel}
\usepackage{fontspec}
\usepackage{caption}
\usepackage{tikz}% loads also graphicx etc.
\usepackage{tocbasic}
\addtotoclist[float]{lof}
\renewcommand*\listoffigures{\listoftoc[{\listfigurename}]{lof}}
\setuptoc{lof}{numbered,leveldown}
\addtotoclist[float]{lot}
\renewcommand*\listoftables{\listoftoc[{\listtablename}]{lot}}
\setuptoc{lot}{numbered,leveldown}
\usepackage{biblatex}
\usepackage[
section=subsection,
numberedsection
]{glossaries}
\makeglossaries
\usepackage{imakeidx}
\indexsetup{
level=\subsection,
%noclearpage % does not work as expected, removes the index in this example??
}
\makeindex
\usepackage{filecontents}
\begin{filecontents}{bib.bib}
@online{wikipedia,
title = {Wikipedia},
month = {10},
year = {2018},
url = {https://de.wikipedia.org/wiki/Wikipedia},
}
\end{filecontents}
\addbibresource{bib.bib}
\begin{filecontents}{glossary.tex}
\newglossaryentry{testing}{
name={testing},
description={t.b.d.},
text={testing}
}
\end{filecontents}
\input{glossary}
\begin{document}
\tableofcontents
\section{Section one}
test (idx)\index{test}(reference)\ref{sample}(cite)\cite{wikipedia}(glossary)\gls{testing}
\begin{figure}[!ht]
\includegraphics[width=5cm]{example-image}
\caption{sample}
\label{sample}
\end{figure}
\begin{table}[htp]
\centering
\begin{tabular}{c}
sample table
\end{tabular}
\caption{default}
\label{default}
\end{table}
\section{Referenzen (German for References)}
\printbibliography[heading=subbibnumbered]
\listoffigures
\listoftables
\printindex
\printglossaries
\end{document}
结果:
答案2
我在目录中添加了一条手动行。
它没有正确对齐,但是它伪造了这些包中缺少的子部分(不太好)但很有效。
令人遗憾的是这些软件包不能更好地协同工作。
\documentclass{article}
\usepackage{geometry}
\usepackage[ngerman]{babel}
\usepackage{fontspec}
\usepackage{caption}
\usepackage[
nottoc, % TOC in TOC as line with Pagenumber
numbib, % Number bib
numindex, % Number Idx
notlot,
notlof,
]{tocbibind} % add line to TOC with Fig,Tab,Ind,
\usepackage{tikz} %Support for more advanced Graphics
\usepackage{biblatex}
\usepackage{imakeidx} % Word Index
\makeindex[
%intoc, % this adds the Index to TOC!
]
\usepackage[
toc,% this adds the Index to TOC!
section=subsection,
numberedsection
]{glossaries}
\makeglossaries
\usepackage{filecontents}
\begin{filecontents}{bib.bib}
@online{wikipedia,
title = {Wikipedia},
month = {10},
year = {2018},
url = {https://de.wikipedia.org/wiki/Wikipedia},
}
\end{filecontents}
\addbibresource{bib.bib}
\begin{filecontents}{glossary.tex}
\newglossaryentry{testing}{
name={testing},
description={t.b.d.},
text={testing}
}
\end{filecontents}
\input{glossary}
\begin{document}
\tableofcontents
\section{Section one}
test (idx)\index{test}(reference)\ref{sample}(cite)\cite{wikipedia}(glossary)\gls{testing}
\begin{figure}[!ht]
\includegraphics[width=5cm]{example-image}
\caption{sample}
\label{sample}
\end{figure}
\begin{table}[htp]
\begin{center}
\begin{tabular}{p{0.03\linewidth}}
sample table
\end{tabular}
\end{center}
\caption{default}
\label{default}
\end{table}
\section{Referenzen}
%\nocite{*} %------------ BIBLIOGRAPHY --------------
\printbibliography[heading=subbibnumbered]
\stepcounter{subsection}
\newpage %---------------- FIGURES -----------------
\addcontentsline{toc}{subsection}{
\protect\numberline{\thesubsection} Abbildungsverzeichniss}
\listoffigures
\stepcounter{subsection}
%\newpage %-------------- TABLES ------------------
\addcontentsline{toc}{subsection}{
\protect\numberline{\thesubsection} Tabellenverzeichniss}
\listoftables
\stepcounter{subsection}
%\newpage %--------------- INDEX ------------------
\addcontentsline{toc}{subsection}{
\protect\numberline{\thesubsection} Index}
\printindex
%\newpage %-------------- GLOSSARY ----------------
\printglossaries[toclevel=subsection,numberedsection]
\end{document}