LaTeX concise tutorial

Keywords: Latex

3.1 basic references

At the end of the source code, add references wrapped by the bibliography environment. Each reference begins with \ bibitem, followed by the content of the reference itself. Use \ cite {⟨ citation ⟩} at the corresponding position in the text: ⟨ citation ⟩ is the corresponding [] content of the literature to be quoted.

\begin{thebibliography}{⟨widest label⟩} %⟨widest label⟩Indicates the maximum number of references. Generally, 99 indicates that 99 references can be cited at most.
\bibitem[⟨item number⟩]{⟨citation⟩} % ⟨item number⟩ The serial number of user-defined references will generally be omitted, and the given serial number will be sorted naturally.⟨citation⟩ yes\cite Document labels used,
\bibitem[⟨item number⟩]{⟨citation⟩}
\bibitem{cs-c-svm}Loudun ,Yin Yaqiang.be based on CS-C-SVM Multi parameter GNSS Deception interference detection[J/OL].signal processing :1-10[2021-11-27] %An example is used for body reference\cite{cs-c-svm}
\end{thebibliography}


Note: the application style of references is generally the new national standard of GB/T 7714-2015. Under HowNet, first click on 1 position in the figure below to find the citation in the required format. The same is true for other websites.

The reference style generated above is [1]. To implement superscript references, you have to add the following code in the introduction area and use the \ upcite {} command when quoting the text.

