1

I need to process my book according to the following requirements:

page: a4size font: 14pt margins - all : 2cm format: book, twoside, openright

I have used both extbook as well as scrbook, with and without geometry, but the left and right margins are not being set correctly. Help please...

\documentclass[a4size, 14pt, twoside, openright]{scrbook}
\addtokomafont{disposition}{\rmfamily}

\usepackage{layouts}

\printinunitsof{cm}

\usepackage[margin=2cm]{geometry}

\usepackage{amsmath}
\usepackage{graphicx,epsfig}
\usepackage{subfigure}
\usepackage{calc}
\usepackage{setspace}
\usepackage{booktabs}
\usepackage{sistyle}
\usepackage{epigraph}
\usepackage{hyphenat}
\usepackage{flafter}
\usepackage{varioref}
\usepackage{bibunits}
\usepackage{tocbibind}
\usepackage[refpages]{gloss}
\usepackage[usenames]{pstcol}
\usepackage{pst-grad}
\usepackage{pst-node}
\usepackage{pst-tree}
\usepackage[T1]{fontenc} %
\usepackage[latin1]{inputenc} 


\usepackage{textcomp}
\usepackage{multirow}
\usepackage{array}
\usepackage[colorlinks=true,linkcolor=MidnightBlue,citecolor=MidnightBlue]{hyperref}%
\usepackage{breakurl}
\input{colordefin.txt}


\pdfinclusioncopyfonts=1

