1

How can I make ToC, LoF,gls, idx & bib lists as a subsection?

I use lualatex and tocbibind package. But the bibliography does not show up in ToC as well as I would need to get the entries of all Lists in subsections beneath the section:'References'. Is that possible?

edit: printscreens now showing all subsections numbered as wanted. enter image description here enter image description here enter image description here

edit: [WIP](x = done)

  • [x] Num LOT

  • [x] Num LOF

  • [x] Num BIB

  • [x] Num GLS

  • [x] List BIB as subsection

  • [x] List GLS as subsection

  • [ ] List LOT as subsection

  • [ ] List LOF as subsection

  • [ ] List IDX as subsection

  • [ ] Num IDX

mwe edited:

\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 can not take grip of all toc - like additions. It is meant by design initially for toc, bib and ind, (and lof/lot), but not for gls etc. With biblatex there is a special setup, as well for glossaries – user31729 Dec 30 '18 at 10:39
  • and why does it not show bib in my case here? – novski Dec 30 '18 at 10:40
  • As I wrote, biblatex needs a special setup... – user31729 Dec 30 '18 at 10:42
  • 1
    subbibintoc for biblatex. – Johannes_B Dec 30 '18 at 10:56
  • 1
    @ChristianHupfer Yes, but I was assuming that was what was required. It's a bit odd to have the heading appear as a section in the text but as a subsection in the toc, but perhaps I misread the question. – Nicola Talbot Dec 30 '18 at 11:00
1

Suggestion without package tocbibind: use \indexsetup{level=\subsection provided by package imakeidx and use package tocbasic to number LoF and LoT as subsections.

\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}

Result:

enter image description here

0

I added a manual line to toc.

its not properly aligned but it fakes the missing subsectioning of those packages (not nice) but effectively.

Its sad that those packages do not work better together.

\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}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.