我正在尝试将布局设置为单面 A4 页面,左右边距相等,为 2.5 厘米。由于 A4 的宽度为 21 厘米,因此我尝试按照以下两个步骤进行操作:
- 将字块大小设置为 16cm(使用
\settypeblocksize{20cm}{16cm}{*}
) - 设置相等的 L & R 边距(使用
\setlrmargins{*}{*}{*}
)
我尝试了其他几种组合,但没有按预期工作;右边距非常窄,而大部分边距都在左边。
那么为什么文本没有在两个相等的左边距和右边距之间居中呢?
以下是完整代码,附上输出截图:
% Preview source code
%% LyX 1.6.7 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,oneside,english,oldfontcommands,article]{memoir}
\usepackage{mathptmx}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\newcommand{\code}[1]{\texttt{#1}}
\special{papersize=\the\paperwidth,\the\paperheight}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\settypeblocksize{20cm}{16cm}{*}
%Memoir: Set L & R margins around the type block:
%\setlrmargins{0cm}{0cm}{*}
%\settrims{0pt}{0pt}
\setlrmargins{*}{*}{*} %equal L & R margins ( = 2.5cm)
\makeatother
\usepackage{babel}
\begin{document}
\chapter{Page Dimentions}
\begin{description}
\item [{\code{\textbackslash{}stockheight}}] \the\stockheight
\item [{\code{\textbackslash{}stockwidth}}] \the\stockwidth
\item [{\code{\textbackslash{}paperheight}}] \the\paperheight
\item [{\code{\textbackslash{}paperwidth}}] \the\paperwidth
\item [{\code{\textbackslash{}textheight}}] \the\textheight
\item [{\code{\textbackslash{}textwidth}}] \the\textwidth
\item [{\code{\textbackslash{}trimtop }}] \the\trimtop
\item [{\code{\textbackslash{}trimedge}}] \the\trimedge
\item [{\code{\textbackslash{}spinemargin}}] \the\spinemargin
\item [{\code{\textbackslash{}marginparsep}}] \the\marginparsep
\item [{\code{\textbackslash{}marginparwidth}}] \the\marginparwidth
\end{description}
\chapter{Example Paragraph}
This is an example paragraph. This is an example paragraph. This is
an example paragraph. This is an example paragraph. This is an example
paragraph. This is an example paragraph. This is an example paragraph.
This is an example paragraph. This is an example paragraph. This is
an example paragraph. This is an example paragraph. This is an example
paragraph. This is an example paragraph. This is an example paragraph.
This is an example paragraph.
\end{document}
答案1
您需要添加
\checkandfixthelayout
设置完所有尺寸后。