LaTeX中的各種距離設置總結


 

 

LaTeX中的各種距離設置總結

 
 
1. 頁面設置

A4 會給你一個較小的頁面,為了使用更多的控制,可用 geometry宏包  和  命令 \layout

 

2. 改變長度

在latex里改變長度的命令是 \addtolength 和 \setlength。latex可認的是 cm, mm, in 和 pt. 變量可設為負數。一個例子是 \addtolength{\parindent}{-5mm}

一些有用的變量是:

頁面設置

\columnsep: 列間距
\topmargin: 頁眉到頁邊的距離
\topskip: 頁眉與正文的距離
\textheight: 正文的高度
\textwidth: 文本的寬度
\oddsidemargin: 奇數頁的左面頁邊距
\evensidemargin : 偶數頁的左面頁邊距

 


段落

\parindent: 段落縮進距離
\parskip: 段落間的距離

 


浮動圖表

\floatsep: 浮動對象之間的距離
\textfloatsep: 最后一個浮動對象頂端或第一個浮動對象底端與正文之間的距離
\intextsep : 文中浮動頂端與底端所留的距離
\dbltextfloatsep 是在雙列輸出時用 \textfloatsep 的數值
\dblfloatsep 是在雙列輸出時用 \floatsep 的數值
\abovecaptionskip: 標題上方的距離
\belowcaptionskip: 標題下方的距離

 

數學公式

\abovedisplayskip: 公式前的距離
\belowdisplayskip: 公式后面的距離
\arraycolsep: 在一個array中列之間的空白長度

 

列表

\topsep: 第一個item和前面版落間的距離
\partopsep: 當在一個新頁開始時加到 \topsep 的額外空間
\itemsep: 連續items之間的距離。

 


3. 環境

宏包 atbeginend.sty 提供了 \BeforeBegin{environment}{code-to-execute}, \AfterEnd 等等命令。這些命令可去掉環境外面和內部的空間。例如 \AfterBegin{itemize}{\addtolength{\itemsep}{-\baselineskip}} 就在環境內以重新設置 \itemsep 來壓縮items之間的距離 。

mdwlist 宏包有一個 itemize* 環境; paralist 宏包提供了一個item之間距離壓縮環境和一個使每個item不在新的一段開始的 inparaenum 環境。

 

4. 圖表

為了節約空間,可用 subfigure 宏包把多幅圖形放在一人圖形環境中,也可用 floatflt 宏包把圖形用文本包圍起來。

當有圖表時, LaTeX 缺省值不會在超過 70% 的頁中加文本。這個可有 \begin{document}加上

\renewcommand\floatpagefraction{.9}
\renewcommand\topfraction{.9}
\renewcommand\bottomfraction{.9}
\renewcommand\textfraction{.1}
\setcounter{totalnumber}{50}
\setcounter{topnumber}{50}
\setcounter{bottomnumber}{50}

 

即可。
另外,可用 caption宏包減少標題尺寸。

對於一個大的表格,可用 \setlength{\tabcolsep}{1pt}來減少表格的列間距離;也可用\resizebox{!}{5cm}{\begin{tabular} ... \end{tabular}}把整個表格當作一個圖形

 

5. 標題

一個標題周圍的距離是由 \parskip, \baselineskip等來決定的,要注意的是 LaTeX 寧願在一頁中留下空白,也不願把一個標題放在此頁的底部。如果你要重新定義這些命令,就應該仔細的讀一下 titlesec 宏包。

 

6 . 文獻里面的內容

宏包 mulitoc 可讓在單列文本中有一個兩列的表格內容存在。

可用 setspace 宏包來減少文獻中的行間距離(在文本中也是一個道理)

\begin{spacing}{0.9}
\tableofcontents
\end{spacing}

 

...

\begin{spacing}{0.9}
\bibliographystyle{plain}
\bibliography{refs}
\end{spacing}

 

如果選用了 natbib 宏包的話(推薦),就可以用 \bibsep 來控制items之間的距離。否則就可在導言區里用下面的命令。

\let\oldthebibliography=\thebibliography
\let\endoldthebibliography=\endthebibliography
\renewenvironment{thebibliography}[1]{%
\begin{oldthebibliography}{#1}%
\setlength{\parskip}{0ex}%
\setlength{\itemsep}{0ex}%
}%
{%
\end{oldthebibliography}%

 

 

 

參考:

http://blog.sina.com.cn/s/blog_47616e4c01012iol.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM