书写你的第一篇latex文本(2)
接上一次的《书写你的第一篇latex文本(1)》https://www.cnblogs.com/liangxuran/p/15844269.html
第六步:构建第一篇完整的文本
当你在写一个真实的文档时,因为你要修正错别字等,你会运行 LATEX 很多次,所以在实践中重新运行命令不是问题。最后,我们将添加脚注、目录和参考书目。
1 \documentclass[UTF8]{article} 2 \usepackage{geometry} 3 \usepackage{fancyhdr} 4 \usepackage{amsmath ,amsthm ,amssymb} 5 \usepackage{graphicx} 6 \usepackage{hyperref} 7 \usepackage{lipsum} 8 \title{Test document} 9 \author{Xuran \\ \url{xuranliang@hotmail.com}} 10 \date {2022-Jan-26} 11 \begin{document} 12 \maketitle 13 \tableofcontents 14 \newpage 15 16 This is some preamble text that you enter 17 yourself .\footnote{First footnote .}\footnote{Second footnote .} 18 19 \section{Text for the first section} 20 \lipsum [1] 21 \subsection{Text for a subsection of the first section} 22 \lipsum [2-3] 23 \label{labelone} 24 25 \subsection{Another subsection of the first section} 26 \lipsum [4-5] 27 \label{labeltwo} 28 29 \section{The second section} 30 \lipsum [6] 31 32 Refer again to \ref{labelone}.\cite{ConcreteMath} 33 Note also the discussion on page \pageref{labeltwo} 34 35 \subsection{Title of the first subsection of the second section} 36 \lipsum [7] 37 38 \begin{thebibliography}{9} 39 \bibitem{ConcreteMath} 40 Ronald L. Graham , Donald E. Knuth , and Oren Patashnik , 41 \textit{Concrete Mathematics}, 42 Addison -Wesley , Reading , MA , 1995. 43 \end{thebibliography} 44 \end{document}
编译之后的pdf显示如下:
第七步:编写第一个复杂公式
许多对 LATEX 感兴趣的人都希望将数学包括在内。下面的例子来自具体数学。amsthm 包使我们能够访问定理环境,但这些超出了本文档的范围。
1 \documentclass[UTF8]{article} 2 \usepackage{geometry} 3 \usepackage{fancyhdr} 4 \usepackage{amsmath ,amsthm ,amssymb} 5 \usepackage{graphicx} 6 \usepackage{hyperref} 7 \usepackage{lipsum} 8 \title{Test document} 9 \author{Xuran \\ \url{xuranliang@hotmail.com}} 10 \date {2022-Jan-26} 11 \begin{document} 12 \maketitle 13 14 This is some preamble text that you enter 15 16 There are $\binom{2n+1}{n}$ sequences 17 with $n$ occurrences of $-1$ and $n+1$ 18 occurrences of $+1$, and Raney’s lemmatells us that 19 exactly $1/(2n+1)$ of these sequences have 20 allpartial sums positive. 21 22 Elementary calculus suffices to 23 evaluate $C$ if we are clever 24 enoughto look at the double 25 integral 26 \begin{equation*} 27 C^2 =\int_{-\infty }^{+\infty} e^{-x^2} 28 \mathrm{d}x\int_{-\infty }^{+\infty} e^{-y^2} 29 \mathrm{d}y\;. 30 \end{equation*} 31 32 Solve the following recurrence for $n,k\geq 0$: 33 \begin{align*} 34 Q_{n,0} &= 1 35 \quad Q_{0,k} = [k=0]; \\ 36 Q_{n,k} &= Q_{n-1,k}+Q_{n-1,k-1}+\binom{n}{k}, 37 \quad\text{for $n,k >0$.} 38 \end{align*} 39 40 \end{document}
编译效果图
本文来自博客园,作者:Philbert,转载请注明原文链接:https://www.cnblogs.com/liangxuran/p/15845379.html