Latex排版系统使用

来源:互联网 发布:vscode 小程序 编辑:程序博客网 时间:2024/05/21 21:15

  最近在实习,需要写一些文档,听说latex排版比较方便,所以学习了一下latex基本使用操作:

latex安装,参考了百度经验:https://jingyan.baidu.com/album/624e745948b48a34e8ba5aae.html

latex使用,CSDN上有一篇很详细的latex使用入门博客:http://blog.csdn.net/u014803202/article/details/50410748

我使用过程中遇到的一些问题和解决方法记录:

1.如何插入尖括号?<>

solution1:

$\langle html \rangle$表示<html>

solution2:
放到数学环境中(使用宏包amsthm  \usepackage{amsthm})
$<>$

2.放到数学环境中的字体是斜体,如何转换为正体?

latex斜体变正体需在代码前加 rm
y=exp(log(x+1))
代码:y=exp(log(x+1))
y=exp(log(x+1))
代码:\rm y=exp(log(x+1))
y=exp(log(x+1))
代码:y={rm exp}({rm log}(x+1))
{}可以控制作用域的范围

3.latex中的中文的显示;

\usepackage{CJK}    %使用CJK宏包

\begin{CJK}{UTF8}{song}    %使用宋体

\begin{document}

正文

\end{CJK}

\end{document}


4.新建一个空白文档
\documentclass{article}

\begin{document}

  Hello Latex

\end{document}

标题、作者和注释
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。

 \documentclass{article} 


   \author{My Name}


   \title{The Title}


     \begin{document}

     \maketitle


   hello, world % This is comment 

\end{document}


5.章节和段落
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。

\documentclass{article} 

\title{Hello World}

\begin{document} 

\maketitle 

     \section{Hello China} China is in East Asia. 

      \subsection{Hello Beijing} Beijing is the 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 Tian'anmen Square 

      \subsection{Hello Guangzhou}  

      \paragraph{Sun Yat-sen University} is the best university in Guangzhou.

\end{document}

加括号以后可以将字体加粗

6.加入目录
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。

\documentclass{article}

 
\begin{document}


   \tableofcontents 

 \section{Hello China} China is in East Asia. 

    \subsection{Hello Beijing} Beijing is the capital of China. 

      \subsubsection{Hello Dongcheng District} 


 \paragraph{Hello Tian'anmen Square}is in the center of Beijing 


 \subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square

\end{document}


7.换行
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。
\documentclass{article}

\begin{document}
   Beijing is
   the capital
   of China.

  Washington is   the capital

   of America.

   Amsterdam is \\ the capital \\ 
   of the Netherlands.
\end{document}

空一行为另起一段,\\为段内强制换行。