所以我正在使用回忆录文档类,但遇到了一些问题:
尽管我在序言中按如下方式设置了边距和行距,但我得到的却是错误的边距和行距(不是所需的输出):
\usepackage[left=35mm, right=25mm, top=25mm,bottom=25mm,textwidth=209.9mm,textheight=296.7mm]{geometry}
% line spacing of 1.5
\renewcommand{\baselinestretch}{1.241}
我让摘要部分中的标题可见,当我尝试删除它时,所有其他页面中的标题都消失了。我试过了\thispagestyle{empty}
,但它一直从所有页面中删除它
我想要的另一件事是从目录开始编页码。我试过了,但什么也没改变:
\clearpage
\pagenumbering{arabic}
你能帮我解决这个问题吗?这是我第一次使用 LaTeX,我没有时间好好练习。
以下是一些代码:
\documentclass[12pt,a4paper,oneside]{memoir} % for a long document
\usepackage[document]{ragged2e}
\usepackage[utf8]{inputenc} % set input encoding to utf8
\usepackage[left=35mm, right=25mm, top=25mm, bottom=25mm,textwidth=209.9mm,textheight=296.7mm]{geometry}
\usepackage{biblatex}
\usepackage{tabu}
\usepackage{colortbl}
\usepackage{longtable}
\usepackage{enumitem}
\usepackage{lipsum}
\usepackage{hyperref}
\usepackage{graphicx} % support the \includegraphics command and options
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\usepackage{setspace}
\hypersetup{linktocpage}
\setlength{\parskip}{2em}
\setlength{\parindent}{0em}
\renewcommand{\baselinestretch}{1.241}
\pagestyle{fancy}
\setlength{\trimedge}{\stockwidth}
\addtolength{\trimedge}{-\paperwidth}
\settypeblocksize{*}{\lxvchars}{1.618} % we want to the text block to have golden proportionals
\setulmargins{25mm}{*}{*} % 50pt upper margins
\setlrmargins{*}{*}{1.618} % golden ratio again for left/right margins
\setheaderspaces{*}{*}{1.618}
\checkandfixthelayout
\pretitle{\begin{center}\sffamily\huge\MakeUppercase}
\posttitle{\par\end{center}\vskip 0.5em}
%%% ToC (table of contents) APPEARANCE
\maxtocdepth{subsection} % include subsections
\renewcommand{\cftchapterpagefont}{}
\renewcommand{\cftchapterfont}{} % no bold!
%%% HEADERS & FOOTERS
\pagestyle{companion} % try also: empty , plain , headings , ruled , Ruled , companion
%%% CHAPTERS
\chapterstyle{companion} % try also: default , section , hangnum , companion , article, demo
\renewcommand{\chaptitlefont}{\Huge\sffamily\raggedright} % set sans serif chapter title font
\renewcommand{\chapnumfont}{\Huge\sffamily\raggedright} % set sans serif chapter number font
%%% SECTIONS
%\hangsecnum % hang the section numbers into the margin to match \chapterstyle{hangnum}
\maxsecnumdepth{subsection} % number subsections
\setsecheadstyle{\Large\sffamily\raggedright} % set sans serif section font
\setsubsecheadstyle{\large\sffamily\raggedright} % set sans serif subsection font
\setsubsubsecheadstyle{\normalsize\sffamily\raggedright\textbf} % set sans serif subsubsection font
%% END Memoir customization
\title{title}
\author{author}
%\date{} % Delete this line to display the current date
%%% BEGIN DOCUMENT
\begin{document}
\maketitle
%\thispagestyle{empty}
\justifying
%\pagestyle{empty}
\section*{abstract}
\lipsum{3}
\section*{résumé}
\lipsum{3}
\newpage
\clearpage
\pagenumbering{arabic}
\tableofcontents* % the asterisk means that the contents itself isn't put into the ToC
\chapter{C1} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\section{s1}
\subsection{ss1}
\subsubsection{sss1} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\subsubsection{sss2} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\subsubsection{sss3} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\subsection{ss2}
\subsubsection{sss1} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\subsubsection{sss2} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\section{s2}
\chapter{c2}
\end{document}
答案1
这是 MWE 的调整版本。我删除了不相关的软件包
\documentclass[12pt,a4paper,oneside]{memoir} % for a long document
\usepackage[T1]{fontenc}
%\usepackage[document]{ragged2e} # then \justifying is not needed
\usepackage[utf8]{inputenc} % set input encoding to utf8
\usepackage{lipsum}
\usepackage{hyperref}
\hypersetup{linktocpage}
\setlength{\parskip}{2em}
\setlength{\parindent}{0em}
\renewcommand{\baselinestretch}{1.241}
\setlength{\trimedge}{\stockwidth}
\addtolength{\trimedge}{-\paperwidth}
\settypeblocksize{*}{\lxvchars}{1.618} % we want to the text block to have golden proportionals
\setulmargins{25mm}{*}{*} % 50pt upper margins
\setlrmargins{*}{*}{1.618} % golden ratio again for left/right margins
\setheaderspaces{*}{*}{1.618}
\checkandfixthelayout
\pretitle{\begin{center}\sffamily\huge\MakeUppercase}
\posttitle{\par\end{center}\vskip 0.5em}
%%% ToC (table of contents) APPEARANCE
\maxtocdepth{subsection} % include subsections
\renewcommand{\cftchapterpagefont}{}
\renewcommand{\cftchapterfont}{} % no bold!
%%% HEADERS & FOOTERS
\pagestyle{companion} % try also: empty , plain , headings , ruled , Ruled , companion
%%% CHAPTERS
\chapterstyle{companion} % try also: default , section , hangnum , companion , article, demo
\renewcommand{\chaptitlefont}{\normalfont\Huge\sffamily\raggedright} % set sans serif chapter title font
\renewcommand{\chapnumfont}{\normalfont\Huge\sffamily\raggedright} % set sans serif chapter number font
%%% SECTIONS
%\hangsecnum % hang the section numbers into the margin to match \chapterstyle{hangnum}
\maxsecnumdepth{subsection} % number subsections
\setsecheadstyle{\Large\sffamily\raggedright} % set sans serif section font
\setsubsecheadstyle{\large\sffamily\raggedright} % set sans serif subsection font
\setsubsubsecheadstyle{\normalsize\sffamily\raggedright\bfseries} % set sans serif subsubsection font
%% END Memoir customization
% no page number on page with \maketitle
\aliaspagestyle{title}{empty}
\title{title}
\author{author}
%%% BEGIN DOCUMENT
\begin{document}
% cheating hyperref, then it doesn't warn about preexisting targets
% due to the "blank" pages
\pagenumbering{Alph}
\maketitle
\pagestyle{empty}
\section*{abstract}
\lipsum{3}
\section*{résumé}
\lipsum{3}
\clearpage
\pagestyle{companion}
\pagenumbering{arabic}
\tableofcontents* % the asterisk means that the contents itself isn't put into the ToC
\chapter{C1} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\section{s1}
\subsection{ss1}
\subsubsection{sss1} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\subsubsection{sss2} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\subsubsection{sss3} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\subsection{ss2}
\subsubsection{sss1} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\subsubsection{sss2} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur
dictum gravida mauris.
\section{s2}
\chapter{c2}
\end{document}