0

Edit: I used the answers I got so far and created some code. Now I have another Question. How can I change the distance margin on the top of the document to get some more space to write? (for detailed question and code see below)


I want to make myself a new template for short texts up to five pages. therefore I would like to avoid using a titlepage and just use the header I know by WORD as given in my example image.

So far I came across the scrlayer-scrpage package but I couldn't find a solution for my template yet. The problem is, that I want to use the header only on the first page, the rest of the headers should be empty.

how it should look like at the end:



This is the code im currently using:


\documentclass[12pt,a4paper]{article}

\usepackage[a4paper, left=3cm, right=3cm, top=3.4cm]{geometry} 
\usepackage[onehalfspacing]{setspace}  
\usepackage{lmodern}
\usepackage{ngerman}
\usepackage{graphicx}   
\usepackage{kantlipsum} 

\usepackage{fancyhdr}   %Kopfzeilen und co.
\setlength{\headheight}{55pt} % space for two lines in header

                            
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                          
                            
\fancypagestyle{firstpage}{     % define a custom header (Kopfzeile)
  \fancyhf{}
  \fancyhead[R]{\raggedleft \includegraphics[height=50pt]{Abbildungen/ottomodernhw}}
  \fancyhead[L]{\small{ some Text\\some Text \\some Text \\ some Text} }
  \fancyfoot[C]{\thepage}
}
\renewcommand{\headrulewidth}{0pt}  

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\thispagestyle{firstpage} 

\kant[1-4] 

\end{document}

Resulting in this header:

enter image description here


This is some code I used before:


\fancypagestyle{firstpage}{     % define a custom header (Kopfzeile)
  \fancyhf{}
  \fancyhead[R]{\raggedleft \small{some Text \\some Text}}
  \fancyhead[L]{\small{ some Text \\some Text } }
  \fancyhead[C]{\centering \small{ some Text \\ } }
  \fancyfoot[C]{\thepage}
}
\renewcommand{\headrulewidth}{0pt}   

Resulting in this (I should change the \setlength{\headheight}{55pt}):

enter image description here


My new problem/question is now: how can I change the space above the text on the second (and also the third) page? I want it to be smaller. I googled for some time and found the geometry package wiht the newgeometry command, but unfortunately it always creates a new page.

Is there any possibility to change the geometrysettings for single pages? Maybe with pagenumbers as a reference? I want to use the template without searching for the exact spot to make a break in the text.

The last image shows what I want to change:

enter image description here

0

2 Answers 2

0

Try this code, using fancyhdr to create the headers right, center and left of the page.

\documentclass[12pt]{article}
\usepackage{babel}

\usepackage{kantlipsum} % dummy text

\usepackage{fancyhdr}
\setlength{\headheight}{2em} % space for two lines in header
    
\fancypagestyle{firstpage}{% define a custom header
  \fancyhf{}
  \fancyhead[R]{\raggedleft Topic Name \\ Another Text}
  \fancyhead[L]{ University Name \\Another Text}
  \fancyhead[C]{\centering  My Name \\Another Text}
  \fancyfoot[C]{\thepage}
}
\renewcommand{\headrulewidth}{0pt}  

\title{Titel and more}
\author{}
\date{}

\begin{document}
\maketitle
\thispagestyle{firstpage}

\kant[1-12]

\end{document}

ehere

The important part is \thispagestyle{firstpage} which is applied in this (the first) page only.

0

In my view what you are after is text at the start of the first page, not a heading above the first page (or any subsequent pages). Treat what you think of as your header material as the beginning of the first page.

% headerprob.tex  SE 575892

\documentclass{article}
\usepackage{tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}
\setlength{\tabcolsep}{0pt}
\usepackage{lipsum}
\begin{document}
\noindent%
\begin{tabularx}{\linewidth}{LCR}
University Name & My Name & Topic Name \\
Another text & Another text & Another text %\\
\end{tabularx}

\vspace{2\baselineskip}

\noindent
\textbf{Titel and more}

\end{document}

enter image description here

I had to guess at the code you might have used. The above sets up a tabularx environment to be used at the top of the first page to give you the means of providing the information you want as the "heading" which will not occur on subsequent pages. I have no idea as to how you are coding anything after your "heading". --- GOM

2
  • In the german WORD edition it's called "Kopfzeile" and "header" was the translation I got on the Internet. Not sure how it is called correctly. Thank you for your answer! The example you see I created in WORD.
    – cqui
    Dec 28, 2020 at 8:00
  • @cqui I suggest to you to open another question, since the follow up question addresses a different issue. Please add an updated MWE. Dec 29, 2020 at 19:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .