1

I'm trying to typeset a book (actually, a dictionary) but keep having trouble setting equal inner and outer margins on both even and odd pages. I have done it numerous times before, but this time either Geometry ignores my parameters or sth else is going on.

I would be grateful if you could shed some light...

Here's what the code looks like (not the complete source):

\documentclass[6pt,twoside]{scrbook}

\usepackage[paperwidth=4.125in, 
            paperheight=6.25in, 
            bindingoffset=0.2in,
            inner=1.0in,
            outer=0.5in,
            top=0.4in,
            bottom=0.75in,
            columnsep=20pt,
            layoutsize={4in,6in},
            layouthoffset=0.125in,
            layoutvoffset=0.25in,
            showcrop=true,
            showframe=true
            ]
            {geometry}

And here's what the result looks like (I would obviously like a greater outer margin on odd pages - and an accordingly smaller inner margin - so that everything fits fine)

enter image description here

P.S. In case it matters, the source code is being compiled with xelatex. If you need to see more code, just let me know! ;)


UPDATE

Source sample:

%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[6pt,twoside]{scrbook}

\usepackage[paperwidth=4.125in, 
      paperheight=6.25in, 
      bindingoffset=0.2in,
        inner=1.0in,
        outer=0.5in,
        top=0.4in,
        bottom=0.75in,
        columnsep=20pt,
        layoutsize={4in,6in},
        layouthoffset=0.125in,
        layoutvoffset=0.25in,
        showcrop=true,
        showframe=true
      ]
      {geometry}

\usepackage[strict]{changepage}
\usepackage{atveryend}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\usepackage{palatino}
\usepackage{microtype}

\usepackage{multicol}

\usepackage[bf,sf,center]{titlesec}
\usepackage{afterpage}
%\usepackage{ragged2e}
\usepackage{lipsum}
\usepackage{fancyhdr}
\fancyhead[L]{\textsf{\rightmark}}
\fancyhead[R]{\textsf{\leftmark}}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[C]{}
\pagestyle{fancy}

%\usepackage[utf8]{inputenc}
%\usepackage[T2A,T1]{fontenc}
\usepackage[spanish,english]{babel}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{backgrounds}
\usetikzlibrary{calc}

\definecolor{ultralightgray}{gray}{0.90}

\usepackage{tabularx}

