I have the following code to create my header
\documentclass[english]{scrreprt}
%%% PAGE DIMENSIONS
\usepackage{geometry}
\geometry{verbose,a4paper,tmargin=3.5cm,bmargin=2.5cm,lmargin=2.6cm,rmargin=2.6cm,headheight=1.3cm,headsep=1cm}
\pagestyle{headings}
%%% PACKAGES
\usepackage{booktabs}
\usepackage{array}
\usepackage{paralist}
\usepackage{verbatim}
\usepackage{subfig}
\usepackage{amsmath, amsthm, amssymb, url}
\usepackage{enumitem}
\usepackage{mathrsfs}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{tabu,longtable,booktabs,caption}
\usepackage[pdftex]{graphicx,color}
\usepackage{scrpage2}
%%% OPTIONS
\setcounter{secnumdepth}{3}
\setlength{\parindent}{1em}
\setlist{nolistsep}
\tabulinesep=^1.5mm_1.5mm
% Here the relevant code
\usepackage{scrpage2} \pagestyle{scrheadings}
\setkomafont{pagehead}{\sffamily\bfseries\small }
\clearscrheadfoot
\rohead{Line1 \\[2pt] Line2 \\[8pt] \normalfont\sffamily\footnotesize{Line3}\\[-37pt]}
\lohead{\rule{2cm}{2cm}\vspace{0.05cm}}
\setheadsepline{0.4pt}
\begin{document}
Some text just to make a page
\end{document}
But at compile time I was having a conflict. Here I found out that I need to substitute \\ with \linebreak because I am using longtabu
Now my question: with the old code Line3 was below the line created with \setheadsepline, now it is above. Is there a way of restoring its position while retaining the \linebreak fix?
Edit: As suggested in the comments I have tried
\makeatletter
%%% HEADERS
\pagestyle{scrheadings}
\setkomafont{pagehead}{\sffamily\bfseries\small }
\clearscrheadfoot
\rohead{Line 1 \@normalcr[2pt] Line 3 \@normalcr[8pt] \normalfont\sffamily\footnotesize{Line 3}\@normalcr[-37pt]}
\lohead{\includegraphics[scale=0.4, trim= -0.0cm 0.05cm 0cm 0cm]{logo.pdf}\vspace{0.05cm}}
\setheadsepline{0.4pt}
\makeatother
but the text is aligned in the middle of the page, not on the right side. How can I fix the horizontal alignment?
Note1: I already tested inserting \hfill on each line, but it has effect only on the first line, the second and the third are still in the center of the page.
Note2: Tested \raggedleft, same result as \hfill
Edit2: SOLVED
I have no idea if this is the cleanest solution, but it does what I was looking for
\makeatletter
\pagestyle{scrheadings}
\setkomafont{pagehead}{\sffamily\bfseries\small }
\clearscrheadfoot
\lohead{\includegraphics[scale=0.4, trim= -0.0cm 0.05cm 0cm 0cm]{logo.pdf}\vspace{0.05cm}}
\rohead{Line1 \linebreak \@normalcr[-9pt] Line2 \linebreak\@normalcr[-2pt] \normalfont\sffamily\footnotesize{Line3 \linebreak\@normalcr[-49pt]}}
\setheadsepline{0.4pt}
\makeatother
\linebreakdoesn't really work like\\you probably want\newlineor if you need the optional argument\@normalcr[-37ptin which case you want\makeatletteror put teh code in a local package/class file. – David Carlisle Mar 12 '13 at 16:31\newlinebut instead of obtaining lines right-justified the lines were centered (and it was still in the\roheadargument). Any idea? – Federico Mar 12 '13 at 16:38\\[-37ptto\\[-55pt]thenline3comes below the line.... – David Carlisle Mar 12 '13 at 17:06\linebreakor\newline? I will try to make that change as soon as possible, thanks. Also,\\must be removed: it conflicts withlongtabu(not included in the snippet because not relevant now) – Federico Mar 12 '13 at 17:11\\As I said in the initial comment you can use\@normalcrif you need to access the original definition of\\– David Carlisle Mar 12 '13 at 17:16\makeatletter\makeatotherif you use@see http://tex.stackexchange.com/questions/8351/what-do-makeatletter-and-makeatother-do – David Carlisle Mar 12 '13 at 17:35