LaTeX文档的基本结构、特殊字符、插图、表格

LaTeX文档的基本结构、特殊字符、插图、表格

目录

  1. 文档的基本结构
  2. LaTeX中的特殊字符
  3. LaTeX中的插图
  4. LaTeX中的表格
  5. LaTeX中的浮动体

1. 文档的基本结构

\documentclass{ctexart} %ctexart文章类,文章标题是居中的。

%\documentclass{article} %ctexart类和ctex宏包,文章标题居左。
%\usepackage{ctex}

\begin{document}
 
 \title{DPsAdaboost:一种基于差分隐私保护的分类算法}
 \author{邱万勇} 
 \maketitle
 \tableofcontents %生成目录
 
 \section{引言}   %一级标题
 
 互联网行业“颠覆性”的发展,为通讯与数据共享带来诸多便利与快捷。
 
 大数据将以获得全体数据而非釆样数据。\\于此带来诸如个性化推荐等各样便捷服务的同时,隐私保护问题日益严重。\par 隐私问题越来越受到更多关注。

 \subsection{差分隐私保护理论基础}  %二级标题
 \subsubsection{差分隐私的定义}     %三级标题
 
\end{document}

(1.)换行符的表示
空一行:表示换行且首行缩进。
\\:表示换行。
\par:表示换行且首行缩进。
(2.) 自定义字体字号
在这里插入图片描述
6Ly9ibG9nLmNzZG4ubmV0L3FpdTE0NDA1Mjg0NDQ=,size_16,color_FFFFFF,t_70)
2. LaTeX中的特殊字符

%导言区
\documentclass{article}
\usepackage{ctex} %中文处理宏包

\usepackage{xltxtra}
%提供了针对XeTeX的改进,并且加入了XeTeX的LOGO

\usepackage{texnames} %

\usepackage{mflogo} %

