latex的篇章结构
用section构建篇章小节
用subsection构建子小节
还可以有subsubsection
在section下添加正文,正文内容不会被section格式而影响
可以设置空行来分割正文段落,多个空行和单个空行所显示效果一样。也可以用\来换行但是不会产生新的段落。\par可以产生新的段落
\documentclass{article}
\usepackage{ctex}
\begin{document}
\section{引言}
今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好今天天气真好
昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好昨天天气不好。\\前天天气更不好前天天气更不好。\par 反正就是今天天气最好反正就是今天天气最好反正就是今天天气最好反正就是今天天气最好反正就是今天天气最好反正就是今天天气最好
\section{实验方法}
\section{实验结果}
\subsection{数据}
\subsection{图表}
\subsubsection{数据分析}
\section{结论}
\section{致谢}
\end{document}
section及subsection的格式都可以在ctexset里进行设置
如果要添加章节chapter则需要在类型声明中设置为ctexbook
\tableofcontents来生成目录
latex中的特殊字符
空白符号
空行分段,多个空行等同1个
自动缩进,绝对不能使用空格代替
英文中多个空格处理为1个空格,中文种空格将被忽略
汉字与其他字符的间距会自动由Xelatex处理
禁止使用中文全角空格
\begin{document}
\section{空白符号}
what is your name?where are you.what is your name?where are you.what is your name?where are you.what is your name?where are you
今天天气真好 今天天气真好哇yes今天天气真好
\end{document}
用于产生空白符号的
\section{空白符号}
%1 em(d当前字体中m的宽度)
a\quad b
%2em
a\qquad b
%约为1/6个em
a\,b a\thinspace b
% 0.5个em
a\enspace b
% 空格
a\ b
% 硬空格
a~b
% 1pc = 12pt = 4.218mm
a\kern 1pc b
a\kern -1em b
a\hskip 1em b
a\hspace{35pt}b
%占位宽度
a\hphantom{xyz}b
%弹性长度
a\hfill b
latex控制符
\section{控制符}
\# \$ \{ \} \~{} \_{} \^{} \textbackslash
排版符号
\section{排版符号}
\S \P \dag \ddag \copyright \pounds
其他需要符号要使用不同的宏包
\section{引号}
`' `` '' %`表示单引号的左边,'表示单引号的右边
``wasderf''
还有连字符、非英文字符、重音符号等。
LaTex中的插图
如果需要插入图片,需要引入\usepackage{graphicx}来调用宏包,由\graphicspath{{figures/}}来指定插入图片所在的路径
\documentclass{ctexart}
\usepackage{graphicx}
\graphicspath{{figures/},{pics}}
\begin{document}
LaTex插图:
\includegraphics{2}
\end{document}
如果图片过大,可能无法正常排版,通过参数设置来设定图像高度、宽度、旋转角度等等参数
\includegraphics[height=2cm]{2}
latex的表格
\documentclass{ctexart}
\begin{document}
\begin{tabular}{l| c c c r}% l是左对齐 c居中对其 r右对齐
\hline %产生表格横线
姓名 & 政治 & 数二 & 英二 \\
刘xx & 100 & 100 & 100\\
王xx & 100 & 100 &100\\
\hline \hline %产生双横线
\end{tabular}
\end{document}
\begin{tabular}[<垂直对齐方式>]{<列格式说明>}
<表项> & <表项> & …& <表项> \
…
\end{tabular}
用\表示换行
用&表示不同的列
l-本列左对齐
c-本列居中对其
r-本列右对齐
p{<宽>}-本列宽度固定,能够自动换行
latex中的浮动体
\documentclass{ctexart}
\usepackage{graphicx}
\graphicspath{{figures/},{pics}}
\begin{document}
插图见图\ref{fig-tu}
\begin{figure}[htbp]
\centering
\includegraphics[scale=0.3]{2}
\caption{tubiao} \label{fig-tu}%前面可以引用到
\end{figure}
插图见图\ref{fig-planet}
\begin{figure}[htbp]
\centering
\includegraphics[scale=0.3]{2}
\caption{tubiao} \label{fig-planet}%前面可以引用到
\end{figure}
表格\ref{table-tu}
\begin{table}[htbp]
\centering
\caption{tubiao} \label{table-tu}%前面可以引用到
\begin{tabular}{l| c c c r}% l是左对齐 c居中对其 r右对齐
\hline %产生表格横线
姓名 & 政治 & 数二 & 英二 \\
刘xx & 100 & 100 & 100\\
王xx & 100 & 100 &100\\
\hline \hline %产生双横线
\end{tabular}
\end{table}
\end{document}