0

I am currently writing a paper and so far so good.

I somehow managed to mess up the layout, the text on the second page is shifted downwards and continues beyond the end of the page, see the attached example. Here is a functional example of my LaTeX code.

p.s. I am using the Royal Society of Chemistry template since I am planning to submit my paper to one of their journals.

   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %This is the LaTeX ARTICLE template for RSC journals
   %Copyright The Royal Society of Chemistry 2016
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   \documentclass[twoside,twocolumn,9pt]{article}
   \usepackage{extsizes}
   \usepackage[super,sort&compress,comma]{natbib} 
   \usepackage[version=3]{mhchem}
   \usepackage[left=1.5cm, right=1.5cm, top=1.785cm, bottom=2.0cm]{geometry}
   \usepackage{balance}
   \usepackage{times,mathptmx}
   \usepackage{sectsty}
   \usepackage{graphicx} 
   \usepackage[lofdepth,lotdepth]{subfig}
   \usepackage{wasysym} % to use \textperthousand                                                     
   \usepackage[separate-uncertainty=false,per-mode = symbol]{siunitx}  
   \usepackage{lastpage}
   \usepackage[format=plain,justification=justified,singlelinecheck=false,font={stretch=1.125,small,sf},labelfont=bf,labelsep=space]{caption}
   %strech caption line spacing for Sprachendienst
   %\captionsetup[table]{font={stretch=2.5}}     %% change 1.2 as you like
   %\captionsetup[figure]{font={stretch=2.5}}
   \usepackage{float}
   \usepackage{cuted}
   \usepackage{mathtools}
   \usepackage{fancyhdr}
   \usepackage{nicefrac}
   \usepackage[style=british]{csquotes}
   \usepackage{fnpos}
   \usepackage{placeins}
   \usepackage{booktabs}
   \usepackage{tabularx}
   \usepackage{multirow}
   \usepackage{amsmath}
   \usepackage{rotating}
   \usepackage{pdflscape}
   \usepackage[english]{babel}
   \addto{\captionsenglish}{%
    \renewcommand{\refname}{Notes and references}
   }
   \usepackage{array}
   \usepackage{droidsans}
   \usepackage{charter}
   \usepackage[T1]{fontenc}
   \usepackage[usenames,dvipsnames]{xcolor}
   \usepackage{lipsum}
   \usepackage[compact]{titlesec}
   \usepackage{hyperref}
   \raggedbottom
   \definecolor{cream}{RGB}{222,217,201}
   %%%Please don't disable any packages in the preamble, as this may cause the template to display incorrectly.%%%
   \usepackage{epstopdf}%This line makes .eps figures into .pdf - please comment out if not required.

   \usepackage{setspace}



   \begin{document}


    \pagestyle{fancy}
    \thispagestyle{plain}
    \fancypagestyle{plain}{

        %%%HEADER%%%
        \fancyhead[C]{\includegraphics[width=18.5cm]{head_foot/header_bar}}
        \fancyhead[L]{\hspace{0cm}\vspace{1.5cm}\includegraphics[height=30pt]{head_foot/journal_name}}
        \fancyhead[R]{\hspace{0cm}\vspace{1.7cm}\includegraphics[height=55pt]{head_foot/RSC_LOGO_CMYK}}
        \renewcommand{\headrulewidth}{0pt}
    }
    %%%END OF HEADER%%%

    %%%PAGE SETUP - Please do not change any commands within this section%%%
    \makeFNbottom
    \makeatletter
    \renewcommand\LARGE{\@setfontsize\LARGE{15pt}{17}}
    \renewcommand\Large{\@setfontsize\Large{12pt}{14}}
    \renewcommand\large{\@setfontsize\large{10pt}{12}}
    \renewcommand\footnotesize{\@setfontsize\footnotesize{7pt}{10}}
    \makeatother

    \renewcommand{\thefootnote}{\fnsymbol{footnote}}
    \renewcommand\footnoterule{\vspace*{1pt}% 
        \color{cream}\hrule width 3.5in height 0.4pt \color{black}\vspace*{5pt}} 
    \setcounter{secnumdepth}{5}

    \makeatletter 
    \renewcommand\@biblabel[1]{#1}            
    \renewcommand\@makefntext[1]% 
    {\noindent\makebox[0pt][r]{\@thefnmark\,}#1}
    \makeatother 
    \renewcommand{\figurename}{\small{Fig.}~}
    \sectionfont{\sffamily\Large}
    \subsectionfont{\normalsize}
    \subsubsectionfont{\bf}
    \setstretch{1.125} %In particular, please do not alter this line.
    \setlength{\skip\footins}{0.8cm}
    \setlength{\footnotesep}{0.25cm}
    \setlength{\jot}{10pt}
    \titlespacing*{\section}{0pt}{4pt}{4pt}
    \titlespacing*{\subsection}{0pt}{15pt}{1pt}
    %%%END OF PAGE SETUP%%%

    %%%FOOTER%%%
    \fancyfoot{}
    \fancyfoot[LO,RE]{\vspace{-7.1pt}\includegraphics[height=9pt]{head_foot/LF}}
    \fancyfoot[CO]{\vspace{-7.1pt}\hspace{13.2cm}\includegraphics{head_foot/RF}}
    \fancyfoot[CE]{\vspace{-7.2pt}\hspace{-14.2cm}\includegraphics{head_foot/RF}}
    \fancyfoot[RO]{\footnotesize{\sffamily{1--\pageref{LastPage} ~\textbar  \hspace{2pt}\thepage}}}
    \fancyfoot[LE]{\footnotesize{\sffamily{\thepage~\textbar\hspace{3.45cm} 1--\pageref{LastPage}}}}
    \fancyhead{}
    \renewcommand{\headrulewidth}{0pt} 
    \renewcommand{\footrulewidth}{0pt}
    \setlength{\arrayrulewidth}{1pt}
    \setlength{\columnsep}{6.5mm}
    \setlength\bibsep{1pt}
    %%%END OF FOOTER%%%

    %%%FIGURE SETUP - please do not change any commands within this section%%%
    \makeatletter 
    \newlength{\figrulesep} 
    \setlength{\figrulesep}{0.5\textfloatsep} 

    \newcommand{\topfigrule}{\vspace*{-1pt}% 
        \noindent{\color{cream}\rule[-\figrulesep]{\columnwidth}{1.5pt}} }

    \newcommand{\botfigrule}{\vspace*{-2pt}% 
        \noindent{\color{cream}\rule[\figrulesep]{\columnwidth}{1.5pt}} }

    \newcommand{\dblfigrule}{\vspace*{-1pt}% 
        \noindent{\color{cream}\rule[-\figrulesep]{\textwidth}{1.5pt}} }

    \makeatother
    %%%END OF FIGURE SETUP%%%
    %%%TITLE, AUTHORS AND ABSTRACT%%%
    \twocolumn[
    \begin{@twocolumnfalse}
        \vspace{3cm}
        \sffamily
        \begin{tabular}{m{4.5cm} p{13.5cm} }
            \includegraphics{head_foot/DOI} & \noindent\LARGE{\textbf{Why is the layout messed up?$^\dag$}} \\%Article title goes here instead of the text "This is the title"
            \vspace{0.3cm} & \vspace{0.3cm} \\

            & \noindent\large{First Author,\textit{$^{a}$} Second Author$^{\ast}$\textit{$^{a}$}  } \\%Author names go here instead of "Full name", etc.
            \setstretch{2.5}
            \includegraphics{head_foot/dates} & \noindent\normalsize{  \lipsum[1][15] } \\%The abstrast goes here instead of the text "The abstract should be..."

        \end{tabular}

    \end{@twocolumnfalse} \vspace{0.6cm}

    ]
    %%%END OF TITLE, AUTHORS AND ABSTRACT%%%

    %%%FONT SETUP - please do not change any commands within this section
    \renewcommand*\rmdefault{bch}\normalfont\upshape
    \rmfamily
    \section*{}
    \vspace{-1cm}


    %%%FOOTNOTES%%%

    \footnotetext{\textit{$^{a}$~Address, Affiliation, Affiliation Street 100, 122345 Affiliation twon, Affiliation land. Fax: XX XXXX XXXX; Tel: XX XXXX XXXX; E-mail: [email protected]}}
    \footnotetext{\textit{$^{b}$~Address, Address, Town, Country. }}


    \footnotetext{\dag~Electronic Supplementary Information (ESI) available: [details of any supplementary information available should be included here]. See DOI: 00.0000/00000000.}



    %%%END OF FOOTNOTES%%%
    \textsl{}
    %%%MAIN TEXT%%%%



\section{Introduction}
\lipsum[1-20]





%%%REFERENCES%%%
%\FloatBarrier
%\balance
%\bibliography{rsc} %You need to replace "rsc" on this line with the name of your .bib file
%\bibliographystyle{rsc} %the RSC's .bst file

\end{document}
1
  • Welcome to TeX.SX! Your code is not a MWE since it is impossible to compile it without going to retrieve the original template. However, when I compile your code with all the other documents from the RCS, there is no problem at all with the resulting document.
    – KersouMan
    Commented Apr 27, 2020 at 8:38

1 Answer 1

0

You get a warning

Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 63.96962pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.

Add headheight=64pt to the options to geometry

\usepackage[left=1.5cm, right=1.5cm, top=1.785cm, bottom=2.0cm,headheight=64pt]{geometry}

and all should become OK.

Note. The amount space to reserve for the header might be different depending on the graphic elements, which aren't available for testing. Looking in the log file will show the exact amount to use.

1
  • That was the thing, messing up my layout, thanks!
    – Zorg
    Commented Apr 28, 2020 at 12:15

You must log in to answer this question.

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