latex排版工具生成pdf

使用latex排版软件,方便的生成格式化的文档,比word的各种编辑方便很多

1
sudo pacman -S texlive-most texlive-lang

tex的安装很大,texlive-most大约600m, texlive-lang大约300m

新建文本文件test.tex, ‘%’ is comment

1
2
3
4
5
\documentclass[UTF8]{article}
% 这里是导言区
\begin{document}
Hello, world!
\end{document}
1
2
3
latex test.tex     # generate test.dvi
xdvi test.dvi # open window to overview
pdflatex test.tex # generate test.pdf

latex预览
test2.tex, 试试中文支持

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
\documentclass{article}

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{WenQuanYi Micro Hei Mono}

\title{你好,world!}
\author{Liam}
\date{\today}
\begin{document}
\maketitle
\section{你好中国}
中国在 East Asia.
\subsection{Hello Beijing}
北京是 capital of China.
\subsubsection{Hello Dongcheng District}
\paragraph{Tian'anmen Square}
is in the center of Beijing
\subparagraph{Chairman Mao}
is in the center of 天安门广场。
\subsection{Hello 北京}
\paragraph{北京} is an international city。
\end{document}
1
xelatex test2.tex # test2.pdf

latex预览
注意使用中文字体,fc-list

如果在pdflatexxelatex过程出现错误,在?后面输入x然后回车退出


转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 hui740024906@163.com

文章标题:latex排版工具生成pdf

文章字数:258

本文作者:qianggetaba

发布时间:2019-08-26, 14:08:40

最后更新:2019-09-10, 10:33:59

原始链接:https://qianggetaba.com/2019/08/26/latex/

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。

目录
×

喜欢就点赞,疼爱就打赏