Latex 算法宏包-使用 While 循环

https://stackoverflow.com/questions/60463394/latex-algorithm-package

documentclass{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{algorithm}
usepackage{algorithmic}
usepackage{amsmath}

egin{document}
egin{algorithm}
   caption{Sinkhorn's algorithm}
   egin{algorithmic}
   WHILE{ $| B(u_{k}, v_{k})1 - mu | + | B(u_{k}, v_{k})^{T} 1 - 
u | ge epsilon'$ }
       IF {$k 	ext{ mod } 2 = 0$}
           STATE $u_{k+1} = u_{k} + ln left( frac{mu}{B(u_{k},v_{k})mathrm{1}} 
ight)$
           STATE $v_{k+1} = v_{k}$
       ELSE
           STATE $v_{k+1} = v_{k} + ln left( frac{
u}{B(u_{k},v_{k})^{T} mathrm{1}} 
ight) $
           STATE $u_{k+1} = u_{k}$
       ENDIF
           STATE $k = k+1$
   ENDWHILE
   end{algorithmic}
   end{algorithm}
end{document}

https://en.wikibooks.org/wiki/LaTeX/Mathematics
本文来自Wikibooks-LateX/Mathemaatics的翻译
Latex 自定义运算符-wiki

Latex 缩小图片和表格所占的空间:

scale 放在tabular外面,比如缩小0.5 scale{0.5}{egin{tabular}....}

图片 表格都可以缩

latex 添加空白页,用于在双栏的模板中,把 reference 挤到新的一页。

参考: https://m.newsmth.net/article/TeX/318717

ewpage
mbox{}
ewpage

最近编辑硕士毕业论文发现:

TexLive 虽然能够编译中文,但似乎无法编译硕士毕业论文的模板
在按照 README.md 文件安装了 CTex Full 之后,ctex 包里带的 texworks 能够编译模板了。
但居然发现 TexLive 的 TexWorks 也能编译 毕业论文的中文模板了。

  • 先前有一次 ctex 的 texwork 与 texlive 的 texwork 冲突:
    重新启动笔记本电脑后,编辑 texworks 发现出错,报错信息中出现了 ctex 文件夹.
    后面发现此 texwork 非彼 texwork。
    ctex 下的 texwork 和 texlive 下的 texwork 不一样。机器更改了默认使用,启用了 ctex 下的 texwork. 可能是由于 ctex 后安装,而且之前笔记本电脑一直没有关机过,
    所以直到今天,重新开机后才触发了更新。
subfigure 宏包添加子标题,需要使用 caption 命令。 受此 blog 启发添加 caption 命令

在英文环境编译命令下, egin{subfigure}[uniform label noise]{} 这一命令会自动指示子标题为 "uniform label noise"。

例如:
Subfigure: error “Missing number, treated as zero”

documentclass{article}
usepackage{graphicx,subfigure}
egin{document}
egin{figure}
centering     %%% not center
subfigure[Figure A]{label{fig:a}includegraphics[width=60mm]{example-image-a}}
subfigure[Figure B]{label{fig:b}includegraphics[width=60mm]{example-image-b}}
caption{my caption}
end{figure}
end{document}

上述命令可以显示子标题。

但最近编译中文的硕士毕业论文发现,需要分别额外加一条命令 caption{均匀标记噪声} 才能显示出子标题。

egin{figure}[t] % the loss distribution
%setlength{abovecaptionskip}{-0.01cm}   %调整图片标题与图距离
%setlength{elowcaptionskip}{-0.3cm}   %调整图片标题与下文距离
centering     %%% not center
    egin{subfigure}[uniform label noise]{0.32linewidth}
        includegraphics[width=linewidth]{my_picture/0pad_uniform_loss.pdf}
        caption{均匀标记噪声}    
        label{fig:loss_distribution_a}
    end{subfigure} %
    egin{subfigure}[pairwise label noise]{0.32linewidth}    
			includegraphics[width=linewidth]{my_picture/0pad_PN_loss.pdf}
			caption{成对标记噪声}
			label{fig:loss_distribution_b}  
    end{subfigure} 
    egin{subfigure}[structured label noise ]{0.32linewidth}    
			includegraphics[width=linewidth]{my_picture/0pad_AN_loss_loss.pdf}
			caption{结构标记噪声}
			label{fig:loss_distribution_c}
    end{subfigure} 
caption{不同噪声类型和噪声幅度下的 CIFAR-10 数据集样本的损失分布。“kde” 表示损失分布的核密度估计。子图 (b) $r=0.5$,$r=0.6$ 和 (c) $r=0.5$, $r=0.6$,对角占优条件不满足。}
label{fig:loss_distribution}
end{figure}
原文地址:https://www.cnblogs.com/Gelthin2017/p/14051876.html