%%% Add the following code to the introduction area
\newcommand{\upcite}[1]{\textsuperscript{\textsuperscript{\cite{#1}}}}


The Bibliography environment automatically generates an unnumbered section (article document class) or chapter (report / book document class). The section title of the article document class defaults to "Reference", while the chapter title of the report / book document class defaults to "Bibliography".

An example code is given below:

\documentclass{article}
\usepackage{ctex}
\begin{document}
\section{Cited references}
Here's an example, right GNSS Make a reference to your article\cite{cs-c-svm}，There is also a second superscript reference\upcite{ins-gnss}.
\begin{thebibliography}{99}
\bibitem{cs-c-svm}Loudun ,Yin Yaqiang.be based on CS-C-SVM Multi parameter GNSS Deception interference detection[J/OL].signal processing :1-10[2021-11-27].http://kns.cnki.net/kcms/detail/11.2406.TN.20211122.1852.006.html.
\bibitem{ins-gnss}Liu di,Liu Kun,Bi Yunrui,Xu Youxiong,Song Qing Zhu.Graph based optimization INS/GNSS Research on deep integrated navigation system[J/OL].Electro optic and control:1-7[2021-11-27].http://kns.cnki.net/kcms/detail/41.1227.tn.20211117.2037.003.html.
\end{thebibliography}
\end{document}


3.2 reference by BIBTEX

In the bibliography environment in the previous section, the citation of references can be realized, but this citation method is not convenient to migrate between the list styles of various references (different journals may have different requirements), and this sort is very unfavorable to management, So here is a more manageable way of reference: BIBTEX.

1. Establish a. Bib document library and store it in the same level directory of. tex file: its content is several document entries. The establishment method is to create a new file in Winedt and name it xxx.bib when saving. Generally, BIBTEX document entries do not need to be handwritten. BIBTEX document entries can be exported from Google Scholar or HowNet / Wanfang and other websites. Most document management software also supports the generation of BIBTEX format database.

Generation of Google Scholar literature entries:

As shown in the above figure, first find the literature to be quoted, click the double quotation mark at 1, and select BibTeX in the quotation format to get the following contents:

@article{groves2015principles, %This is\cite{}Referenced label
title={Principles of GNSS, inertial, and multisensor integrated navigation systems, [Book review]},
author={Groves, Paul D},
journal={IEEE Aerospace and Electronic Systems Magazine},
volume={30},
number={2},
pages={26--27},
year={2015},
publisher={IEEE}
}


Copy it to the newly created. bib file above. The brackets in the first line contain the label referenced by the body.

In addition to the above methods, you can also use the document management software to generate document entries (which will be mentioned later when introducing the document management software).

1. Setting the format of references: the writing methods of references vary greatly in different documents, including the order and font style of author, title, year, etc., and the sorting rules of documents in the list. BIBTEX uses style to manage the writing of references. BIBTEX provides several predefined styles, such as plain, unsrt, alpha, etc. If you use the journal template, you may provide your own style. Style files have a. bst extension. The way to use a style file is to use the \ bibliographystyle command in the source code (generally in the introduction area): \ bibliographystyle {⟨ bst name ⟩}, where ⟨ bst name ⟩ is the name of the. bst style file without the. bst extension. If the predefined style is used, use \ bibliographystyle{plain};

2. Use the \ cite {} command to quote in the text. When generating a reference list at the end of the text, usually only the references referenced in the text are listed, rather than all the references in the. bib file;

3. Where references need to be listed, use the \ bibliography command: \ bibliography {⟨ bib name ⟩}, where ⟨ bib name ⟩ is the file name of the BIBTEX database without the. bib extension.

4. Compile in the following order: xelatex - > bibtex - > xelatex - > xelatex. Note that three times of xelatex compilation and one time of bibtex compilation are required. The shortcut key Shift+Ctrl+B can be used for bibtex compilation.

An example code is given below:

\documentclass{article}
\bibliographystyle{plain}
\begin{document}
\section{Some words}
Some excellent books, for example\cite{groves2015principles,hofmann2007gnss}.
\bibliography{ref}% bib Name of the library
\end{document}

%The following is the corresponding example code bib Document library content
@article{groves2015principles,
title={Principles of GNSS, inertial, and multisensor integrated navigation systems, [Book review]},
author={Groves, Paul D},
journal={IEEE Aerospace and Electronic Systems Magazine},
volume={30},
number={2},
pages={26--27},
year={2015},
publisher={IEEE}
}
@book{hofmann2007gnss,
title={GNSS--global navigation satellite systems: GPS, GLONASS, Galileo, and more},
author={Hofmann-Wellenhof, Bernhard and Lichtenegger, Herbert and Wasle, Elmar},
year={2007},
}


3.3 form of text reference

LaTeX provides the processing of person name year reference methods: for example, the natbib macro package supports two reference methods in the body: \ citep {⟨ city ⟩} and \ citet {⟨ city ⟩}, which generate person name year references in the form of (Axford et al., 2013) and Axford et al. (2013).

Secondly, the natbib macro package also supports digital references and can compress the serial numbers of references. For example, when calling the natbib macro package with \ usepackage [numbers, sort & compress] {natbib}, after specifying the above options, when multiple documents are cited continuously, references in the form of [3 – 7] will be generated instead of [3, 4, 5, 6, 7].

3.4 latex compilation process

Here's a question: why do you sometimes need to compile twice or three times to generate a complete PDF file?

In addition to the source code file. tex, we may be exposed to files of various formats when using LATEX. This section briefly introduces the files you can often see when using LATEX. Each macro package and document class is a file with a specific extension. In addition, some files appear in the LATEX template:

• . sty macro package file. The name of the macro package matches the file name.

• . cls document class file. The document class name is consistent with the file name.

• . bib BIBTEX reference database file.

• . BST reference format template used by BibTex.

In addition to generating documents in. dvi or. pdf format, LATEX may also generate a considerable number of auxiliary files and logs during compilation. Some functions, such as cross reference, references, directories, indexes, etc., need to generate auxiliary files through compilation, and then read the auxiliary files to get the correct results when compiling again. Therefore, complex LATEX source code may have to be compiled many times. These auxiliary intermediate files are listed below:

• The log file generated by the. Log typesetting engine is used for troubleshooting errors.

• The main and auxiliary files generated by. aux LATEX record cross references, directories, references, etc.

• Directory record file generated by. toc LATEX.

• The picture directory record file generated by. lof LATEX.

• Table directory record file generated by. lot LATEX.

• . bbl BIBTEX generated reference record file.

• . BLG log file generated by BibTex.

• The index record file generated by. idx LATEX for makeindex processing.

• . ind makeindex handles the formatted index file generated by. idx for typesetting.

• Log files generated by. ilg makeindex.

• PDF bookmark record file generated by. out hyperref macro package.

Posted by Sikk Industries on Wed, 01 Dec 2021 02:35:16 -0800