8

I'd like to set the titlepage of a koma-script scrbook left-aligned, i.e. \raggedright. I do this using \addtokomafont as follows:

\documentclass[]{scrbook}

\addtokomafont{title}{\raggedright}
\addtokomafont{author}{\raggedright}
\addtokomafont{date}{\raggedright}

\title{My title}
\author{My name} 

\begin{document} 
\maketitle
\end{document}

However, what I get is an author name that seems to horizontally offset by about 0.2cm:

Misaligned author name

Any suggestions why this is and how I can avoid it? Of course, I could add a \hspace{-0.2cm} to \author{} but that feels like an ugly workaround.

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – user11232 Jan 28 '15 at 15:34
8

This is how the author is typeset:

{\Large \lineskip 0.75em
    \begin{tabular}[t]{c}
        \@author
    \end{tabular}\par}

i.e., using a tabular and a tabular inserts \tabcolsep. You are seeing the tabcolsep on the left side. Making it zero like

\addtokomafont{author}{\raggedright\setlength{\tabcolsep}{0pt}}

solves the problem.

\documentclass[]{scrbook}
\usepackage{showframe}  %% just for demo

\addtokomafont{title}{\raggedright}
\addtokomafont{author}{\raggedright\setlength{\tabcolsep}{0pt}}
\addtokomafont{date}{\raggedright}

\title{My title}
\author{My name}

\begin{document}
\maketitle
\end{document}

enter image description here

  • Your solution is much nicer than mine! :D – Juri Robl Jan 28 '15 at 15:24
  • Many thanks! This way I also don't get the ugly "\hspace{-0.2cm}" in the pdf author tag generated by hyperref... – Leo Jan 28 '15 at 15:30
  • @Leo Glad it helped :-) BTW, welcome to the site. Have a nice time here :-) – user11232 Jan 28 '15 at 15:32
  • @JuriRobl Being very simple though! :P – user11232 Jan 28 '15 at 15:43

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.