latex常用技巧总结

这篇博客总结了使用 LaTeX 的一些实用技巧,包括在线编辑器如 Overleaf 和 ShareLaTeX(现合并为 Overleaf v2)的使用,图片、表格、链接和公式的排版方法,以及如何实现文本加粗、颜色变换和调整图片与注释间距。还提到了 LaTeX 的双栏和单栏排版,并提供了相关资源链接。

关于使用latex的一些小总结

常用的在线latex

  • relatex
  • overleaf

    sharelatex在2018年的后面阶段会和overleaf合并,构成overleaf v2版本!!!!


常用的latex排版

图片排版
\usepackage{subfig}
\usepackage{float}
\usepackage{graphicx}

\begin{figure}[htbp]%[h], [t], [b] or [p] - here, top, bottom and on a separate page, respectively
    \centering
    \begin{minipage}[t]{0.25\linewidth}%设定图片下字的宽度,在此基础尽量满足图片的长宽
        \centering
        \includegraphics[width=2cm]{figures/figure1/0.png}
        \caption*{(a)}%加*可以去掉默认前缀,作为图片单独的说明
        \label{fig1_a}
    \end{minipage}
    \begin{minipage}[t]{0.25\linewidth}%设定图片下字的宽度,在此基础尽量满足图片的长宽
        \centering
        \includegraphics[width=2cm]{figures/figure1/1.png}
        \caption*{(b)}%加*可以去掉默认前缀,作为图片单独的说明
        \label{fig1_b}
    \end{minipage}
    \begin{minipage}[t]{0.25\linewidth}%设定图片下字的宽度,在此基础尽量满足图片的长宽
        \centering
        \includegraphics[width=2cm]{figures/figure1/2.png}
        \caption*{(c)}%加*可以去掉默认前缀,作为图片单独的说明
        \label{fig1_d}
    \end{minipage}
    \\
    \begin{minipage}[t]{0.25\linewidth}%设定图片下字的宽度,在此基础尽量满足图片的长宽
        \centering
        \includegraphics[width=2cm]{figures/figure1/3.png}
        \caption*{(d)}%加*可以去掉默认前缀,作为图片单独的说明
        \label{fig1_e}
    \end{minipage}
    \begin{minipage}[t]{0.25\linewidth}%设定图片下字的宽度,在此基础尽量满足图片的长宽
        \centering
        \includegraphics[width=2cm]{figures/figure1/4.png}
        \caption*{(e)}%加*可以去掉默认前缀,作为图片单独的说明
        \label{fig1_f}
    \end{minipage}
    \begin{minipage}[t]{0.25\linewidth}%设定图片下字的宽度,在此基础尽量满足图片的长宽
        \centering
        \includegraphics[width=2cm]{figures/figure1/5.png}
        \caption*{(f)}%加*可以去掉默认前缀,作为图片单独的说明
        \label{fig_h}
    \end{minipage}
    \caption{Your caption here}% 此处添加的caption内容表示整张图片的标注信息
    \label{fig1}
\end{figure} 
表格使用
% \\代表换行, &代表对齐

\begin{table}[!htbp] % [h], [t], [b] or [p] - here, top, bottom and on a separate page, respectively
\small	%设置字体大小
\begin{tabular}{c c c}	%设置表格列数和排列方式:c:center, l:left, r:right
\toprule % 上方水平线
& \multicolumn{2}{c}{Metrics} \\ \cmidrule(l){2-3} % 合并多列
Params & P & S\\ % Column names row
\midrule % 表格内部水平线
W16\_D2\_B6 & 1	& 1\\ % 内容 row 1
W16\_D3\_B6 & 2	& 2\\ % 内容 row 2
W16\_D4\_B6 & 3	& 3\\ % 内容 row 3
W16\_D2\_B8 & 4	& 4\\ % 内容 row 4
W16\_D2\_B10 & 5 & 5\\ % 内容 row 5
W16\_D2\_B12 & 6 & 6\\ % 内容 row 7
W32\_D2\_B6 & 6	& 6\\ % 内容 row 8
W64\_D2\_B6 & {\color{red}7} & {\color{red}7}\\ % 内容 row 9
\bottomrule % Bottom horizontal line
\end{tabular}
\caption{Your caption here.}% 表格标注信息
\label{table1}
\end{table}
加入链接
\usagepackage{hyperref}

\url{link here}
使用公式
\usagepackage{amsmath}

\begin{equation}
	you equation here                 % 写数学公式
	\label{unique label here}         % 为公式构建唯一标签,方便引用
\end{equation}
latex双栏和单栏排版

使用latex模板的时候经常看见有两种排版模式,一种是双栏排版,另外一种是但栏排版,但是在插图的时候,我们很经长需要在双栏排版的情况下添加单栏目排版的效果,可以使用如下操作:

% 一般的插图排版
\begin{figure}
\end{figure}

% 插图的双栏目排版下的单栏目(占据整个page的宽度的排版方式)
\begin{figure*}		% 只需要在标签的末尾添加*符号就可以使用在双栏目排版下的图片单栏目排版
\end{figure*}
文本加粗和变换颜色
\usagepackage{color}
{\color{red}text}       % red可以替换成其他任意颜色,text换成你想要的文本内容
\textbf{text}           % text换成你想要的文本内容
缩小图片与注释之间的距离
\setlength{\abovecaptionskip}{-1cm} %缩小caption和图像之间的距离
\setlength{\belowcaptionskip}{-1cm} %缩小caption和下方文字的距离

latex链接

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值