|
47 | 47 | - LaTeX 初尝试: |
48 | 48 |
|
49 | 49 | ```latex |
50 | | - \documentclass {article} |
| 50 | + \documentclass{article} |
51 | 51 |
|
52 | | - \begin {document} |
| 52 | + \begin{document} |
53 | 53 | First document. This is a simple example, with no |
54 | 54 | extra parameters or packages included. |
55 | | - \end {document} |
| 55 | + \end{document} |
56 | 56 | ``` |
57 | 57 |
|
58 | 58 | - 标题,作者和日期示例: |
59 | 59 |
|
60 | 60 | ```latex |
61 | | - \documentclass {article} |
| 61 | + \documentclass{article} |
62 | 62 |
|
63 | | - \title {First document} |
64 | | - \author {Hubert Farnsworth\thanks {funded by the Overleaf team}} |
65 | | - \date {February 2017} |
66 | | - \begin {document} |
| 63 | + \title{First document} |
| 64 | + \author{Hubert Farnsworth |
| 65 | + \thanks{funded by the Overleaf team}} |
| 66 | + \date{February 2017} |
| 67 | + \begin{document} |
67 | 68 | \maketitle |
68 | | - We have now added a title, author and date to our first \LaTeX {} document! |
69 | | - \end {document} |
| 69 | + We have now added a title, author and date to our first \LaTeX{} document! |
| 70 | + \end{document} |
70 | 71 | ``` |
71 | 72 |
|
72 | 73 | - 文本格式化命令: |
73 | 74 |
|
74 | 75 | ```latex |
75 | | - \documentclass {article} |
76 | | - \usepackage {graphicx} |
77 | | - \graphicspath {{images/}} |
78 | | - \begin {document} The universe is immense and it seems to be homogeneous, in a large scale, everywhere we look at. |
79 | | - \begin {center}\includegraphics {universe}\end {center} |
| 76 | + \documentclass{article} |
| 77 | + \usepackage{graphicx} |
| 78 | + \graphicspath{{images/}} |
| 79 | + \begin{document} The universe is immense and it seems to be homogeneous, in a large scale, everywhere we look at. |
| 80 | + \begin{center}\includegraphics{universe}\end{center} |
80 | 81 | There's a picture of a galaxy above. |
81 | | - \end {document} |
| 82 | + \end{document} |
82 | 83 | ``` |
83 | 84 |
|
84 | 85 | - 添加图片示例: |
85 | 86 |
|
86 | 87 | ```latex |
87 | | - \documentclass {article} |
88 | | - \usepackage {graphicx} |
89 | | - \graphicspath {{images/}} |
90 | | - \begin {document} The universe is immense and it seems to be homogeneous, in a large scale, everywhere we look at.\begin {center}\includegraphics {universe}\end {center} There's a picture of a galaxy above. |
91 | | - \end {document} |
| 88 | + \documentclass{article} |
| 89 | + \usepackage{graphicx} |
| 90 | + \graphicspath{{images/}} |
| 91 | +
|
| 92 | + \begin{document} |
| 93 | + The universe is immense and it seems to be homogeneous, in a large scale, everywhere we look at. |
| 94 | +
|
| 95 | + \begin{center} |
| 96 | + \includegraphics{universe} |
| 97 | + \end{center} |
| 98 | +
|
| 99 | + There's a picture of a galaxy above. |
| 100 | + \end{document} |
92 | 101 | ``` |
93 | 102 |
|
94 | 103 | - 图片添加标题,标签和参考示例: |
95 | 104 |
|
96 | 105 | ```latex |
97 | | - \documentclass {article} |
98 | | - \usepackage {graphicx} |
99 | | - \graphicspath {{images/}} |
100 | | - \begin {document} |
101 | | - \begin {figure}[h]\centering\includegraphics [width=0.25\textwidth]{universe}\caption {a nice plot}\label {fig:mesh1}\end {figure} |
102 | | - As you can see in the figure\ref {fig:mesh1}, the function grows near 0. Also, in the page\pageref {fig:mesh1} is the same example. |
103 | | - \end {document} |
| 106 | + \documentclass{article} |
| 107 | + \usepackage{graphicx} |
| 108 | + \graphicspath{{images/}} |
| 109 | +
|
| 110 | + \begin{document} |
| 111 | +
|
| 112 | + \begin{figure}[h] |
| 113 | + \centering |
| 114 | + \includegraphics[width=0.25\textwidth]{universe} |
| 115 | + \caption{a nice plot} |
| 116 | + \label{fig:mesh1} |
| 117 | + \end{figure} |
| 118 | +
|
| 119 | + As you can see in the figure\ref{fig:mesh1}, the function grows near 0. Also, in the page\pageref{fig:mesh1} is the same example. |
| 120 | + \end{document} |
104 | 121 | ``` |
105 | 122 |
|
106 | 123 | - 表格示例: |
107 | 124 |
|
108 | 125 | ```latex |
109 | | - \documentclass {article} |
110 | | -
|
111 | | - \begin {document} |
112 | | - \begin {center}\begin {tabular}{c c c} cell1&cell2&cell3\\ |
113 | | - cell4&cell5&cell6\\cell7&cell8&cell9\end {tabular}\end {center} |
114 | | - \end {document} |
| 126 | + \documentclass{article} |
| 127 | +
|
| 128 | + \begin{document} |
| 129 | + \begin{center} |
| 130 | + \begin{tabular}{c c c} |
| 131 | + cell1 & cell2 & cell3 \\ |
| 132 | + cell4 & cell5 & cell6 \\ |
| 133 | + cell7 & cell8 & cell9 |
| 134 | + \end{tabular} |
| 135 | + \end{center} |
| 136 | + \end{document} |
115 | 137 | ``` |
116 | 138 |
|
117 | 139 | - 无序列表示例: |
118 | 140 |
|
119 | 141 | ```latex |
120 | | - \documentclass {article} |
121 | | -
|
122 | | - \begin {document} |
123 | | - \begin {itemize}\item The individual entries are indicated with a black dot, a so-called bullet.\item The text in the entries may be of any length.\end {itemize} |
124 | | - \end {document} |
| 142 | + \documentclass{article} |
| 143 | +
|
| 144 | + \begin{document} |
| 145 | + \begin{itemize} |
| 146 | + \item The individual entries are indicated with a black dot, a so-called bullet. |
| 147 | + \item The text in the entries may be of any length. |
| 148 | + \end{itemize} |
| 149 | + \end{document} |
125 | 150 | ``` |
126 | 151 |
|
127 | 152 | - 有序列表示例: |
128 | 153 |
|
129 | 154 | ```latex |
130 | | - \documentclass {article} |
131 | | -
|
132 | | - \begin {document} |
133 | | - \begin {enumerate}\item This is the first entry in our list\item The list numbers increase with each entry we add\end {enumerate} |
134 | | - \end {document} |
| 155 | + \documentclass{article} |
| 156 | +
|
| 157 | + \begin{document} |
| 158 | + \begin{enumerate} |
| 159 | + \item This is the first entry in our list |
| 160 | + \item The list numbers increase with each entry we add |
| 161 | + \end{enumerate} |
| 162 | + \end{document} |
135 | 163 | ``` |
136 | 164 |
|
137 | 165 | - 添加数学公式示例: |
138 | 166 |
|
139 | 167 | ```latex |
140 | | - \documentclass {article} |
| 168 | + \documentclass{article} |
| 169 | +
|
| 170 | + \begin{document} |
| 171 | + The mass-energy equivalence is described by the famous equation\[E=mc^2\] discovered in 1905 by Albert Einstein. In natural units ($c=1$), the formula expresses the identity |
141 | 172 |
|
142 | | - \begin {document} |
143 | | - The mass-energy equivalence is described by the famous equation\[E=mc^2\] discovered in 1905 by Albert Einstein. In natural units ($c=1$), the formula expresses the identity\begin {equation} E=m\end {equation} |
144 | | - \end {document} |
| 173 | + \begin{equation} |
| 174 | + E=m |
| 175 | + \end{equation} |
| 176 | + \end{document} |
145 | 177 | ``` |
146 | 178 |
|
147 | 179 | - 论文摘要示例: |
148 | 180 |
|
149 | 181 | ```latex |
150 | | - \documentclass {article} |
| 182 | + \documentclass{article} |
151 | 183 |
|
152 | | - \begin {document} |
153 | | - \begin {abstract} This is a simple paragraph at the beginning of the document. A brief introduction about the main subject.\end {abstract} |
154 | | - \end {document} |
| 184 | + \begin{document} |
| 185 | + \begin{abstract} |
| 186 | + This is a simple paragraph at the beginning of the document. A brief introduction about the main subject. |
| 187 | + \end{abstract} |
| 188 | + \end{document} |
155 | 189 | ``` |
156 | 190 |
|
157 | 191 | - 换行示例: |
158 | 192 |
|
159 | 193 | ```latex |
160 | | - \documentclass {article} |
161 | | - \begin {document} |
| 194 | + \documentclass{article} |
| 195 | + \begin{document} |
162 | 196 |
|
163 | 197 | Now that we have written our abstract, we can begin writing our first paragraph. |
164 | 198 |
|
165 | 199 | This line will start a second Paragraph. |
166 | | - \end {document} |
| 200 | + \end{document} |
167 | 201 | ``` |
168 | 202 |
|
169 | 203 | - 添加章节示例: |
170 | 204 |
|
171 | 205 | ```latex |
172 | | - \documentclass {article} |
173 | | - \begin {document} |
174 | | - \section {Introduction} This is the first section.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortisfacilisis sem. |
175 | | - \section {Second Section} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisissem. |
176 | | - \subsection {First Subsection} Praesent imperdietmi nec ante. Donec ullamcorper, felis non sodales... \section*{Unnumbered Section} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisissem |
177 | | - \end {document} |
| 206 | + \documentclass{article} |
| 207 | + \begin{document} |
| 208 | +
|
| 209 | + \section{Introduction} |
| 210 | + This is the first section.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortisfacilisis sem. |
| 211 | +
|
| 212 | + \section{Second Section} |
| 213 | + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisissem. |
| 214 | +
|
| 215 | + \subsection{First Subsection} |
| 216 | + Praesent imperdietmi nec ante. Donec ullamcorper, felis non sodales... |
| 217 | +
|
| 218 | + \section*{Unnumbered Section} |
| 219 | + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisissem |
| 220 | + \end{document} |
178 | 221 | ``` |
179 | 222 |
|
180 | 223 | - 添加目录示例: |
181 | 224 |
|
182 | 225 | ```latex |
183 | | - \documentclass {article} |
184 | | - \usepackage [utf8] |
185 | | - {inputenc} |
186 | | - \title {Sections and Chapters} |
187 | | - \author {Gubert Farnsworth} |
188 | | - \date {} |
189 | | - \begin {document} |
| 226 | + \documentclass{article} |
| 227 | + \usepackage[utf8]{inputenc} |
| 228 | +
|
| 229 | + \title{Sections and Chapters} |
| 230 | + \author{Gubert Farnsworth} |
| 231 | + \date{} |
| 232 | +
|
| 233 | + \begin{document} |
190 | 234 | \maketitle |
191 | 235 | \tableofcontents |
192 | | - \section {Introduction} This is the first section.\addcontentsline {toc}{section}{Unnumbered Section}\section*{Unnumbered Section} Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\section {Second Section} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. |
193 | | - \end {document} |
| 236 | +
|
| 237 | + \section{Introduction} This is the first section. |
| 238 | + \addcontentsline{toc}{section}{Unnumbered Section} |
| 239 | + \section*{Unnumbered Section} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. |
| 240 | + \section{Second Section} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. |
| 241 | + \end{document} |
194 | 242 | ``` |
195 | 243 |
|
196 | 244 | - [Overleaf 官方文档](https://www.overleaf.com/learn/latex/Main_Page) |
0 commit comments