In the below image I copied the second and third page above one another. As you can see the alignment is incorrect. After the third page (including the third page) everything works fine. I am using \renewcommand\maketitle{ and \pagestyle{fancy} to make a custom front page and header and footer. But I have no idea what causes this behavior.    Update 1  \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[ngerman]{babel} \usepackage{comment} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{float} \usepackage{geometry} \usepackage{fancyhdr} \usepackage{longtable} \usepackage{listings} \usepackage{subfigure} \usepackage{acronym} \usepackage[usenames,svgnames,table]{xcolor} \usepackage[hidelinks]{hyperref}  %to be able to use your file as a template  \newcommand{\TitleOfReport}{Long Header bla bla bla some other words\\  bla bla bla some other words } \newcommand{\DateOfReport}{2014} \newcommand{\AuthorOfReport}{ONE}  %changing the layout \geometry{hmargin=2.5cm, vmargin=2.5cm }  \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} \fancyhead[C]{ \textcolor{Gray}{\small\TitleOfReport}} \fancyfoot[C]{ \textcolor{Gray}{\small\AuthorOfReport ~~ \vline ~~ Another phrase goes here ~~ \vline ~~ \DateOfReport}} \fancyfoot[RO]{\thepage} \fancyhead[L,R]{}  %make custom frontpage \makeatletter \renewcommand\maketitle{   \begin{titlepage}   \begin{center}    \end{center}\par   \end{titlepage}   \setcounter{footnote}{0} } \makeatother   \begin{document}  \title{\TitleOfReport} \date{\DateOfReport} \author{\AuthorOfReport}  \pagestyle{fancy} \pagenumbering{Alph} \maketitle     \pagenumbering{Roman} \newpage  \tableofcontents \newpage  \listoffigures \listoftables  \end{document}   Update 2  As lockstep pointed out simply put the \headheight somewhere in the preamble in this case the following will do the job:  \headheight27.0pt   or  \setlength{\headheight}{27.0pt}
23203
Looking at the example provided in , I noticed something strange: The vertical alignment of sections is varying. I was able to strip the effect down to the following (hopefully minimal) example:  \documentclass[12pt]{report}  \usepackage{fancyhdr} \pagestyle{fancy}  \begin{document}  \chapter{My First Chapter} \clearpage \section{Section 1} \clearpage \section{Section 2} \clearpage \section{Section 3}  \end{document}   If you look closely, the vertical alignment of "Section 1" differs from those of "Section 2" and "Section 3" (which are the same). The effect disappears if you either a) refrain from using the fancyhdr package and \pagestyle{fancy} or b) switch to the 10pt class option. What is causing this strange vertical alignment?
58697
The alignment of items in the block Questions that may already have your answer is weird. The first question score is shown before the question and subsequent question and scores doesn't match. Here is a screenshot:     Right now, I'm using Chrome Version 28.0.1500.95 m, but it looks the same on Internet Explorer. Reproduced on Firefox 22.0  Edit: Stack Overflow looks normal.
105933
In a book, I have several numbered sections followed by an unnumbered section. I have placed an \addcontentsline following the \section* that introduces the unnumbered section, so that it will appear (unnumbered) in the ToC; that works fine. However, the page headers for the unnumbered section are continued from the last numbered section.  I am using fancyhdr with the following setup:  \pagestyle{fancy} \fancyheadoffset{0in} \renewcommand{\chaptermark}[1]{\markboth{#1}{}} \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}  \fancyhf{} \fancyhead[LE,RO]{\thepage} \fancyhead[C]{\bfseries \draftinfo} \fancyhead[LO]{\sf\rightmark} \fancyhead[RE]{\sf\leftmark} \fancyfoot[C]{\bfseries \draftinfo} \fancypagestyle{plain}{%   \fancyhead{} % get rid of headers   \renewcommand{\headrulewidth}{0pt} % and the line }
11633
The standard titlepage is quite simple. I am looking for a very  and need help customizing my title page.  It should match the  classicthesis doctoral thesis template  Below a minimal working example:   \documentclass[12pt,a4paper,footinclude=true,twoside,headinclude=true]{scrbook} \XeTeXinputencoding iso-8859-1 \usepackage[marginparsep=8pt,left=3.5cm,right=3.5cm,top=3cm,bottom=3cm]{geometry}  \usepackage[parts,pdfspacing,dottedtoc]{classicthesis}    \frontmatter  \begin{document}     \pagestyle{scrheadings}        %this is the place to set up my cover sheet.       %*******************************************************      % Abstract     %*******************************************************    %\renewcommand{\abstractname}{Abstract}    \pdfbookmark[1]{Résumé}{Résumé}   \begingroup    \let\clearpage\relax    \let\cleardoublepage\relax    \let\cleardoublepage\relax       \chapter{Résumé}     Résumé de la thèse en français\dots      \vfill      \chapter*{Summary}   Résumé de la thèse en anglais\dots    \endgroup             \vfill     \end{document}
116083
I tried to use a header and footer layout I found here on this website. But I have some problems with changing the code to what I want. I want the pagenumbering to be like page x of y in the footer. It would be nice with this layout (just with page x of y instead of just page x):  \cfoot{\parbox{\textwidth}{\hrulefill\kern-0.6ex\raisebox{-0.5ex}{$\Bigl[$\makebox[2em][c]{\thepage}$\Bigr]$}\kern-0.5ex\hrulefill}}   But the pagenumbering is in the header and there aren't a space between the letters and the numbers as you can see in my minimal work example:  \documentclass[12pt,a4paper]{book}%generelt \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % clear all headers and footers \renewcommand{\headrulewidth}{0pt} % remove rule between header and text \fancyhead[LE, RO]{\thepage of \pageref{LastPage}} % put page number in left header on even pages,                             % right header on odd pages \fancyhead[RE]{\nouppercase{\leftmark}} % remove uppercase on chapter title \renewcommand{\chaptermark}[1]{\markboth{#1}{}} % remove "Chapter N." prefi \usepackage{lastpage}   Another problem is that I would like to have a chapter numbering in the header. The design is really nice, but I would like to have the chapter number too, just like "CHAnumber| name of the chapter".  Is it possible to make this two changes? And how? Thank you very much for help!
29940
How can I add horizontal line after header and before footer?   header ---------  --------- footer
102224
I have found that for only one page (so far) the spacing between the header and content is different from the spacing on all the other pages. You can see this behavior in the images below (from pages 2 and 3 of the document):     My .tex file contents are shown below.  \documentclass[a4paper]{report} \usepackage{fullpage} \usepackage{lipsum} \usepackage{fancyhdr} \pagestyle{fancy} \setlength{\headsep}{0.5cm}  \begin{document} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\chaptermark}[1]{\markboth{\thechapter. #1}{}} \fancyhead[L]{\bfseries \leftmark} \fancyhead[R]{\bfseries \rightmark}  \chapter{Version Control} \lipsum \lipsum \lipsum \lipsum  \end{document}
30440
I am using the default theme, and use the following to customize the footline,  \useoutertheme{infolines} \setbeamertemplate{footline}{\hspace*{.5cm}\scriptsize{\insertshorttitle \hspace*{50pt} \hfill\insertframenumber\hspace*{.5cm}}\\ \vspace{9pt}}    I don't like it also appears on the title page. Is there a simple way not to show it on the first page?
16939
I'd like to modify the contents of my headers and footers - e.g., to display the current chapter and/or section title or to change the pagination alignment. How can I do that? I've noticed the packages  and scrpage2 (part of the -bundle) - are they interchangeable, or are there situations where I should prefer one package to the other?
77060
I want more than one title for each topic in one document, I don't want to just combine two or three pdfs. And I want to show different headers starting from each title page. There's one problem I cannot solve.  I just used  \documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} \usepackage{fancyhdr} \usepackage{titling} \pagestyle{fancy} \setlength{\parindent}{0pt} \setlength{\parskip}{8pt} \setlength{\topmargin}{-0.5cm} \setlength{\droptitle}{-1.5in} \fancyhead{} \lhead{Personal Statement} \rhead{name} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0pt} \title{Personal Statement} \author{name} \date{Oct 25 2013} \begin{document} \maketitle  a lot of contents here \title{Previous Projects and Future Plans} \author{} \date{} \fancyhead{} \lhead{Previous Projects and Future Plans} \rhead{name} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0pt} \maketitle a lot of contents here \end{document}   The titles can be displayed correctly, but headers cannot. The last page under the first title displayed the second header, I don't know why because my \lhead{} and \rhead{} are after the second \title. Hope someone can help.  I'm also wondering if it's formal to use \tile and \maketitle several times in one document? If not, is there any better way to do so? And could anybody tell me the scope of the typesetting macros at the beginning (\setlength, \lhead and so on)? I'm not sure how to limit their scope if they're meant to be applied to the whole contents of the document. Thanks a lot.
7598
I'm posting today because I would like to reduce white space in a document I'm writing. The content is two-columns but I have floating tables that span across both columns (table*).   At some point, the text ends in the beginning of the first column of a new page. I would like to include my table on this page since it has a lot of free space below the text, but when I insert the table* right after the text, it goes to the top of the next page instead:    Do you know a way of obtaining the desired behavior?  Minimal working example :  \documentclass{article} \usepackage{lipsum}  \begin{document} \twocolumn  \paragraph{} \lipsum[1]  \begin{table*} \centering \begin{tabular}{|c|c|c|c|} \hline Column 1 &amp; Column 2 &amp; Column 3 &amp; Column 4 \\ \hline Column 1 &amp; Column 2 &amp; Column 3 &amp; Column 4 \\ \hline \end{tabular} \end{table*}%   \end{document}
106799
I am inserting an A3 page in an A4 document but the margins are not respected (and neither does a page number appear), after the A3 page.  Test code below:  \documentclass[11pt,twoside,a4paper,pagesize]{report} \usepackage{nextpage} \usepackage{afterpage} \usepackage[margin=2cm]{geometry} \usepackage{comment} \usepackage{typearea} \usepackage{lipsum} \usepackage[absolute]{textpos}  \begin{document}  \lipsum  \afterpage{ % Insert after the current page \clearpage  \KOMAoptions{paper=a3}  \recalctypearea  A3 stuff  \clearpage \KOMAoptions{paper=A4,pagesize} \recalctypearea }  \clearpage      \lipsum  \end{document}
51888
I've been learning LaTeX and this community has been very helpful. Currently, I'm trying to set up corporate letters but as a newbie I'm encountering a  of , so I'm posting them one by one instead of putting it in the comments... maybe this helps others as well.  Anyway, I am trying to implement this  that indicates that I can use vbox to float an image to the right of my header. I almost have this working, but I now try to adjust this to get my logo to stick to the top of the page. So I want to have this at the right top of my document. This is quite difficult! When I place the vbox, it creates unwanted spacing, for some odd reason. So I can not get the logo to be at the right top, even though I 'reset' every possible margin to 0 (in my opinion). Here is my distilled code:  \documentclass[a4paper]{article} \usepackage{graphicx} \graphicspath{{./img/}} \usepackage{color} \usepackage{xcolor} \definecolor{orange}{HTML}{DD4616} \definecolor{white}{HTML}{FFFFFF} \usepackage{fullpage} \usepackage[margin=0cm, paperwidth=215.9mm, paperheight=30mm,top=0cm]{geometry} \parindent=0pt  \begin{document} \fboxsep0pt  \pagecolor{orange}   \fbox{\vbox to 0pt{\hfill\fbox{\includegraphics[height=3cm]{logo}}}}  \end{document}   I've used a full black logo for illustrative purposes. Here you can see this:    The black line is the vbox border. For some reason, it jumps down. The only way to get rid of this that I found out about is this:    Which means that I need to add:  \edef\theprevdepth{\the\prevdepth}\nointerlineskip \vbox to 0pt{...}\prevdepth=\theprevdepth   But there are two problems with this:   I get an error with I try this (Improper \prevdepth.) More importantly, I really want to understand my code at this point, and get to master the basics of positioning elements. This feels overcomplicated and I do not understand it at all.    Is there any easy way to position an image at the right top of a document?
75417
It seems that the align environment adds additional vertical space if it starts at the top of a page or minipage.  Below are two pages, and two minipages (on Page 1), where the first page/minipage has text followed by an align* environment, and the second page/minipage starts with an align* environment, and note that the equations are still aligned.  Attempted Solution: The closest related question I found was:    I attempted to use the  at the above by adding \setlength\abovedisplayskip{0pt} (after the preamble as per ).  Although, this did move the equations up vertically, they were still vertically aligned:  And since the problem occurs at top of a page as well, I don't think this is related to  Question:  How can I adjust the align environment to automagically not have additional space at the top of a page or minipage? Is there a reason for this behavior, and perhaps should not be changed?  Code: \documentclass{article} \usepackage[showframe,paperwidth=3.5in,paperheight=2.2in,margin=0.5in]{geometry} \usepackage{amsmath}  \begin{document}%\setlength\abovedisplayskip{0pt} Top of Page 1 \begin{align*}% Text above at top of page  e &amp;= m c^2 \end{align*}  \hrule \begin{minipage}[t]{0.45\linewidth}     Top of minipage 1     \begin{align*}% Text above this minipage      e &amp;= m c^2     \end{align*} \end{minipage} \begin{minipage}[t]{0.45\linewidth}     \begin{align*}% No text above in this minipage      e &amp;= m c^2     \end{align*} \end{minipage}  \newpage \begin{align*}% No text above at top of page  e &amp;= m c^2 \end{align*} \end{document}
33387
I have a problem with the fancy package: I use the report documentclass and I have a chapter, a lot of text and then a new page starting with a section (or the next page has no chapter starting on that particular page).  The problem be, that what I defined for my header and footer is NOT on the chapter-page but only on the non-chapter page. How come? What did I miss?  Minimal example:  \documentclass[]{report}  \usepackage{lastpage} \usepackage{fancyhdr} % for use of \pageref{LastPage}  \fancypagestyle{IHA-fancy-style}{% \fancyhf{} %Clear header and footer \fancyhead[LE,RO]{\slshape \rightmark} \fancyhead[LO,RE]{\slshape \leftmark} \fancyfoot[C]{\thepage of \pageref{LastPage}} %Custom footer \renewcommand{\headrulewidth}{0.4pt} %Line at the header visible \renewcommand{\footrulewidth}{0.4pt}} %Line at the footer visible  \title{A short example}  \begin{document}  \maketitle \tableofcontents  \pagestyle{IHA-fancy-style} \chapter{A chapter} Look at the footer  \newpage \section{A section} Look at the footer  \end{document}   Take notice: No line on page 2 at the bottom - a line on page 3 at the bottom.  Any clues?
36502
Here's a screenshot of the error shown for the list layout alignment issue. I don't know what it is called, so I did my best.  I'm using Google Chrome version 38.0.2125.104 m, telling me that I'm up-to-date.   If it's a browser issue, then I can't update it, as I don't have admin rights and had to go report this issue to the admin.
54749
I want a table whose first column is aligned top, second column is aligned middle, and third column is aligned bottom; like this:    I wrote the following code:  \documentclass{article} \usepackage[english]{babel} \usepackage{array}  \begin{document}  \begin{tabular}{| p{1cm} | m{1cm} | b{1cm} |}     \hline     x &amp;     A long text comes here &amp;     x \\ \hline \end{tabular}  \end{document}   Yet, to my surprise, the outcome was "all columns aligned middle," as follows:    What did I do wrong?