我希望文本左边距较大,章节标题和浮动使用正常左边距,节标题位于两者中间。此代码:
\documentclass{memoir}
\usepackage{lipsum}
\setlrmarginsandblock{1in}{1in}{*}
\setulmarginsandblock{1in}{1in}{*}
\checkandfixthelayout
\begin{document}
\chapter{Chapter Title}
\lipsum[1]
\section{Section Title}
\lipsum[2]
\subsection{Sub Section Title}
\lipsum[3]
\newpage
\lipsum[4]
\section{Section Title}
\lipsum[5]
\subsection{Sub Section Title}
\lipsum[6]
\end{document}
给出这个:
我希望它看起来像这样:
(请特别注意,页眉不应与段落文本对齐,并且文本的额外边距始终位于左侧,无论内外边距是否不同。)
有没有简单的方法?
(文档类别是回忆录,我正在使用 XeLaTeX,以防万一。)
答案1
也许您应该首先考虑文本块,然后根据文本块调整分部标题。我希望以下内容能有所帮助(减去任何拼写错误并加上您的调整)。
\documentclass[oneside]{memoir} % oneside to make all pages look the same
\usepackage{lipsum}
\newlength{\secprob} % a working length
\setlength{\secprob}{2in}
\setulmarginsandblock{1in}{1in}{*}
\setlrmarginsandblock{1.5\secprob}{1in}{*} % wider left margin
\checkandfixthelayout
\makeatletter
\renewcommand*{printchaptername}{\hspace{-\secprob} \chapnamefont \@chappap} % outdent chapter name
\renewcommand*{\printchaptertitle}[1]{\hspace{-\secprob} \chaptertitlefont #1} % outdent chapter title
\setsecindent{-0.5\secprob} % outdent for sections
\makepagestyle{secprob} % the page style
\makeevenhead{secprob}{\hspace{-\secprob}\thepage}{}{\leftmark}
\makeoddhead{secrob}{\hspace{-\secprob}{\thepage}{}{\rightmark}
\makeatother
\pagestyle{secprob}
\begin{document}
% then as the questioner's code for the rest
\end{document}
有关详细信息,请参阅手册 ( > texdoc memoir
) 第 6 章和第 7 章。
答案2
在这里,adjustwidth 环境是你的朋友。
\documentclass[11pt]{memoir}
\usepackage{lipsum}
\usepackage{calc,environ}
%% page size and text block sizes
\setstocksize{9.25in}{6.125in}
\settrimmedsize{\stockheight}{\stockwidth}{*}
\setulmarginsandblock{0.85in}{*}{1}
\setlrmarginsandblock{0.5in}{*}{3.5}
\newlength{\margindiff}\setlength{\margindiff}{\foremargin - \spinemargin}
\newlength{\mpsep}\setlength{\mpsep}{2em}
\newlength{\mwidth}\setlength{\mwidth}{\margindiff -\mpsep}
\setmarginnotes{\mpsep}{\mwidth}{0.25\baselineskip}
\checkandfixthelayout
%% FULL PAGE
\NewEnviron{FullPage}{%
\begin{adjustwidth*}{0em}{-\margindiff}
\BODY
\end{adjustwidth*}
}
%% HALF PAGE
\NewEnviron{HalfPage}{%
\begin{adjustwidth*}{0.5\margindiff}{-0.5\margindiff}
\BODY
\end{adjustwidth*}
}
\begin{document}
\begin{FullPage}
\chapter{First One}
This sentence shows how the text flows over the entire line of the page without having margins set on the left or right.
\end{FullPage}
\lipsum[1]
\begin{HalfPage}
\lipsum[2]
\end{HalfPage}
\end{document}
您可能还需要使用边距差异偏移来缩进任何章节标题,例如:
\usepackage{titlesec}
\titlespacing{\section}{-\margindiff}{...}{...}%