[Tex/LaTex] List of abbreviations/units customisation

acronymsfancyhdrspacingtable of contents

I'm still working at my thesis template and ran into the next problem:

\documentclass[pdftex, 12pt, oneside]{book}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[scaled]{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{tocbibind}
\usepackage{titlesec}
\titleformat{\chapter}{\huge\bfseries}{\thechapter}{20pt}{\huge}
\usepackage[printonlyused]{acronym}
\usepackage[paper = a4paper, margin = 1in, includehead]{geometry}
\usepackage{fancyhdr}
\fancypagestyle{plain}
{
    \fancyhf{}
    \fancyhead[L]{\rightmark}
    \fancyfoot[R]{\thepage}
    \renewcommand{\headrulewidth}{0.5pt}
    \renewcommand{\footrulewidth}{0pt}
}
\begin{document}
    \frontmatter
        \tableofcontents
        \listoffigures
        \listoftables
        \pagestyle{plain}
            \chapter*{Abkürzungsverzeichnis}
            \addcontentsline{toc}{chapter}{Abkürzungsverzeichnis}
            \begin{acronym}[SQL]
                \acro{SQL}{Structured Query Language}
                \acro{Bash}{Bourne-again shell}
            \end{acronym}
    \mainmatter
        \chapter{Einleitung}
            Texttexttexttext \ac{SQL}

            Blablablablablabla \ac{Bash} and \ac{SQL}
\end{document}

As you can see first of the TOC, LOF, LOT and then I wanted to insert my list of abbreviations(/units maybe later on to) which worked really fine, but I wanted my explanations for the abbreviations aligned at the same line. Is there a way to \hfill it or put the same space between abbreviation and explanation.

And second question (I know only one is allowed, but it is the same MWE) is, if you take a look in the header, the \rightmark for my list of abbreviations still is the same as from the LOT. I'm sure I'm missing something again. 🙁

Best Answer

The optional argument to acronym, if used, should be the widest acronym, so the descriptions will be aligned. No automatism is available.

So, if you type

\begin{acronym}[Bash]
\acro{SQL}{Structured Query Language}
\acro{Bash}{Bourne-again shell}
\end{acronym}

the result will be

enter image description here

Complete example, with corrections for getting a right head height and a right heading:

\documentclass[12pt, oneside]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage[scaled]{helvet}
\renewcommand{\familydefault}{\sfdefault}

\usepackage[
  paper=a4paper,
  margin=1in,
  includehead,
  headheight=14.5pt, % <-- IMPORTANT
]{geometry}
\usepackage{fancyhdr}

\usepackage{tocbibind}
\usepackage{titlesec}
\usepackage[printonlyused]{acronym}

\titleformat{\chapter}{\huge\bfseries}{\thechapter}{20pt}{\huge}
\fancypagestyle{plain}
 {
  \fancyhf{}
  \fancyhead[L]{\rightmark}
  \fancyfoot[R]{\thepage}
  \renewcommand{\headrulewidth}{0.5pt}
  \renewcommand{\footrulewidth}{0pt}
 }
\pagestyle{plain}

\begin{document}

\frontmatter

\tableofcontents
\listoffigures
\listoftables


\chapter*{Abkürzungsverzeichnis}
\markboth{\MakeUppercase{Abkürzungsverzeichnis}}
         {\MakeUppercase{Abkürzungsverzeichnis}}
\addcontentsline{toc}{chapter}{Abkürzungsverzeichnis}

\begin{acronym}[Bash]
\acro{SQL}{Structured Query Language}
\acro{Bash}{Bourne-again shell}
\end{acronym}

\mainmatter

\chapter{Einleitung}

Texttexttexttext \ac{SQL}

Blablablablablabla \ac{Bash} and \ac{SQL}

\end{document}

Sorry for the different indentation, but I can't stand it.