美文网首页
latex 随手记

latex 随手记

作者: 菌子甚毒 | 来源:发表于2022-02-22 09:37 被阅读0次
  1. 空一整行
    \\ \hspace*{\fill} \\
    ~\\
  2. footnote in frame
    \footnote[frame,footnote的mark]{内容}
  3. 罗马数字
    大写的二:\uppercase\expandafter{\romannumeral2}
    小写的二:\romannumeral2
  4. 加粗字体
    \textbf{文本}
  5. 高亮字体,彩色字体
\documentclass{report}
\usepackage{color,soul}
\begin{document}
  \hl{foo}
  \hl{\textbf{foo}} 
  \textcolor{red}{foo}
  \textbf{\textcolor{red}{\hl{foo}}}
  \textcolor{red}{\textbf{\hl{foo}}}
\end{document}

from: https://tex.stackexchange.com/questions/141569/highlight-textcolor-and-boldface-simultaneously

  1. dirtree
\usepackage{dirtree}

\dirtree{%
.1 ...\_P.zip.
.1 340\_P.zip.
.2 ....
.2 340\_COVAREP.csv.
.2 340\_FORMANT.csv.
.2 ....
.1 ...\_P.zip.
}
  1. code
\begin{verbatim}
\end{verbatim}

如果是在frame中,需要打开[fragile]设置
\begin{frame}[fragile]{<frame_name>}

  1. 竖版'...'
    $\vdots$
  2. 伪代码 algorithm2e
    https://shantoroy.com/latex/how-to-write-algorithm-in-latex/
\documentclass{article}
\usepackage{xcolor}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}

\title{Another algorithm template}
\author{Roy}

%%% Coloring the comment as blue
\newcommand\mycommfont[1]{\footnotesize\ttfamily\textcolor{blue}{#1}}
\SetCommentSty{mycommfont}

\SetKwInput{KwInput}{Input}                % Set the Input
\SetKwInput{KwOutput}{Output}              % set the Output


\begin{document}
\maketitle

\begin{algorithm}[!ht]
\DontPrintSemicolon
  
  \KwInput{Your Input}
  \KwOutput{Your output}
  \KwData{Testing set $x$}
  $\sum_{i=1}^{\infty} := 0$ \tcp*{this is a comment}
  \tcc{Now this is an if...else conditional loop}
  \If{Condition 1}
    {
        Do something    \tcp*{this is another comment}
        \If{sub-Condition}
        {Do a lot}
    }
    \ElseIf{Condition 2}
    {
        Do Otherwise \;
        \tcc{Now this is a for loop}
        \For{sequence}    
        { 
            loop instructions
        }
    }
    \Else
    {
        Do the rest
    }
    
    \tcc{Now this is a While loop}
   \While{Condition}
   {
        Do something\;
   }

\caption{Example code}
\end{algorithm}

\end{document}
  1. 箭头向量
    \vec{x}
  2. enumerate改变序号
    \begin{enumerate}[<期望的序号类型>]
  3. 表格
    在conference中插入大表格,用星号:
\begin{table*}
...
\end{table*}

在线编辑:https://www.tablesgenerator.com/latex_tables#

  1. beamer在每一页添加相同的脚注。
    code来源: https://tex.stackexchange.com/questions/26476/add-footer-text-to-all-slides-in-beamer
\documentclass{beamer}

\setbeamertemplate{footline}[text line]{%
  \parbox{\linewidth}{\vspace*{-8pt}需要添加的脚注内容\hfill\insertshortauthor\hfill\insertpagenumber}}
\setbeamertemplate{navigation symbols}{}

\author[JD]{John Doe}

\begin{document}

\begin{frame}
Test
\end{frame}

\end{document}

相关文章

网友评论

      本文标题:latex 随手记

      本文链接:https://www.haomeiwen.com/subject/eutzkrtx.html