2

What I want to achieve is the same shown in this example made with LibreOffice:

enter image description here

As you can see my name is centered and in the middle of the page. The same for My profil

But using Latex I can center the second one relative to the page but the name in the header has a little offset to the left:

enter image description here

The MWE is this one:

\documentclass[11pt,a4paper,roman]{moderncv}        % possible options   include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')

% character encoding
\usepackage{ngerman}
\usepackage[utf8]{inputenc}

\usepackage{savesym}  % Wegen einer vorher in moderncv definierter Variable "fax". Link: https://tex.stackexchange.com/questions/146138/the-package-marvosym-seems-to-clash-with-the-moderncv-class-what-can-i-do
\usepackage{ifsym}
\savesymbol{fax}
\usepackage{marvosym}
\usepackage{fancyhdr}
\restoresymbol{MARV}{fax}

\setlength{\parskip}{\baselineskip}%

% Meine Infos
\name{Max}{Mustermann}

\pagestyle{fancy}
\fancyhf{}
\lhead{\footnotesize{ \hfil \textbf{Max Mustermann} \hfil \newline     \textifsymbol{18} 1234 Avenue, 56788 Big City - \Mobilefone : 0123 4567890 -    \Letter : writeme@dontknow.de}}

\begin{document}

\hfil \underline{\textbf{My Profil}} \hfil

\underline{Skills}
\begin{itemize}
\item Here some text
\item Here more text
\item Here a little bit more text
\end{itemize}

\end{document}

I'm using moderncv as a class and fancyhdr for the header informations.

Dave
  • 251

1 Answers1

0

The header can be centered with \chead (instead of \lhead). This does not work well with \newline but it does work with \\.

Adapt you MWE with the following line:

\chead{\footnotesize{\textbf{Max Mustermann}\\ 1234 Avenue, 56788 Big City - T: 0123 4567890 - E: writeme@dontknow.de}}

Result:

enter image description here

Marijn
  • 37,699