%正文区
\begin{document}

 \section{空白符号}
 % 空行分段,多个空行等同于1个
 % 自动缩进,绝对不能使用空格代替
 % 英文中的多个空格处理为1个空格,中文中空格将被忽略。
 % 汉字与其他字符的间距会自动由XeLaTeX处理
 % 禁止使用中文全角空格
 There are moments in life when you miss someone so much that you just want to pick them from your dreams and hug them for real! 
 
 做你想做的梦吧,去你想去的地方吧,成为你想成为的人吧,因为你只有一次生命,一个机会Do whatever you want。

 % 1em (当前字体中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

 \section{\LaTeX 控制符}
 \# \$ \% \{ \} \~{}  \_{}  \^{}  \textbackslash \&
 
 \section{排版符号}
 \S \P \dag \ddag \copyright \pounds
 
 \section{\TeX 标志符号}
 \TeX{} \LaTeX{} \LaTeXe{}
 
 %该命令需要调用xltxtra宏包
 \XeLaTeX 
 
 %texnames宏包提供
 \AmSTeX{} 
 
 \AmS-\LaTeX{}
 
 % mflogo宏包提供
 \METAFONT{}
 
 \MF{}
 
 \MP{}
 
 \section{引号}
 ` '  `` ''
 
 ``你好!''
 \section{连字符}
 -  --   ---
 
 \section{非英文字符}
 \oe \OE \ae \AE \aa \AA \o \O \l \L \ss \SS !` ?`
 
 \section{重音符号()以O为例)}
 \`o \'o \^o \''o \~o \=o \.o \u{o} \v{o} \H{o} \r{o}
 \t{o} \b{o} \c{o} \d{o}

\end{document}

在这里插入图片描述
在这里插入图片描述
3. LaTeX中的插图

%导言区
\documentclass{article}
\usepackage{ctex}

\usepackage{graphicx}   %图片宏包
%图片在当前目录下的figures目录中。可指定多个图片路径。
\graphicspath{{figures/},{picture/}} 

%========LaTeX中的插图==========%
% 宏包:\usepackage{graphicx}
% 语法:\includegraphics[<选项>]{<文件名>}
% 格式:EPS,PDF,PNG,JPEG,BMP

%正文区
\begin{document}
 \LaTeX 中的图片使用
 
 \includegraphics{dog}
 
 \includegraphics{study.png}
 
 %设置图片缩放因子
 \includegraphics[scale=0.3]{dog}
 
 \includegraphics[scale=0.03]{dog}
 
 \includegraphics[scale=0.3]{study}
 
 %设置图片高度
 \includegraphics[height=2cm]{dog}
 
 \includegraphics[height=3cm]{dog}
 
 \includegraphics[height=3cm]{study}
 
 %设置图片宽度
 \includegraphics[width=2cm]{dog}
 
 \includegraphics[width=3cm]{dog}
 
 \includegraphics[width=3cm]{study}
 
 % 设置版型0.1倍的图片高度
 \includegraphics[height=0.1\textheight]{dog}
 
 \includegraphics[height=0.2\textheight]{dog}
 
 \includegraphics[height=0.1\textheight]{study}
 
 % 设置版型0.2倍的图片宽度
 \includegraphics[width=0.2\textwidth]{dog}
 
 \includegraphics[width=0.3\textwidth]{dog}
 
 %t同时指定参数
 \includegraphics[angle=-45,width=0.2\textwidth]{dog}
 
 \includegraphics[angle=45,width=0.2\textwidth]{dog}
 
 %======可通过cmd texdoc graphicx命令进行查看细节设置=======%
 
\end{document}

在这里插入图片描述
在这里插入图片描述
4. LaTeX中的表格

%导言区
\documentclass{article}
\usepackage{ctex}

%========表格=========%
% \begin{tabular}[<垂直对齐方式>]{列格式说明}
%     <表项> & <表项> &...& <表项> \\
%     <表项> & <表项> &...& <表项> \\
%     ......
% \end{tabular}

% 用\\表示换行
% 用&表示不同的列
% l-表示本列左对齐
% c-表示本列居中对齐
% r-表示本列右对齐
% p{<宽>}-本列宽度固定,能够自动换行

% 更多复杂表格,可通过命令查看相关文档:
% texdoc booktab 三线表等常规表格
% texdoc longtab 跨页长表格
% texdoc tabc 综合表格

%正文区
\begin{document}
 \begin{tabular}{|l| c| c| c| p{1.5cm}|}
  \hline
  姓名 & 语文 & 数学 & 外语 & 备注 \\
  \hline
  张三 & 80 & 98 & 78 & 优秀 \\
  \hline
  李四 & 78 & 88 & 54 & 补考另行通知 \\
  \hline
  王五 & 79 & 86 & 95 & 通知 \\ 
  \hline
    
 \end{tabular}
 
\end{document}

在这里插入图片描述
5. LaTeX中的浮动体

\begin{document}

\LaTeX{} 中\TeX 系统的小狗-----\ref{fig-dog} %引用标签

\begin{figure}[htbp] %使用图片浮动体环境,并设置排版位置参数htbp。
  \centering
  \includegraphics[scale=0.3]{dog}
  \caption{\TeX 系统的小狗} \label{fig-dog} %用label命令为浮动体设置标签 
\end{figure}

当然,在\LaTeX 中的表格中也可引用标签\ref{tab-score}
\begin{table}[h]    %使用表格表格浮动体环境
  \centering
  \caption{成绩单} \label{tab-score}
  \begin{tabular}{|l| c| c| c| p{1.5cm}|}
   \hline
   姓名 & 语文 & 数学 & 外语 & 备注 \\
   \hline
   张三 & 80 & 98 & 78 & 优秀 \\
   \hline
   李四 & 78 & 88 & 54 & 补考另行通知 \\
   \hline
   王五 & 79 & 86 & 95 & 通知 \\ 
   \hline
  \end{tabular}
  
 \end{table}
 
\end{document}

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值