2

I stumbled across the type specimen of the beautifull Tierra Nueva and I'm wondering how is it possible to achieve a sectioning in LaTeX similar as shown in the picture (centered and wider than the actual text area). Any suggestions (even for Komascript)?

enter image description here

MWE:

\documentclass[12pt.a4paper]{scrartcl}
\usepackage[margin=4cm]{geometry}
\usepackage{blindtext}
\usepackage{adjustbox}

\title{\null\hss Sehr langer Text der hier stehen soll, ohne wirklich eine Bedeutung zu haben  \hss\null}

\begin{document}
\maketitle

\blindtext[2]

\end{document}
  • If what you are really referring to is the title, and it's only one line, you could hack it with {\null\hss ... \hss\null} – barbara beeton Jul 13 at 20:00
  • @barbarabeeton \hss didn't work. Don't know why. Could you please give an example, how to use it? – schmendrich Jul 13 at 20:49
  • 1
    The code I gave won't work all by itself; it needs to be taken as an argument: \title{...}. Giving a full example would require knowing what document class you're using. Inclusion of a small compilable example in a question makes it very much easier for potential helpers to actually help. – barbara beeton Jul 13 at 20:53
  • @barbarabeeton: I added a MWE to my question. – schmendrich Jul 13 at 21:07
  • 1
    Sadly, I'm not a user of the KOMA classes. If this doesn't work, then someone more relevant knowledge will have to help. (The technique I suggested ordinarily makes the text look like it has zero width, and centers it. It will not work directly if the string requires more than one line to fit on the page. It can be "adjusted" by specifying explicit line breaks with ... \hss\null\\ \null\hss ... – barbara beeton Jul 13 at 21:22
3

You can patch \@maketitle:

\documentclass[12pt,a4paper]{scrartcl}
\usepackage[margin=4cm]{geometry}
\usepackage{blindtext}
\usepackage{changepage,xpatch}

\makeatletter
\xpatchcmd{\@maketitle}
 {{\usekomafont{title}{\huge\@title\par}}}
 {\begin{adjustwidth}{-6em}{-6em}\usekomafont{title}{\huge\centering\@title\par}\end{adjustwidth}}
 {}{}
\makeatother

\title{Sehr langer Text der hier stehen soll, ohne wirklich eine Bedeutung zu haben}

\begin{document}

\tracingmacros=1
\maketitle
\tracingmacros=0

\blindtext[2]

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