我需要按照以下要求处理我的书:
页面:a4size 字体:14pt 边距 - 全部:2cm 格式:书籍,双面,右开
我使用过 extbook 和 scrbook,有带几何图形的也有不带几何图形的,但左右边距设置不正确。请帮忙...
\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}
答案1
以下是我确定边距值的方法:
2cm = \the\dimexpr 2cm\relax\par
left margin = \the\dimexpr 1in+\oddsidemargin\relax\par
right margin = \the\dimexpr \paperwidth-1in-\oddsidemargin-\textwidth\relax\par
答案2
\layout
包提供的命令layout
不仅显示页面大小的值,还显示两张图片来解释大小的含义。然后您可以计算边距的值,如@John Kormylo 所示。
\usepackage[
margin=2cm,
footskip=35pt% use a smaller foot skip to print the page number on the paper
]{geometry}
奇数页:
偶数页:
\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}
补充说明关于 KOMA-Script 选项和命令。
a4size
不是 KOMA-Script 选项。但paper=a4
(或a4paper
)是默认选项。
使用fontsize=14pt
而不是仅14pt
。如果需要此字体大小,请准确阅读https://tex.stackexchange.com/a/306788。
无需重新定义\cleardoublepage
,如果插入的空白页\cleardoublepage
需要使用页面样式plain
,可以设置class选项cleardoublepage=plain
。
若所有章节页面都要使用页面样式empty
,则重新定义\chapterpagestyle
为empty
(默认为plain
)。
如果目录确实应该列在目录中,您可以tocbibind
用选项listof=totoc, bibliography=totoc, index=totoc
和替换包。\setuptoc{toc}{totoc}
要缩进段落,您可以使用 KOMA-Script 环境addmargin
。并且有一个命令可以在使用和选项(的默认设置)\dedication
时插入题注页。\maketitle
titlepage=true
scrbook
要获得带有目录条目和页眉的未编号章节或部分,您可以分别使用\addchap
和\addsec
。
\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}