LaTeX basic skills

typography problem

1. Align part of a line to the right
Use \hfillthe command, for example in pseudocode

\State Estimate advantages $\hat{
    
    A}_{
    
    t}^{
    
    \pi_{
    
    k}}$ using GAE  \hfill $\rhd$Update the network using PPO

The effect is
insert image description here
2, page change

\newpage will do

3. Various spaces and character spacing
Reference link https://zhuanlan.zhihu.com/p/411399241

common code meaning

1. The commonly used htbp when inserting pictures
htbp means that latex will try its best to satisfy the floating format in the front, which is the order of htbp, so that the effect of typesetting is as good as possible, and h: here means here; t: top, Indicates at the top, b:bottom, indicates the bottom, p:page, indicates on this page

2. Some expressions of height and width
are listed below

\begin{minipage}{7cm}
\begin{minipage}[t]{0.35\linewidth}
\includegraphics[height=4.7cm]{figure.pdf}
\includegraphics[width=1\textwidth]{figure.pdf}

margin settings

I don't need to solve this problem later, so I just put some links I saw at that time here temporarily.
https://blog.csdn.net/jh1513/article/details/118256820
https://blog.csdn.net/weixin_45885232/article/details/113358488

Problems with formulas and various symbols

1. Input the desired symbol
To use \mathbbthis command, you need to add the [amssymb] package.

2. Commonly used symbols
refer to the document "LATEX Mathematical Symbols".
Some uncommon symbols need to be added \usepackage{amssymb}
insert image description here
insert image description here
insert image description here
. Other references:

3. Commonly used fonts
insert image description here
Other references:

Commonly used operations are regular, italic, bold, etc.

category font command
default font \mathnormal{}
Italian/Italic \mathit{}
Roman/Orthodox \mathrm{}
bold \mathbf{}
sans serif \mathsf{}
typewriter body \mathtt{}
handwriting (curly) \mathcal{}

space input

name Effect the code illustrate
two quad spaces a b a\qquad b ab a \qquad b width of two m
quad space a b a\quad b ab a\quad b a width of m
big space a   b a\ b a b a\ b 1/3m width
medium space a    b a\;b ab a;b 2/7m width
small space a , b a,b a,b a,b 1/6m width
compact a ! b a!b a!b a!b Tighten the width by 1/6m

Enter reserved characters, tilde, degree

There are many characters in LaTeX that have special meanings, and there are reserved characters in LaTeX # $ % & _ { } \, which cannot be directly presented in the text.
The backslash is \textbackslashrepresented by , and other symbols can be represented by adding \ in front.

a $\sim$ b                   % 输入波浪线
$30\,^{
    
    \circ}$               % 输入度
$37\,^{
    
    \circ}\mathrm{
    
    C}$     % 输入摄氏度

Commonly used macro packages

generate pseudotext lipsum

(The following directly asks about ChatGPT-3.5, reliability has not been verified)
\usepackage{lipsum} is a macro package for generating pseudotext in LaTeX. Its role is to generate some fictitious, meaningless text that is used as a placeholder in a LaTeX document in order to test and demonstrate the effect of document layout, style and formatting.

This macro package is very useful when typesetting, designing and writing LaTeX documents, especially when you need a quick and easy way to fill placeholder text. For example, when making a presentation or adjusting the layout, you can use it to fill some text to observe the alignment and layout of the text.

When you want to test a template, style, or command, the package is also handy for providing some placeholder text to test that your code is working correctly.

To use this package, just add the command \usepackage{lipsum} to the preamble of the LaTeX document. Once this command is added, you can use the \lipsum command in your document to generate a specified amount of placeholder text, or use other commands to customize text length, number of paragraphs, and language.

When you use the lipsum package, you can use different commands to control the length and number of paragraphs of the generated text. Here are some commonly used commands:

\lipsum[1]: Generate a piece of text, containing about 150 characters.
\lipsum[1-3]: generate 1 to 3 paragraphs of text, each containing about 150 characters.
\lipsum[2-4][3-5]: Generate 2 to 4 paragraphs of text, each containing 3 to 5 sentences.
\lipsum[5-7][2-4]\textbf{}: generate 5 to 7 paragraphs of text, each paragraph contains 2 to 4 sentences, and each sentence will be bolded.
Among them, the numbers in square brackets indicate the range of the generated text, the numbers in the first square brackets indicate the range of paragraphs, and the numbers in the second square brackets indicate the range of the number of sentences in each paragraph. You can also specify empty parameters in square brackets to use default values, such as \lipsum[][3] means to generate text with the default number of paragraphs, each containing 3 sentences.

The length of the generated text can be controlled by parameters using the lipsum package. Specifically, the lipsum package provides two main commands, namely \lipsum and \lipsum*[-].

When using the \lipsum command, it automatically generates a paragraph of the default length. If you need to specify the number of generated paragraphs, you can add an optional parameter after the command, such as \lipsum[1-3] means to generate 1 to 3 paragraphs of Lorem Ipsum text.

When using the \lipsum*[-] command, you can generate text of a specified length by specifying the number of the start paragraph and the end paragraph. For example, \lipsum*[2-4] means to generate Lorem Ipsum text from paragraph 2 to paragraph 4.

It should be noted that the lipsum package provides 150 paragraphs of Lorem Ipsum text by default. If you need to generate more text, you can use the \setlipsumdefault{} command to specify the number of paragraphs to be generated. Among them, represents the number of paragraphs that need to be generated. For example, \setlipsumdefault{10} means that 10 paragraphs of Lorem Ipsum text will be generated.

Guess you like

Origin blog.csdn.net/gsgbgxp/article/details/121150775