Latex common function

zhaozj2021-02-08  531

Duan Zeng

Chinese habits are indented in the paragraph, in Latex, / parindent represents the length of the segment to indent, we set it to the width of the two uppercase letters M of the current font size, which is exactly the width of the two Chinese characters:

/ setLength {/ parindent} {2em}

Latex defaults to the first paragraph of each section not indent, which does not comply with Chinese typis habits. We hope that every paragraph of the text should be indented, and you can use the IndentFirst macro package:

/ usepackage {indefirst}

2. Segment distance

Latex uses / baselineskip to represent the current line spacing, the default value is about 1.2 times the current font size, if the current font number is 10pt, then / baselineskip is 12PT. This is suitable for English typography, which is too crowded to Chinese, because English is more written for lowercase letters, the word height is almost (ie 1EX). If the font size is 10pt, then 1ex = 4.3pt. I usually set the line spacing to 1.8 times the font size:

/SetLength {/baselineskip}{}}} {1.8em}

This value can be changed at any time and is valid for the text after the change point.

LaTex uses / Parskip to represent the paragraph, I usually set it to 1EX:

/ setLength {/ Parskip} {1ex}

Note that the commands of these modifications are best placed in the body area (ie / begin {document}).

3. Page footbrow

I usually use the FancyHDR macro package to set the header and footer.

/ DocumentClass [10pt, A4paper] {book} / usPackage {fancyhdr}

We first set the page style to Fancy in Latex and set the header and footer in this style. But it is the first page of each chapter by default, it is a PLAIN and requires separate processing.

% Setting Plain Style / FancyPageStyle {Plain} {% / FancyHf {}% Calm Current Setting% Settings Header (Head) / FancyHead [RE] {/ LEFTMARK}% Display Chart / FANCYHEAD in the right side of the even page LO] {/ rightmark}% in the left side of the odd page / FANCYHEAD [Le, RO] {~ / thepage ~}% in the left side of the even page, the right side of the odd page is displayed: The right lower feet of each page show the title of the book / fancyfoot [Ro, RE] {/ it typesetting with /latex }/renewcommand /headrulewidth} {0.7pt}% header and the main horizontal line thick / renewcommand {/ footroulewidth } {0pt}}

/ PageStyle {fancy}% selection fancy style% The rest of the rest of Plain Style / FancyHf {} / fancyhead [re] {/ leftmark} / fancyhead [LO] {/ Rightmark} / fancyhead [le, ro] {~ / thepage ~} / Fancyfoot [RO, RE] {/ it typesetting with /latex }/renewcommand {/headroulewidth} / / fT}/renewcommand /footrulewidth} 0fw% 设置 设置 方式 方式 方式 方式 方式 方式 方式 设置 设置 设置 方式 方式 设置 设置 设置 方式 方式 方式 方式 方式 方式 方式 方式 方式] {/ markboth {~ 第 ~ / thechapter ~ chapter ~~~ # 1 ~} {}} / renewcommand {/ sectionmark} [1] {/ markright {~ / called ~~ # 1 ~} {}}

4. Section title I usually use the TitleSec macro package to set the format of the chapter title that appears in the body:

/ usepackage {titlesec}

Set the chapter name to right, the font size is / huge, the word is black, the chapter is bold, and the spacing is set:

/ titleFormat {/ chapter} {{{{{{} {}} {0pt} {}} {0pt} {- 20pt} {25pt}

Set the font size of the section name / large, the word is black, the nin is bold, and the spacing is set:

/ titleformat {/ section} {/ limited / hei} {{{{p} {}} {0pt} {} / titlespacing * {}} {0pt} {1EX Plus .3EX minus .2ex} {-. 2EX Plus .2ex}

Where / hei is defined as:

/ newcommand {/ hei} {/ cjkfamily {hei}}

5. Paper size

Graduation thesis requires B5 paper, single-sided print, I use Geometry macro to set the paper and version of heart:

/ DocumentClass [10PT, B5PAPER] {report} / available} [body = {12.6cm, 20cm}, centering, dvipdfm] {geometry}% or more set the center width to 12.6cm, high 20cm, version heart, and automatic settings The paper size of the PDF file.

转载请注明原文地址:https://www.9cbs.com/read-97.html

New Post(0)