LaTeX Cookbook by Eric
1 LaTeX编译环境——Overleaf
使用TeXstudio来编译LaTex文件,(因为Overleaf暂时不支持JabRef文献导入);
2 字体设置
粗体
\textcf{粗体文字}
3 标点符号
空格:~
引号:左上角符号`,Shift + ~
键
波浪线:\textasciitilde
4 图示
格式: .eps
绘图工具: PowerPoint
插图示例代码:
\begin{figure*}[htbp]\centering\includegraphics[width=\textwidth]{figure_file.eps}
\end{figure}
figure*
: *
表示双栏,不加*
就是单栏。(对于表格和公式也是这样)
图示位置参数一般写作:[htbp]
位置参数说明:
h
:当前位置。t
:顶部。b
:底部。p
:浮动页。
4.1 图片文件目录管理
请参考知乎——“LaTeX 如何插入图片——入门教程”;
4.2 竖排多图(子图)
横排(ab)子图
使用subfloat
实现横排多个子图:
\usepackage{subfig} % 引入subfloat
\begin{figure}[!htbp]\centering %使插入的图片居中显示\subfloat[Figure1]{\includegraphics[width=0.5\linewidth,clip]{fig.eps}\label{fig1}}\subfloat[Figure2]{\includegraphics[width=0.5\linewidth,clip]{fig.eps}\label{fig2}}\caption{Procedure of the method.}\label{fig_method}
\end{figure}
竖排(ab)子图
使用subfloat
实现竖排并列的多个子图:
\usepackage{subfig} % 引入subfloat
\begin{figure}[!htbp]\centering %使插入的图片居中显示\subfloat[Figure1]{\includegraphics[width=\linewidth,clip]{fig.eps}\label{fig1}}\\ % 换行符\subfloat[Figure2]{\includegraphics[width=\linewidth,clip]{fig.eps}\label{fig2}}\caption{Procedure of the method.}\label{fig_method}
\end{figure}
4.3 使用clip
去除图片周围的空白
使用clip
去除图示周围的空白,即:
[width=\textwidth,clip]
5 表格
5.1 合并单元格
请参考《Latex 表格技巧 - 合并单元格》
合并一行多列
\begin{table}\centering\begin{tabular}{|c|c|c|c|}\hline\multicolumn{2}{|c|}{合并一行两列} & 三 & 四 \\\hline1 & 2 & 3 & 4 \\\hline\end{tabular}
\end{table}
合并一列多行\multirow
\begin{table}[htbp]\centering\caption{Caption}\begin{tabular}{c c c c c c}\hline\multirow{2}*{\textbf{架构}} & \multirow{2}*{\textbf{参数}} & \multicolumn{4}{c}{\textbf{数据集}}\\\cline{3-6}~ & ~ & \textbf{一} & \textbf{二} & \textbf{三} & \textbf{四}\\ \hlineArchitecture & Params & 1 & 2 & 3 & 4\\\hline\end{tabular}
\end{table}
6 列表
无序列表
% 不需要引入第三方包
\begin{itemize}\item 第一项内容\item 第二项内容\item 第三项内容\item item\_category\_id:代码中遇到“\_”,需要进行转义才能正常显示。
\end{itemize}
列表项加粗
\begin{itemize}\item \textbf{列表项1:}第一项说明。\item \textbf{列表项2:}第二项说明。\item \textbf{列表项3:}第三项说明。
\end{itemize}
自由编号列表
\begin{itemize}
\itemindent 4em
\item[(1)] Aaa aaa.
\item[(2)] Bbb bbb.
\item[(3)] Ccc ccc.
\end{itemize}
7 公式
插入公式的代码如下
\begin{equation}
a = 1,
\end{equation}
8 插入代码
请参考文章《Latex 插入代码(Matlab 或 Python)》
可以参考伍老师PPT,使用algorithm2e
命令包;
代码示例:
\begin{algorithm}[htbp]
\KwIn{$N$ labeled training examples, $\{(\mathbf{x}_n,y_n)\}^N_{n=1}$,
where $\mathbf{x}_n\in\mathbb{R}^{M\times 1}$\;
\hspace*{9mm} $T$ unlabeled examples, $\{\mathbf{x}_t\}_{t=1}^T$\;}
\KwOut{The PL model predictions for $\{\mathbf{x}_t\}_{t=1}^T$.}
\tcp{Train the PL model}
Train a global fuzzy model using all $N$ training examples\;
\For{$m=1,...,M$}
{Identify the first-order rule partitions for the $m$th input domain of the
global fuzzy model\;}
Index the partitions using $k$ in (\ref{eq:k})\;
Include all partitions in the candidate pool\;
$l=1$\;
\While{$l\le L$}{
Identify from the candidate pool the partition giving the maximum SSE\;
Record the location of the partition as the $l$th patch\;
Train a patch fuzzy model using only the training examples within the
$l$th patch\;
\If{the $l$th model is successfully trained\footnotemark{}}
{$l=l+1$\;}
Remove the above patch from the candidate pool\;}
\caption{PL using fuzzy systems.} \label{alg:PLFS}
\end{algorithm}
伪代码效果图:
使用格式化包美化显示python代码
请参考博文《不一样的 LaTeX 教程:使用 listings 宏包美化代码》;
9 参考文献
管理工具: JabRef
9.1 参考文献连号显示
如果参考文献需要连号显示,例如:“[5, 6]”,
而默认模板是分开显示的“[5] [6]”,则需要加入格式包来进行设置,
在代码声明中加入如下包声明,
\usepackage[numbers,sort&compress]{natbib}
9.2 强制文献条目刊名字母大写
有两种方式:
- 使用JabRef的工具自动进行转换。
- 使用花括号
{}
指定大写单词。
10 引用编号
在引用编号的时候,首先需要用\label
指定元素的名称;
对象引用:\ref{}
文献引用:\cite{}
例如:
% 引用章节
\section{Section1}
\label{sec:context1}
The section number is \ref{sec:context1}.
% 引用公式
So the formula is \ref{eq_formula1}.
11 模板备注
8.1 IEEE模板
Latex编译器:pdflatex
(可以支持.png
图片格式)
12 LaTeX论坛提问
可以通过以下几种方式进行提问:
- 在搜索的博文下面提问,可以提问3个博文;
LaTeX Cookbook by Eric相关推荐
- PPT Cookbook by Eric
1 绘图 水平倾斜图形(边框为平行四边形) 图形的效果是这样的: 就是这里最下方的图像,不过这里该怎么进行绘制呢?我们尝试了一下,用PowerPoint的三维选择功能是无法实现的, 这里需要用到&qu ...
- Excel Cookbook by Eric
1 学习资料 Office课程(包括Excel高级应用):<Office高级应用> 1 查询数据 1.1 查询包含指定字符串的数据 请参考<第1章 Office基本操作–第2讲 Ex ...
- Word Cookbook by Eric
1 介绍 最近在学习使用Word进行论文写作: 2 表格 2.1 去掉题注前面的黑点(标题) 黑点产生的原因是因为进行了这样的设置, 在题注处,点击右键 → 段落 → 换行和分页,将这两个选项去掉复选 ...
- Python Cookbook by Eric
目录 1 Variable Python中的mutable变量 2 Operator 2.1 `:=`:海象运算符 3 Function 3.1 函数的默认参数如果是mutable,则相当于是共享的静 ...
- CSDN Cookbook by Eric
1 空格 英文单词空格: 2 字体 2.1设置文字颜色 设置字体为红色 <strong><font color=red>字体颜色为红色</font></st ...
- OpenCV Cookbook by Eric
1 致谢 感谢网友王小鹏鹏提供的资料, 链接如下:https://blog.csdn.net/kingroc/article/details/96324220 2 图像坐标系的规则 2.1 原点 坐标 ...
- Markdown Cookbook by Eric
1 图片 1.1 图片布局设置 图片左对齐(适用于Typora) <img src = "./image.png" align="left"> 2 ...
- PyTorch Cookbook by Eric
1 致谢 感谢以下博主的博文: CVHub-cvhuber -- <PyTorch 常用代码段汇总> 2 Philosophy 2.1 使用in-place操作 在代码写作时,尽量使用in ...
- Numpy Cookbook by Eric
1 前言 numpy是一个很好的向量.矩阵和张量的运算库,要好好学习- 2 Numpy数据类型 整型:int 浮点数:float 3 Np.array数组 # 创建np.array数组 a = np. ...
最新文章
- 2转单通道 python_机器学习用Python—Python集成工具包Anaconda安装步骤
- 有幸见到一朵花的绽放
- ActiveMQ已准备好黄金时段
- BeautifulSoup入门案例
- 项目管理之道之沟通管理-外部接口只能有一个
- 整个电脑键盘被锁住了_蜗居共享经济,如何彻底榨干你家里的电子设备|鼠标|共享经济|键盘|电脑桌|显示器|升降支架...
- cUrl 强大的文件上传/下载工具
- android冻结命令,在Android上使用冻结tensorflow图中的变量
- Analysis-ik 中文分词安装
- 【渝粤教育】电大中专计算机职业素养 (6)作业 题库
- 基于JavaEE的酒店客房管理系统
- Aladdin and the Flying Carpet(LightOJ - 1341)(欧拉筛 + 质因数分解)
- python图像处理学习笔记
- Vuepress2版本打包报错:TypeError: Invalid value used as weak map key
- Cadence PCB层的概念
- 这10个安全测试工具,优秀且免费
- 陪驾注意事项 这23点要注意!
- XBee模块数字和模拟采样详解
- java.lang.module_如何修复“java.lang.module.FindException:module java.se.ee not found”错误
- win7/win10系统误删管理员权限,重新启用提示拒绝访问-解决办法
热门文章
- .NET平台及C#面向对象编程
- DataTable 中各种计算(笔记)
- oracle的序列为什么会出错,Oracle系列:(24)序列
- mysql having关键字可以对group by后的结果再进行筛选
- Hibernate的HQL中in参数设置和JdbcTemplete中的in参数
- Android 自定义控件之圆形扩散View(DiffuseView)
- OpenCL将数组从内存copy到显存
- 0108--/** * 根据最大尺寸和字体计算文字的实际尺寸 */
- POJ 2723 2-SAT
- IE, Firefox, Chrome共同的保存图片bug? 求助。