mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
翻译完成并申请另一篇文章
This commit is contained in:
parent
bcb9a1280e
commit
7903ec284e
@ -1,3 +1,5 @@
|
||||
translating by chenxinlong
|
||||
|
||||
Free Up Some Space in Ubuntu/LinuxMint With Ubuntu Cleaner (Fork of Janitor Module)
|
||||
============================================================
|
||||
|
||||
@ -60,7 +62,7 @@ Yes, we have successfully cleaned our system now.
|
||||
via: http://www.2daygeek.com/ubuntu-cleaner-system-cleaner-ubuntu-tweak-alternative-janitor/#
|
||||
|
||||
作者:[2DAYGEEK ][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[chenxinlong](https://github.com/chenxinlong)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,150 +0,0 @@
|
||||
translating by chenxinlong
|
||||
A introduction to creating documents in LaTeX
|
||||
============================================================
|
||||
|
||||
### Learn to typeset documents in the LaTeX text markup language.
|
||||
|
||||
![A introduction to creating documents in LaTeX](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/idea_innovation_kid_education.png?itok=jpetC9wJ "A introduction to creating documents in LaTeX")
|
||||
Image by : opensource.com
|
||||
|
||||
LaTeX (pronounced _lay-tech_ ) is a method of creating documents using plain text, stylized using markup tags, similar to HTML/CSS or Markdown. LaTeX is most commonly used to create documents for academia, such as academic journals. In LaTeX, the author doesn't stylize the document directly, like in a word processor such as Microsoft Word, LibreOffice Writer, or Apple Pages; instead they write code in plain text that must be compiled to produce a PDF document.
|
||||
|
||||
### [intro.png][1]
|
||||
|
||||
![computer screen with LaTeX markup language](https://opensource.com/sites/default/files/u128651/intro.png "computer screen with LaTeX markup language")
|
||||
|
||||
### How to get started
|
||||
|
||||
To write in LaTeX, you'll need to install a LaTeX editor. I use a piece of free and open source software (FOSS) popular with academics called [TexStudio][8], which runs on Windows, Unix/Linux, BSD, and Mac OS X. You'll also need to install a distribution of the **Tex** typesetting system. I am writing on MacOS, so I use a distribution called [MacTex or BasicTex][9]. For Windows you can use [MiKTex][10], and Linux users should be able to find it in their repository.
|
||||
|
||||
Once you have downloaded TexStudio and a distribution of LaTeX, you should be ready to start typesetting your documents.
|
||||
|
||||
### Create your first document
|
||||
|
||||
In this short tutorial, we'll create a simple article with a headline, a subhead, and two paragraphs.
|
||||
|
||||
After you launch TexStudio, save your new document. (I called mine **helloworld.tex**, since I'm writing this tutorial in the Hello, World! tradition from programming.) Next, you need to add some boilerplate code at the top of your **.tex** file that specifies the type and size of your document. This is similar to the boilerplate code used in HTML5 documents.
|
||||
|
||||
My code (below) sets the page size to A4 and the text size to 12pt. You can put this code into TexStudio and edit it with your own page size, font size, name, title, and other details:
|
||||
|
||||
```
|
||||
\documentclass[a4paper,12pt]{article}
|
||||
\begin{document}
|
||||
\title{Hello World! My first LaTeX document}
|
||||
\author{Aaron Cocker}
|
||||
\date{\today}
|
||||
\maketitle
|
||||
|
||||
content will go here
|
||||
|
||||
\end{document}
|
||||
```
|
||||
|
||||
Next, click on the large green arrow to compile the document. That's the middle button in the screenshot below.
|
||||
|
||||
### [compile.png][2]
|
||||
|
||||
![compile button in TexStudio](https://opensource.com/sites/default/files/u128651/compile.png "compile button in TexStudio")
|
||||
|
||||
If there are any errors, they'll appear in the dialog box at the bottom.
|
||||
|
||||
After you compile the document, you can see what it will look like by viewing a PDF within the program as a sort of WYSIWYG preview. Remember it must be recompiled whenever you make a change to the code, as you would when programming in C++, for example.
|
||||
|
||||
To view your document, click on **Tools > Commands > View PDF**, as shown in the screenshot below.
|
||||
|
||||
### [view_as_pdf.png][3]
|
||||
|
||||
![Menu to view a PDF](https://opensource.com/sites/default/files/u128651/view_as_pdf.png "Menu to view a PDF")
|
||||
|
||||
The PDF output will be shown on the right, like this:
|
||||
|
||||
### [pdf_output.png][4]
|
||||
|
||||
![Viewing the LaTeX code as PDF](https://opensource.com/sites/default/files/u128651/pdf_output.png "Viewing the LaTeX code as PDF")
|
||||
|
||||
Now you can add a paragraph. First give it a subhead by using the **\section{}**command. Type the subhead title between the curly braces of the command; I called my subhead **Introduction**.
|
||||
|
||||
```
|
||||
\section{Introduction}
|
||||
```
|
||||
|
||||
Now that you have labeled the paragraph with its subhead, it's time to write the paragraph. For this example, I used the Lipsum [lorem ipsum generator][11]. To create the paragraph, type the **\paragraph{}** command, then add your text _underneath_ , _NOT within_ , the curly braces, inserted between **\maketitle** and **\end{document}**.
|
||||
|
||||
This is what my paragraph code looks like:
|
||||
|
||||
```
|
||||
\section{Introduction}
|
||||
|
||||
\paragraph{}
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras lorem nisi, tincidunt tempus sem nec, elementum feugiat ipsum. Nulla in diam libero. Nunc tristique ex a nibh egestas sollicitudin.
|
||||
|
||||
\paragraph{}
|
||||
Mauris efficitur vitae ex id egestas. Vestibulum ligula felis, pulvinar a posuere id, luctus vitae leo. Sed ac imperdiet orci, non elementum leo. Nullam molestie congue placerat. Phasellus tempor et libero maximus commodo.
|
||||
```
|
||||
|
||||
Your document is now finished, so you can export and save it as a PDF file by using **Save As** (just as you would with most programs).
|
||||
|
||||
Here's what my finished document and the corresponding code look like:
|
||||
|
||||
### [finished_document.png][5]
|
||||
|
||||
![The finished document with code and the PDF output side-by-side](https://opensource.com/sites/default/files/u128651/finished_document.png "The finished document with code and the PDF output side-by-side")
|
||||
|
||||
All my code from this tutorial is available below:
|
||||
|
||||
```
|
||||
\documentclass[a4paper,12pt]{article}
|
||||
\begin{document}
|
||||
\title{Hello World! My first LaTeX document}
|
||||
\author{Aaron Cocker}
|
||||
\date{\today}
|
||||
\maketitle
|
||||
|
||||
\section{Introduction}
|
||||
|
||||
\paragraph{}
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras lorem nisi, tincidunt tempus sem nec, elementum feugiat ipsum. Nulla in diam libero. Nunc tristique ex a nibh egestas sollicitudin.
|
||||
|
||||
\paragraph{}
|
||||
Mauris efficitur vitae ex id egestas. Vestibulum ligula felis, pulvinar a posuere id, luctus vitae leo. Sed ac imperdiet orci, non elementum leo. Nullam molestie congue placerat. Phasellus tempor et libero maximus commodo.
|
||||
|
||||
\end{document}
|
||||
```
|
||||
|
||||
### Learn more
|
||||
|
||||
Among the thousands of excellent resources on writing in LaTeX are the guides produced by most universities, which are indexable and can be found on Google search. [Princeton University][12] offers a good extended tutorial, and for a deeper dive, the Princeton guide's creator, Donald Knuth, offers [The TexBook][13], the ultimate guide to LaTeX.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||
Aaron Cocker - BSc Computing student attending university in the UK. I am an aspiring Data Scientist. My favourite language is Python. Feel free to contact me at aaron@aaroncocker.org.uk or visit my personal website: https://aaroncocker.org.uk
|
||||
|
||||
|
||||
---------------
|
||||
|
||||
via: https://opensource.com/article/17/6/introduction-latex
|
||||
|
||||
作者:[ Aaron Cocker][a]
|
||||
译者:[chenxinlong](https://github.com/chenxinlong)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/aaroncocker
|
||||
[1]:https://opensource.com/file/356521
|
||||
[2]:https://opensource.com/file/356526
|
||||
[3]:https://opensource.com/file/356541
|
||||
[4]:https://opensource.com/file/356536
|
||||
[5]:https://opensource.com/file/356531
|
||||
[6]:https://opensource.com/article/17/6/introduction-latex?rate=n5CmhY55ZhQRMjd6n5-f2p9f7iGg0nAWh_Bi6jqMMyc
|
||||
[7]:https://opensource.com/user/123226/feed
|
||||
[8]:http://www.texstudio.org/
|
||||
[9]:https://www.tug.org/mactex/morepackages.html
|
||||
[10]:https://miktex.org/download
|
||||
[11]:http://www.lipsum.com/feed/html
|
||||
[12]:https://www.cs.princeton.edu/courses/archive/spr10/cos433/Latex/latex-guide.pdf
|
||||
[13]:http://www.ctex.org/documents/shredder/src/texbook.pdf
|
||||
[14]:https://opensource.com/users/aaroncocker
|
||||
[15]:https://opensource.com/article/17/6/introduction-latex#comments
|
@ -0,0 +1,149 @@
|
||||
如何在 LaTex 中创建文档
|
||||
============================================================
|
||||
|
||||
### 学习以 LaTex 文本标记语言排版文档
|
||||
|
||||
![A introduction to creating documents in LaTeX](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/idea_innovation_kid_education.png?itok=jpetC9wJ "A introduction to creating documents in LaTeX")
|
||||
图片来自 : opensource.com
|
||||
|
||||
LaTeX(读作_lay-tech_)是使用纯文本创建文档的方法,使用与 HTML/CSS 或 Markdown 类似的标记标签进行风格化。 LaTeX 最常用于为学术界(如学术期刊)创建文档。 在 LaTeX 中,作者不必直接对文档进行风格化,例如 Microsoft Word,LibreOffice Writer 或 Apple Page s等文字处理程序; 而是用纯文本编写代码,这些代码必须被编译才能生成 PDF 文档。
|
||||
|
||||
### [intro.png][1]
|
||||
r
|
||||
![computer screen with LaTeX markup language](https://opensource.com/sites/default/files/u128651/intro.png "computer screen with LaTeX markup language")
|
||||
|
||||
### 起步
|
||||
|
||||
要想使用 LaTex 来书写文档,首先你必须要安装一个 LaTex 编辑器。我用的是一款免费且开源,同时在学术界也是大受欢迎的软件叫做 [TexStudio][8], 它可以运行在 Windows、Unix/Linux、BSD 和 Mac OS X 上。同时你还需要安装一个 **Tex** 排版系统的发行版。因为我斗士在 MacOS 上书写文档,所以我使用的发行版本是 [MacTex or BasicTex][9]。对于 Windows 用户你可以使用[MiKTex][10],而且 Linux 用户也可以在 repository 中找到它。
|
||||
|
||||
当你完成了 TexStudio 和 LaTex 发行版的下载,你就可以开始对你的文档进行排版了。
|
||||
|
||||
### 创建你的第一个文档
|
||||
|
||||
在这个简短的教程里,我们会创建一个简单的文章包括一个大标题、一个子标题和两个段落。
|
||||
|
||||
在启动 TexStudio后,保存一份新的文档。 (我将其保存为 **helloworld.tex** ,因为我正在编写本教程的 Hello,World!文档。这是编程的一个传统。)接下来,你需要在你的 **.txt** 文件顶部添加一些样板代码用于指定文档的类型和大小。 这与 HTML5 w文件中使用的样板代码类似。
|
||||
|
||||
我的代码(下方)将会把页面大小设置为 A4,文本大小设置为 12 pt 。 你可以直接把这些代码放入 TexStudio,并指定你自己的页面大小,字体大小,名称,标题和其他详细信息进行编辑:
|
||||
|
||||
```
|
||||
\documentclass[a4paper,12pt]{article}
|
||||
\begin{document}
|
||||
\title{Hello World! My first LaTeX document}
|
||||
\author{Aaron Cocker}
|
||||
\date{\today}
|
||||
\maketitle
|
||||
|
||||
content will go here
|
||||
|
||||
\end{document}
|
||||
```
|
||||
|
||||
接下来,点击那个大的绿色箭头来编译该文档。就是下方截图中的中间的那个按钮。
|
||||
|
||||
### [compile.png][2]
|
||||
|
||||
![compile button in TexStudio](https://opensource.com/sites/default/files/u128651/compile.png "compile button in TexStudio")
|
||||
|
||||
如果这期间发生了什么错误,它将显示在底部的对话框里。
|
||||
|
||||
在你编译了这个文档之后,你可以看到它就像一个 PDF 一样显示在程序的 WYSIWYG (所见即所得) 预览区域中。记住一旦你修改了代码就必须重新编译,就像我们在 C++ 中编程一样。
|
||||
|
||||
通过点击 **Tools > Commands > View PDF** 可以来预览你的文档,如下截图所示。
|
||||
|
||||
### [view_as_pdf.png][3]
|
||||
|
||||
![Menu to view a PDF](https://opensource.com/sites/default/files/u128651/view_as_pdf.png "Menu to view a PDF")
|
||||
|
||||
PDF 的输出将会显示在右侧,就像这样:
|
||||
|
||||
### [pdf_output.png][4]
|
||||
|
||||
![Viewing the LaTeX code as PDF](https://opensource.com/sites/default/files/u128651/pdf_output.png "Viewing the LaTeX code as PDF")
|
||||
|
||||
现在你可以添加一个段落。首先先通过 **\section{}** 命令来写一个子标题。在命令的大括号中输入你的子标题;我写的是 **Introduction**.
|
||||
|
||||
```
|
||||
\section{Introduction}
|
||||
```
|
||||
|
||||
现在你已经给你的段落标记了一个子标题,是时候来写一个段落了。在这个例子中,我使用了 Lipsum [lorem ipsum 生成器][11]。要创建一个段落,要使用 **\paragraph{}** 命令, 将你的文本插入到 **\maketitle** 和 **\end{document}** 之间的的 **\paragraph{}** 大括号下方,而不是中间。
|
||||
|
||||
以下就是我创建的段落的代码:
|
||||
|
||||
```
|
||||
\section{Introduction}
|
||||
|
||||
\paragraph{}
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras lorem nisi, tincidunt tempus sem nec, elementum feugiat ipsum. Nulla in diam libero. Nunc tristique ex a nibh egestas sollicitudin.
|
||||
|
||||
\paragraph{}
|
||||
Mauris efficitur vitae ex id egestas. Vestibulum ligula felis, pulvinar a posuere id, luctus vitae leo. Sed ac imperdiet orci, non elementum leo. Nullam molestie congue placerat. Phasellus tempor et libero maximus commodo.
|
||||
```
|
||||
|
||||
现在你的文档就已经完成了,你可以将其通过 **Save As** 选项导出并保存为一个 PDF 文档(和大多数程序一样)。
|
||||
|
||||
这是一个我已经完成的文档及其相应的代码:
|
||||
|
||||
### [finished_document.png][5]
|
||||
|
||||
![The finished document with code and the PDF output side-by-side](https://opensource.com/sites/default/files/u128651/finished_document.png "The finished document with code and the PDF output side-by-side")
|
||||
|
||||
本教程所有的代码如下所示:
|
||||
|
||||
```
|
||||
\documentclass[a4paper,12pt]{article}
|
||||
\begin{document}
|
||||
\title{Hello World! My first LaTeX document}
|
||||
\author{Aaron Cocker}
|
||||
\date{\today}
|
||||
\maketitle
|
||||
|
||||
\section{Introduction}
|
||||
|
||||
\paragraph{}
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras lorem nisi, tincidunt tempus sem nec, elementum feugiat ipsum. Nulla in diam libero. Nunc tristique ex a nibh egestas sollicitudin.
|
||||
|
||||
\paragraph{}
|
||||
Mauris efficitur vitae ex id egestas. Vestibulum ligula felis, pulvinar a posuere id, luctus vitae leo. Sed ac imperdiet orci, non elementum leo. Nullam molestie congue placerat. Phasellus tempor et libero maximus commodo.
|
||||
|
||||
\end{document}
|
||||
```
|
||||
|
||||
### 更多
|
||||
|
||||
在 LaTeX 撰写的数以千计的优秀资源中,大多数大学制作的指南是可索引的,同时也可以在 Google 搜索中找到。 [普林斯顿大学 University][12] 提供了一个很好的扩展教程,为了更深入的了解,普林斯顿大学的导师 Donald Knuth 提供了 [The TexBook][13],这是关于 LaTeX 的最好的教程。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
作者简介:
|
||||
|
||||
Aaron Cocker - 一名在英国上大学的计算机学士。我是一个有抱负的数据科学家。我最喜欢的语言是 Python。 你可以随时通过邮箱联系我 : aaron@aaroncocker.org.uk 或者访问我的个人网站 : https://aaroncocker.org.uk
|
||||
|
||||
|
||||
---------------
|
||||
|
||||
via: https://opensource.com/article/17/6/introduction-latex
|
||||
|
||||
作者:[ Aaron Cocker][a]
|
||||
译者:[chenxinlong](https://github.com/chenxinlong)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/aaroncocker
|
||||
[1]:https://opensource.com/file/356521
|
||||
[2]:https://opensource.com/file/356526
|
||||
[3]:https://opensource.com/file/356541
|
||||
[4]:https://opensource.com/file/356536
|
||||
[5]:https://opensource.com/file/356531
|
||||
[6]:https://opensource.com/article/17/6/introduction-latex?rate=n5CmhY55ZhQRMjd6n5-f2p9f7iGg0nAWh_Bi6jqMMyc
|
||||
[7]:https://opensource.com/user/123226/feed
|
||||
[8]:http://www.texstudio.org/
|
||||
[9]:https://www.tug.org/mactex/morepackages.html
|
||||
[10]:https://miktex.org/download
|
||||
[11]:http://www.lipsum.com/feed/html
|
||||
[12]:https://www.cs.princeton.edu/courses/archive/spr10/cos433/Latex/latex-guide.pdf
|
||||
[13]:http://www.ctex.org/documents/shredder/src/texbook.pdf
|
||||
[14]:https://opensource.com/users/aaroncocker
|
||||
[15]:https://opensource.com/article/17/6/introduction-latex#comments
|
Loading…
Reference in New Issue
Block a user