2

I am trying to format my list of tables and list of abbreviations in the same way, such that the indentation of the acronyms is the same as the indentation of table references. However, I had no luck even when using a different glossary style, like long.

\documentclass{article}

\usepackage{longtable,array}

\usepackage[acronym,nonumberlist,nomain,nopostdot]{glossaries}
\include{glossary}
%\setglossarystyle{long}
\makeglossaries
\newacronym{SNA}{SNA}{some nice acronym}

\begin{document}
\printglossary[title={List of Abbreviations},type=\acronymtype]
\listoftables 

\begin{longtable}{|l|}
    \hline
    ... \\ \hline
    \caption{Some nice table}
    \label{tbl:table1}
\end{longtable}
\end{document}

An example.

Any ideas?

Thank you very much in advance!

  • 1
    Welcome to TeX.SX. See the package tocloft please and the \cfttabindent length (which is most likely to be set to 0em). Please don't use \include in the preamble! Use \input or \loadglsentries. Your example does not use any of your defined glossary or acronym entries! – user31729 Jan 23 '17 at 16:08
  • Thank you very much for your quick response and the additional hints which I'll keep in mind. – Max Jan 23 '17 at 16:25
  • You're welcome. Happy TeXing! – user31729 Jan 23 '17 at 16:43
2

Use tocloft and \setlength{cfttabindent}{0em} which will reduce the indentation of table entries to 0em, so there is no indentation at all.

\documentclass{article}

\usepackage{longtable,array}
\usepackage{tocloft}
\usepackage[acronym,nonumberlist,nomain,nopostdot]{glossaries}

\setlength{\cfttabindent}{0em}

%\include{glossary}
%\setglossarystyle{long}
\makeglossaries
\newacronym{SNA}{SNA}{some nice acronym}

\begin{document}
\gls{SNA}
\printglossary[title={List of Abbreviations},type=\acronymtype]
\listoftables 

\begin{longtable}{|l|}
    \hline
    ... \\ \hline
    \caption{Some nice table}
    \label{tbl:table1}
\end{longtable}
\end{document}

enter image description here

  • if the table number goes to two digits, the numbers will still be left aligned. the original design allowed the numbers to be mutually right-aligned. just something to be aware of. – barbara beeton Jan 23 '17 at 17:55
2

You could also use package tocbasic (part of KOMA-Script bundle):

\documentclass{article}

\usepackage{longtable,array}

\usepackage[acronym,nonumberlist,nomain,nopostdot]{glossaries}
%\include{glossary}
%\setglossarystyle{long}
\makeglossaries
\newacronym{SNA}{SNA}{some nice acronym}

\usepackage{tocbasic}[2016/06/14]
\DeclareTOCStyleEntry[indent=0pt]{tocline}{table}

\begin{document}
\printglossary[title={List of Abbreviations},type=\acronymtype]
\listoftables 

\begin{longtable}{|l|}
    \hline
    ... \\ \hline
    \caption{Some nice table}
    \label{tbl:table1}
\end{longtable}
\end{document}

enter image description here


Or if you are using a KOMA-Script class like in your other question:

\documentclass[oneside,
    listof=totoc% <- all list titles goes to TOC
]{scrbook}[2016/06/14]
\DeclareTOCStyleEntry[indent=0pt]{tocline}{table}

\usepackage[acronym,nonumberlist,nomain,nopostdot,
    toc% <- added
]{glossaries}
\makeglossaries
\newacronym{SNA}{SNA}{some nice acronym}

\usepackage{hyperref}
\begin{document}
    \tableofcontents
    \listoftables
    \printglossary[title={List of Abbreviations},type=\acronymtype]
    \chapter{Chapter One}
    \gls{SNA}
    \captionof{table}{A table caption}
\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.