0

I developed the following code for my document:

\documentclass[10pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[headsepline,footsepline]{scrlayer-scrpage}
\usepackage{graphicx,xcolor}
\usepackage[margin=38mm,includeheadfoot,head=32pt]{geometry}
\usepackage{setspace, fontspec, hyperref, lastpage}
\usepackage[acronym]{glossaries}

\pagenumbering{arabic}
\onehalfspacing
\frenchspacing
\renewcommand{\headfont}{\normalfont}

\DeclareNewLayer[
    background,
    topmargin,
    mode=picture,
  contents={\includegraphics[height=\layerheight,width=\layerwidth]{Picture}}
]{top}

\DeclareNewLayer[
  background,
  bottommargin,
  mode=picture,
  contents={\includegraphics[height=\layerheight,width=\layerwidth]{Picture}}
]{bottom}

\DeclarePageStyleByLayers{Titlepage}{top,bottom}

\newpairofpagestyles[scrheadings]{Tableofcontents}
{
    \clearpairofpagestyles
    \ihead{Lorem ipsum}
    \chead{Lorem ipsum}
    \ohead{Lorem ipsum}
}

\newpairofpagestyles[scrheadings]{Content}
{
    \clearpairofpagestyles
    \ihead{Lorem ipsum}
    \chead{Lorem ipsum}
    \ohead{Lorem ipsum}
    \cfoot{\pagemark}
}
\renewcommand*{\pagemark}{{\usekomafont{pagenumber}Page~\thepage}}

\newcommand*{\Content}{
  \cleardoublepage
  \pagenumbering{arabic}
  \pagestyle{Content}
}

\makeglossaries

\begin{document}
    \pagenumbering{roman}
    \KOMAoption{headsepline}{false}
    \KOMAoption{footsepline}{false}
    Titlepage
    \newpage
    \newgeometry{left=2.5cm,right=2cm,top=2cm,bottom=2cm}
    \setlength{\headsep}{10pt}
    
    \KOMAoption{headsepline}{true}
    \KOMAoption{footsepline}{true}
    \Content
    Lorem ipsum

    \printglossary[type=\acronymtype]
    \printglossary
\end{document} 

Now I printed the document and the document margins don't have the size, that I have defined in '\newgeometry'. Instead of: left=2.5cm, right=2cm, top=2cm, bottom=2cm the real margins on the paper are: left=2.8cm, right=2.3cm, top=1.4cm, bottom=2.6cm. So somehow the margins are definitely not correct. I'm happy about every suggestion to solve this problem.

EDIT: Please compile with the XeLaTeX-Compiler.

  • 1
    please supply a test file that people can run to debug your problem. No one can run the code as posted. – David Carlisle Oct 14 at 18:09
  • 1
    @DavidCarlisle thank you for the reply. I changed my code, so that everybody can run it. – SAM_N Oct 15 at 6:23
0

I guess the issue was with \setlength{\headsep}{10pt}. Check out the margins now.

enter image description here

\documentclass[10pt,a4paper]{article}
\usepackage[german]{babel}
\usepackage[headsepline,footsepline]{scrlayer-scrpage}
\usepackage{graphicx,xcolor}
\usepackage[margin=38mm,includeheadfoot,
head=32pt,showframe]{geometry}
\usepackage{setspace, fontspec, hyperref, lastpage}
\usepackage[acronym]{glossaries}

\pagenumbering{arabic}
\onehalfspacing
\frenchspacing
\renewcommand{\headfont}{\normalfont}

\DeclareNewLayer[
    background,
    topmargin,
    mode=picture,
  contents={\includegraphics[height=\layerheight,width=\layerwidth]{Picture}}
]{top}

\DeclareNewLayer[
  background,
  bottommargin,
  mode=picture,
  contents={\includegraphics[height=\layerheight,width=\layerwidth]{Picture}}
]{bottom}

\DeclarePageStyleByLayers{Titlepage}{top,bottom}

\newpairofpagestyles[scrheadings]{Tableofcontents}
{
    \clearpairofpagestyles
    \ihead{Lorem ipsum}
    \chead{Lorem ipsum}
    \ohead{Lorem ipsum}
}

\newpairofpagestyles[scrheadings]{Content}
{
    \clearpairofpagestyles
    \ihead{Lorem ipsum}
    \chead{Lorem ipsum}
    \ohead{Lorem ipsum}
    \cfoot{\pagemark}
}
\renewcommand*{\pagemark}{{\usekomafont{pagenumber}Page~\thepage}}

\newcommand*{\Content}{
  \cleardoublepage
  \pagenumbering{arabic}
  \pagestyle{Content}
}

\makeglossaries

\DeclareNewLayer[
  background,
  %outermargin,
  %topmargin,
  contents=\layercontentsmeasure
]{measurelayer}



\AddLayersToPageStyle{@everystyle@}{measurelayer}

\begin{document}
 %   \pagenumbering{roman}
  %  \KOMAoption{headsepline}{false}
   % \KOMAoption{footsepline}{false}
%    Titlepage
 %   \newpage
\newgeometry{left=2.5cm,right=2cm,top=2cm,bottom=2cm}
%\setlength{\headsep}{10pt}
       % \setlength{\headheight}{1.5cm}
    
    \KOMAoption{headsepline}{true}
    \KOMAoption{footsepline}{true}
    \Content
    Lorem ipsum\footnote{asdf}

    \printglossary[type=\acronymtype]
    \printglossary
\end{document} 
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.