\newcommand{\printchaptertitle}[1]{
\vspace{0.5cm}
\flushleft
\begin{tikzpicture}
  \draw[fill,color=black] (0,0) rectangle (1cm,1cm);
  \draw[color=white] (0.5cm,0.5cm) node { \Huge{#1} };
\end{tikzpicture}
\vspace{0.5cm}
}
\setlength{\parindent}{0pt}
\setmainfont[ItalicFont={Times New Roman Italic},BoldItalicFont={Times New Roman Bold Italic}]{Frutiger}
\setsansfont[ItalicFont={Times New Roman Italic},BoldItalicFont={Times New Roman Bold Italic}]{Frutiger}

\newfontfamily\hebr{Myriad Hebrew}

\usepackage{hang}
\usepackage{xeCJK}
\setCJKmainfont{PingFang SC}
\setCJKsansfont{PingFang SC}

\newcommand{\conjpageindex}[2]{
  \leavevmode\checkoddpage
  \ifoddpage{\begin{tikzpicture}[overlay,remember picture]\node[left,rectangle,white,fill=darkgray!70!white,minimum width=1.4cm,text width=1.0cm,align=left] at ($(current page.east) +(0cm,#2)$){\bfseries{#1}};\end{tikzpicture}}\else{\begin{tikzpicture}[overlay,remember picture]\node[right,rectangle,white,fill=darkgray!70!white,minimum width=1.4cm,text width=1.0cm,align=right] at ($(current page.west) +(0cm,#2)$){\bfseries{#1}};\end{tikzpicture}}\fi
}

\newcommand{\lemmaposp}[1]{{\textcolor{darkgray}{\bfseries\textit{#1}}}}

\newcommand{\lemmagender}[1]{{\textit{#1}}}

\newcommand{\conjsection}[1]{%
  {$\smash{\textbf{\color{black} #1}}$}
}

\newcommand{\conjsubsection}[1]{%
  {\textit{\underline{\smash{#1}}}}
}

\newcommand{\conjseparator}{%
  \vspace{0.3cm}
}

\usepackage{tcolorbox}
\definecolor{mycolor}{rgb}{0.435, 0.435, 0.435}
\makeatletter
\newcommand{\mybox}[1]{%
  \setbox0=\hbox{#1}%
  \setlength{\@tempdima}{\dimexpr\wd0+13pt}%
  \begin{tcolorbox}[colframe=mycolor,boxrule=0.5pt,arc=4pt,
      left=6pt,right=6pt,top=6pt,bottom=6pt,boxsep=0pt,width=\@tempdima]
    #1
  \end{tcolorbox}
}
\makeatother

\begin{document}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PHRASEBOOK
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter*{Phrasebook}
\addcontentsline{toc}{chapter}{Phrasebook}

\section*{Numbers}
\addcontentsline{toc}{section}{Numbers}

\lipsum[1-12]

\section*{Useful Phrases}
\addcontentsline{toc}{section}{Useful Phrases}

\lipsum[1-12]

\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is the end,
% my only friend the end...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
  • 2
    It is really so difficult to make a complete example by adding a bit lipsum text? Beside this: imho your offset values are wrong. Jun 12, 2019 at 8:45
  • @UlrikeFischer Just added some sample code :) Jun 12, 2019 at 9:05
  • 2
    I bet that you can easily remove 30 lines or more from your code which are unrelated to the issue. Jun 12, 2019 at 9:20
  • @UlrikeFischer Quite likely. Although I posted it all just in case some of the following lines was the culprit (I just confirmed that even leaving just the Geometry part, it's still not working...) Jun 12, 2019 at 9:23
  • 2
    You can easily test which lines are relevant and which not: Simply comment the line and try it out. After a few rounds you will have short complete minimal example that you can post. (but don't leave out geometry, it is obviously needed to setup the layout, but you can test the settings). Jun 12, 2019 at 9:28

1 Answer 1

2

The following gives a symmetrical layout between odd and even pages:

\documentclass[fontsize=6pt,twoside]{scrbook}

\usepackage[paperwidth=4.125in,
            paperheight=6.25in,
            %bindingoffset=0.2in, %  <----------- commented out
            inner=1.0in,
            outer=1.0in,          %  <----------- same as inner
            top=0.4in,
            bottom=0.75in,
            columnsep=20pt,
            layoutsize={4in,6in},
            layouthoffset=0.125in,
            layoutvoffset=0.25in,
            showcrop=true,
            showframe=true
            ]
            {geometry}

% You can also use this to visualize the layout:
% \usepackage{showframe}
% \renewcommand\ShowFrameLinethickness{0.15pt}
% \renewcommand*\ShowFrameColor{\color{blue!30!white}}

\begin{document}
  \noindent A\newpage \noindent B
\end{document}

Page 1


Page 2

Note: after seeing the KOMA-Script warning, I replaced your 6pt \documentclass option with fontsize=6pt.

2
  • I just tried your example, but it's still not working. if you measure the outer margins carefully, you will notice that the one on page 1 (odd page) is greater than that of page 2 (even page). Jun 12, 2019 at 9:16
  • That is not correct. On PNG images created from the PDF file with ImageMagick (resolution: 384 dpi; size: 1584×2400), the page body starts at 431 pixels from the left margin for both pages. Either you confused left of one of the page bodies with the line marking where the marginpar area stops when it is on the left (this is the case for even pages), or you printed the document and your printer or printing toolchain added a horizontal offset.
    – frougon
    Jun 12, 2019 at 9:22

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