\newcommand{\degree}{\ensuremath{^\circ}}
\providecommand{\abs}[1]{\lvert#1\rvert}


\makeatletter
\renewcommand*\cleardoublepage{\clearpage\if@twoside
\ifodd\c@page\else
\hbox{}
\thispagestyle{plain}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother

\newenvironment{myindentpar}[1]%
{\begin{list}{}%
         {\setlength{\leftmargin}{#1}}%
         \item[]%
}
{\end{list}}

\newenvironment{dedicat}
{
   \cleardoublepage
   \thispagestyle{empty}
   \vspace*{\stretch{1}}
   \hfill\begin{minipage}[t]{0.66\textwidth}
   \raggedright
}%
{
   \end{minipage}
   \vspace*{\stretch{3}}
   \clearpage
}




\begin{document}

\pagevalues



\frontmatter
\author{astralsmith}
\title{The Best Test Book}

\maketitle

\begin{dedicat}
 \emph{To my family}
\end{dedicat}


\chapter*{Abstract}
\chaptermark{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\thispagestyle{empty}

Pro at sensibus qualisque, no verterem corrumpit duo. Vix choro eloquentiam an, nam ne diceret mentitum necessitatibus. Per id dolor inimicus honestatis, eos brute vitae ridens ea, ad has deleniti volutpat appellantur. Et quis convenire vel.

Cum homero perfecto ex, fabulas maluisset ei usu. Quo agam alienum an, eu vero aliquid est. Est probo tation in, ut consul facilisis consulatu his. Ea labores voluptatibus eam. Summo ceteros ei pri, sea cu novum quaerendum, eam zril petentium ex. No sit labitur argumentum consequuntur, ne quot delenit has, lorem petentium evertitur eu mel. Eu sea ipsum possim.

Ipsum saepe iuvaret ne duo, eos labores sapientem ex, pri an omnis oblique. Nec cu nulla graece referrentur, ad homero legere volumus has, mucius appareat aliquando cu eam. Eum ad labore apeirian, est labitur labores cu. Duo an elitr singulis inciderint, ius et idque utamur diceret. Cu aperiri fabellas persequeris duo, dolor nostrud vim no, per an ullum iracundia interpretaris.

Vel no suas everti voluptatibus, dicunt viderer signiferumque nec ea. Eum animal laoreet no, clita definiebas assueverit te has, id cum virtute petentium suscipiantur. Nostro impetus sed ex, postulant adipiscing et vix. Mel agam mundi reformidans eu, no etiam dolorum mel, mei ea movet dicant maiorum. Eu usu prima dictas animal, sit porro nostrum theophrastus eu. Clita suscipiantur nam ei, legimus neglegentur vituperatoribus ei eam.

Mea in ullum posidonium. Ei vim mentitum evertitur posidonium, mundi assentior theophrastus mea et, magna denique vis eu. Laudem dolorum fabellas duo ne, mea hinc imperdiet ut. Minim fabellas sea ei, ut qui animal epicurei. In sed postea instructior, nam reprimique scripserit repudiandae te.

Dolore docendi an has, malis fabulas torquatos et qui. Ad pri oratio menandri, scripta invenire his ne, vel cibo solum reprehendunt eu. Tantas repudiare cu sit, mea ea case impedit petentium, wisi solet delicata eum ad. Utamur adipisci laboramus per cu, ne brute soluta libris mei. His bonorum impedit corpora ad, an ferri mucius appetere eos. Viris epicurei pri te, natum affert quodsi mei ut. Eu eirmod verterem duo, vix ne ferri ludus vituperata, veniam mentitum invenire eam et.

Usu in tale posse, cum ut quas laboramus pertinacia. Ad eos summo utinam, id laoreet suscipit nec. Sit at sanctus omittam ullamcorper, sale harum ei pro. Cu quod nonumes quo, ei doctus facilisi eum, eu quo posse facete. Option nostrum officiis eos et, qui ut democritum neglegentur. At invidunt sensibus prodesset nam.

Fugit persius pericula an has, an dolore regione ius. Ne adhuc equidem ius, cu altera semper scaevola sed. Sonet voluptaria pri in, erant feugait splendide usu an, eos ut porro altera diceret. Ex vis sale meis, cum at facilisi philosophia. Agam lobortis vix id. In vidit accusata est. Ad eam delenit tibique forensibus, nibh necessitatibus ex vim, eam eirmod fabulas ei.

Nam rebum verear pericula ex. No eum sale malis inani, vel et modus error. Ei quo rebum verear dolorum, ad mel harum postea omnium. No eum doctus incorrupte, eius altera explicari quo ea, at labore dictas moderatius qui. Ad his adipisci gloriatur, id magna porro eos, qui ex case dicant. Ne ius solet epicuri, ei eos option quaeque quaerendum. Vis probo malis aeterno et, ex laudem patrioque cum, no duo mucius iriure definiebas.

Et consul voluptua sed. Eam ne tempor reprehendunt, est erant epicuri neglegentur eu. Epicuri suscipiantur eu ius, cu vero cibo ignota sit. Has ne nostro detracto signiferumque. Decore graeco nostrum ad vis, ne pro tritani eloquentiam.


\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\thispagestyle{empty}
Pro at sensibus qualisque, no verterem corrumpit duo. Vix choro eloquentiam an, nam ne diceret mentitum necessitatibus. Per id dolor inimicus honestatis, eos brute vitae ridens ea, ad has deleniti volutpat appellantur. Et quis convenire vel.

\section*{Overview of the best test}
Cum homero perfecto ex, fabulas maluisset ei usu. Quo agam alienum an, eu vero aliquid est. Est probo tation in, ut consul facilisis consulatu his. Ea labores voluptatibus eam. Summo ceteros ei pri, sea cu novum quaerendum, eam zril petentium ex. No sit labitur argumentum consequuntur, ne quot delenit has, lorem petentium evertitur eu mel. Eu sea ipsum possim.

Ipsum saepe iuvaret ne duo, eos labores sapientem ex, pri an omnis oblique. Nec cu nulla graece referrentur, ad homero legere volumus has, mucius appareat aliquando cu eam. Eum ad labore apeirian, est labitur labores cu. Duo an elitr singulis inciderint, ius et idque utamur diceret. Cu aperiri fabellas persequeris duo, dolor nostrud vim no, per an ullum iracundia interpretaris.

Vel no suas everti voluptatibus, dicunt viderer signiferumque nec ea. Eum animal laoreet no, clita definiebas assueverit te has, id cum virtute petentium suscipiantur. Nostro impetus sed ex, postulant adipiscing et vix. Mel agam mundi reformidans eu, no etiam dolorum mel, mei ea movet dicant maiorum. Eu usu prima dictas animal, sit porro nostrum theophrastus eu. Clita suscipiantur nam ei, legimus neglegentur vituperatoribus ei eam.

Mea in ullum posidonium. Ei vim mentitum evertitur posidonium, mundi assentior theophrastus mea et, magna denique vis eu. Laudem dolorum fabellas duo ne, mea hinc imperdiet ut. Minim fabellas sea ei, ut qui animal epicurei. In sed postea instructior, nam reprimique scripserit repudiandae te.

Dolore docendi an has, malis fabulas torquatos et qui. Ad pri oratio menandri, scripta invenire his ne, vel cibo solum reprehendunt eu. Tantas repudiare cu sit, mea ea case impedit petentium, wisi solet delicata eum ad. Utamur adipisci laboramus per cu, ne brute soluta libris mei. His bonorum impedit corpora ad, an ferri mucius appetere eos. Viris epicurei pri te, natum affert quodsi mei ut. Eu eirmod verterem duo, vix ne ferri ludus vituperata, veniam mentitum invenire eam et.





\chapter*{Acknowledgements}
\chaptermark{Acknowledgements}
\addcontentsline{toc}{chapter}{Acknowledgements}
\thispagestyle{empty}
I acknowledge everyone.
I am obliged to none.
\newline
\newline
Fantacyland, May 2020
\newline
astralsmith



\tableofcontents
%\thispagestyle{empty}



\end{document}
Mico
  • 506,678
  • 1
    Welcome to TeX SX! Could you post an example of what you tried? Normally, with geometry it's easy. – Bernard Jul 19 '16 at 15:15
  • The standard LaTeX document classes (article, report, and book) do not support 14pt as the default font size. Are you willing and able to use an alternative document class, say memoir and/or scrbook? – Mico Jul 19 '16 at 15:25
  • This is part of my preamble:

    \documentclass[a4size, 14pt, twoside, openright]{scrbook} \addtokomafont{disposition}{\rmfamily}

    \usepackage{layouts}

    \printinunitsof{cm}

    \usepackage[margin=2cm]{geometry}

    – astralsmith Jul 19 '16 at 15:30
  • @Bernard the code is now posted, above. Sorry, new here - not sure how to post it in a proper way :) Thanks for your help! – astralsmith Jul 19 '16 at 15:55
  • @Mico yes I am using scrbook. I also tried extbook, but not memoir. – astralsmith Jul 19 '16 at 15:56
  • @Mico thanks for correcting! Do you see the same problem? – astralsmith Jul 19 '16 at 16:22
  • @astralsmith - I don't experience a problem with the left- and right-hand margins. However, I notice that the only half of the page numbers is printed; the other half is cut off by the page margin. – Mico Jul 19 '16 at 16:26
  • @Mico I use pdflatex for compiling as I have PDF figures to insert -- compiling using latex gives problems. Yes, I also see the problem with the page numbers, I thought of solving it later...

    BTW, I just checked the sample code with latex as well, the left and right margins are still not 2cm....

    – astralsmith Jul 19 '16 at 16:30
  • When I finally got this to run, I got the right margin value: 2cm = 56.9055pt. You need to add 1in to \oddsidemargin and subtract a lot of stuff from\paperwidth to get the left and right margins. – John Kormylo Jul 19 '16 at 18:39
  • Your code produces exactly the margins you want – checked with showframe and the ruler of my pdfviewer. The margins, in LaTeX sense are not the intuitive margins, as explained by John Kormylo. The margins in geometry denote the intuitive margins. – Bernard Jul 19 '16 at 19:27

2 Answers2

1

Here is how I determined the margin values:

2cm = \the\dimexpr 2cm\relax\par
left margin = \the\dimexpr 1in+\oddsidemargin\relax\par
right margin = \the\dimexpr \paperwidth-1in-\oddsidemargin-\textwidth\relax\par
John Kormylo
  • 79,712
  • 3
  • 50
  • 120
1

The command \layout provided by package layout shows not only the values of the page sizes but also two pictures which explain the meaning of the sizes. Then you can calculate the values of the margins as shown by @John Kormylo.

\usepackage[
  margin=2cm,
  footskip=35pt% use a smaller foot skip to print the page number on the paper
]{geometry}

Odd pages:

enter image description here

Even pages:

enter image description here

\begin{raggedright}
  1in = \the\dimexpr 1in\relax\par
  2cm = \the\dimexpr 2cm\relax\par
  left margin = \the\dimexpr 1in+\oddsidemargin\relax\par
  right margin = \the\dimexpr \paperwidth-1in-\oddsidemargin-\textwidth\relax\par
  top margin = \the\dimexpr 1in+\topmargin+\headheight+\headsep\relax\par
  bottom margin = \the\dimexpr \paperheight-1in-\topmargin-\headheight-\headsep-\textheight\relax\par
  foot skip = \the\footskip\relax\par
\end{raggedright}

enter image description here


Additional remarks regarding KOMA-Script options and commands.

a4size is not a KOMA-Script option. But paper=a4 (or a4paper) is default.

Use fontsize=14pt instead of only 14pt. And if need this font size exactly read https://tex.stackexchange.com/a/306788.

There is no need to redefine \cleardoublepage. If the blank pages inserted by \cleardoublepage should use page style plain, you can set the class option cleardoublepage=plain.

If all chapter pages should use page style empty, redefine \chapterpagestyle to empty (default is plain).

You can replace package tocbibind by options listof=totoc, bibliography=totoc, index=totoc and \setuptoc{toc}{totoc}, if the TOC should be really listed in table of contents.

To indent paragraphs you can use the KOMA-Script environment addmargin. And there is a command \dedication which inserts a dedication page when \maketitle and option titlepage=true (default for scrbook) are used.

To get an unnumbered chapter or section with TOC entry and running head you can use \addchap and \addsec respectivly.

\documentclass[
  %paper=a4,% default
  fontsize=14pt,% 14pt is deprecated
  DIV=calc,% to avoid the warning regarding the missing default DIV value for 14pt
  %twoside,% default
  %openright,% default
  cleardoublepage=plain,% instead your redefinition of \cleardoublepage
  listof=totoc,% lists get an entry in TOC
  bibliography=totoc,
  index=totoc
]{scrbook}
\setuptoc{toc}{totoc}% table of contents gets an entry in TOC (not recommended)
\addtokomafont{disposition}{\rmfamily}
\renewcommand\chapterpagestyle{empty}% replaces the \thispagestyle{empty} on chapter pages

\usepackage{layout}% \layout shows the layout and the different lengths

\usepackage[
  margin=2cm,
  footskip=35pt% use a smaller foot skip to print the page number on the paper
]{geometry}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

\usepackage{blindtext}% dummy text
\begin{document}
\frontmatter
\author{astralsmith}
\title{The Best Test Book}
\dedication{To my family}
\setkomafont{dedication}{\itshape}
\maketitle

\layout% show the page layout of odd and even pages
\begin{raggedright}
  1in = \the\dimexpr 1in\relax\par
  2cm = \the\dimexpr 2cm\relax\par
  left margin = \the\dimexpr 1in+\oddsidemargin\relax\par
  right margin = \the\dimexpr \paperwidth-1in-\oddsidemargin-\textwidth\relax\par
  top margin = \the\dimexpr 1in+\topmargin+\headheight+\headsep\relax\par
  bottom margin = \the\dimexpr \paperheight-1in-\topmargin-\headheight-\headsep-\textheight\relax\par
  foot skip = \the\footskip\relax\par
\end{raggedright}

\addchap{Abstract}
\Blindtext

\begin{addmargin}[2cm]{0cm}% an indented paragraph
\blindtext
\end{addmargin}

\blindtext

\addchap{Preface}
\blindtext
\addsec*{Overview of the best test}
\Blindtext

\addchap{Acknowledgements}
\begin{raggedright}
  I acknowledge everyone.
  I am obliged to none.
  \par\bigskip
  Fantacyland, May 2020
  \par
  astralsmith
\end{raggedright}

\tableofcontents
\listoffigures
\listoftables
\end{document}
esdd
  • 85,675