设置边距,如附件所示

设置边距,如附件所示

我需要你的帮助,因为设置边距的命令让我抓狂。我需要生成像这里的文件一样的输出

http://www.dmi.unict.it/~difazio/PROVA_Bontempi.pdf

请问,有人能帮帮我吗?

答案1

这是一个使用类的示例memoir

  • 从PDF文件中提取页面布局参数(纸张宽度:170mm,纸张高度240mm,左边距:15mm,右边距:15mm,底部边距:20mm)。
  • 页面样式prova针对页眉进行定义(粗体、标题字体较小、规则)。
  • 章节样式prova是为章节样式定义的。

  • 字体是 Times Roman 和 Helvetica,示例使用 TeX Gyre Termes 和 TeX Gyre Heros,它们源自 Times 和 Helvetica 的 URW 变体。

示例文件:

\documentclass[11pt]{memoir}
\usepackage[italian]{babel}
\usepackage{xcolor}
\usepackage{graphicx}

%%% Page layout
%%% ===========
\setstocksize{240mm}{170mm}
\settrimmedsize{\stockheight}{\stockwidth}{*}
\setlrmarginsandblock{15mm}{15mm}{*}
\setulmarginsandblock{20.5mm}{20mm}{*}
\setlength{\headheight}{5.5mm}
\setlength{\headsep}{5mm}
\checkandfixthelayout

%%% Font setup
%%% ==========
\usepackage[T1]{fontenc}
\usepackage{tgheros}
\usepackage{tgtermes}

%%% Chapter style
%%% =============

\definecolor{chapnum}{cmyk}{0,0,0,.6}
\definecolor{chapbox}{cmyk}{0,0,0,.15}

\makechapterstyle{prova}{%
  \chapterstyle{default}%
  \setlength{\beforechapskip}{0pt}%
  \renewcommand*{\chapterheadstart}{}%
  \setlength{\afterchapskip}{5mm}%
  \renewcommand*{\printchaptername}{}%
  \renewcommand*{\chapternamenum}{}%
  \renewcommand*{\chapnumfont}{%
    \color{chapnum}%
    \normalfont
    \fontsize{1in}{1in}%
    \itshape
    \rmfamily
  }%
  \renewcommand*{\chaptitlefont}{%
    \normalfont
    \fontsize{18}{23}%
    \bfseries
    \sffamily
  }%
  \renewcommand*{\printchapternum}{%
    \hbox{%
      \sbox0{%
        \color{chapbox}%
        \vrule width\textwidth
               height 4.5mm %
               depth 9mm %
      }%
      \wd0=0pt\relax
      \dp0=0pt\relax
      \copy0\relax
      \hbox to \textwidth{\hfill\chapnumfont\thechapter}%
    }%
  }%
  \renewcommand*{\printchaptertitle}[1]{%
    \settowidth{\fboxsep}{\chaptitlefont\,}%
    \nointerlineskip
    \colorbox{chapbox}{%
      \parbox[t]{\dimexpr\textwidth-2\fboxsep\relax}{%
        \raggedleft
        \chaptitlefont
        \strut##1\strut%
        \raisebox{-\dimexpr6.7mm-\depth-\fboxsep\relax}{\strut}%
      }%
    }%
  }%
}
\chapterstyle{prova}

%%% Page style
%%% ==========
% Start pages of chapters do not have a page number
\aliaspagestyle{chapter}{empty}

% New page style "prova"
\copypagestyle{prova}{headings}
\newlength{\provaheadrulewidth}
\setlength{\provaheadrulewidth}{.5bp}
\makeheadrule{prova}{\textwidth}{\provaheadrulewidth}
\newcommand*{\provaheadingtitlefont}{%
  \bfseries
  \footnotesize
}
\makeevenhead{prova}%
  {\textbf{\thepage}}%
  {}%
  {\provaheadingtitlefont\leftmark}%
\makeoddhead{prova}%
  {\provaheadingtitlefont\rightmark}%
  {}%
  {\textbf{\thepage}}%
\makeatletter
\makeheadfootstrut{prova}%
  {%
    \sbox0{\bfseries0123456789}%
    \raisebox{0pt}[\ht0]%
      [\dimexpr\headheight-\ht0-\provaheadrulewidth\relax]{}%
  }%
  {\strut}%
\addtopsmarks{prova}{}{%
  \createmark{chapter}{left}{shownumber}{\@chapapp\ }{ -- }%
  % the original uses the hyphen "-" instead of the dash "--"
}
\makeatother
\pagestyle{prova}
\nouppercaseheads

%%% Divers
%%% ======
% \section seems to be unnumbered
\setsecnumdepth{chapter}

% bold is used instead of italics for emphasized text
\let\emph\textbf

% blind text
\usepackage{lipsum}

\begin{document}
\setcounter{page}{143}
\setcounter{chapter}{9}

\chapter{La cinetica chimica}
\lipsum[1]
\newpage
\lipsum[2]
\newpage
\lipsum[3]
\section{Esercizi svolti}
\lipsum[4]
\cleardoublepage
\end{document}

第一页:

第 1 页

第二页:

第2页

答案2

像这样的东西可以满足您的需求:

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}

\usepackage{geometry}
\geometry{
  paperwidth=17cm,
  paperheight=24cm,
  outer=2cm,
  inner=2cm,
  top=3cm,
  bottom=2.5cm,
  heightrounded,
}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{%
  \markboth{\ifnum\value{chapter}>0 \chaptername\ \thechapter\ - \ \fi #1}{}%
}
\renewcommand{\sectionmark}[1]{\markright{#1}}

\fancyhf{}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[RE]{\bfseries\nouppercase{\leftmark}}
\fancyhead[LO]{\bfseries\nouppercase{\rightmark}}

\fancypagestyle{plain}{%
  \renewcommand{\headrulewidth}{0pt}%
  \fancyhf{}%
}

\usepackage{lipsum}

\begin{document}
\mainmatter
\chapter{Prova}

\lipsum[2]

\section{Sezione}

\lipsum

\end{document}

只需检查模型的尺寸并调整我使用的长度。

相关内容