您当前的位置: 首页 >  高精度计算机视觉

latex的一些常用格式(参考)

高精度计算机视觉 发布时间:2018-10-13 17:47:08 ,浏览量:4

特别常用的在最后!!!

大家在网上找latex语法,往往是找次常用的,就是要用,但latex面板上不知道在哪。
所以最占篇幅的那些容易找到的最常用的,放到了本文最后面。
这里只涉及latex公式,如果是关于WinEdt的排版,建议参考后面的链接,
 

如果要使用ctex写科技论文,下载地址在这里:
http://www.ctex.org/CTeXDownload/

 

latex文字加粗、斜体

显示直立文本: \textup{what} ==>   
意大利斜体: \textit{what}       ==>  
slanted斜体: \textsl{what}      ==>  
显示小体大写文本:  \textsc{what} ==>  
中等权重: \textmd{what}        ==>  
加粗命令: \textbf{what}          ==>   
默认值: \textnormal{what}      ==>   

字体大小的问题

这个很难界定,有个教程是如下图片这么说的,但我用起来没什么效果(也不知道是否用法哪里不对)
参考,https://www.latex-tutorial.com/symbols/text-formatting/

空格

两个quad空格    a \qquad b  ==>      两个m的宽度
quad空格    a \quad b           ==>     一个m的宽度
大空格    a\ b      ==>          1/3m宽度
中等空格    a\;b  ==>          2/7m宽度
小空格    a\,b      ==>        1/6m宽度
紧贴    a\!b          ==>       

换行

使用\\ 表示换行
大公式换行如下

\begin{equation}
\begin{aligned}
\textbf{f}(\textbf{x}+\textbf{e}) &= 
\frac{1}{2}
(\textbf{x}+\textbf{e})^T\textbf{A}(\textbf{x}+\textbf{e})
-\textbf{b}(\textbf{x}+\textbf{e})
+\textbf{c} \\&= \frac{1}{2}
\textbf{x}^T\textbf{A}\textbf{x}
-\textbf{b}\textbf{x}
+\textbf{c}
-\textbf{e}^T \textbf{b}
+ \frac{1}{2}  \textbf{e}^T\textbf{A}\textbf{e}
-\textbf{b}^T \textbf{e} \\&=\frac{1}{2}
\textbf{x}^T\textbf{A}\textbf{x}
-\textbf{b}\textbf{x}
+\textbf{c}
+ \frac{1}{2}  \textbf{e}^T\textbf{A}\textbf{e}
\end{aligned}
\qquad \label{1}
\end{equation}

效果(注意CSDN不严格支持latex,所以网页上可能显示不出来 :-(  

公式中的大括号

C=
\left\{
\begin{array}{lr}
\frac{1}{2} \quad (x=0)  \\
\\
1 \quad (x \ne 0)
\end{array}
\right

对齐方式

以等号对齐

\begin{align*}
  1 + 2&=3-1+1-1+1\\
  1*2*3*4/a*b*c*d &=3 - 2
\end{align*}

\begin{align*}
  f(x) &= x^2\\
  g(x) &= \frac{1}{x}\\
  F(x) &= \int^a_b \frac{1}{3}x^3
\end{align*}

左对和右对齐(array后面{lr}或{l}或{lf}为左对齐,{rl}或{r}或{rf}为右对齐)

奇怪的是,新版的latex支持只取左边一个大括号,但旧版的不行,CSDN目前还不支持只取左边半个的情况 ,所以我写了两个
'-_-'     '-_-'

\left\{ \begin{array}{lr} 
\frac{1}{\sqrt{2\pi}} \\\\ 
\sigma=\frac{1}{2\pi}+\frac{1}{2\pi} +\frac{1}{2\pi} \\\\
x=ky 
\end{array} \right\}


\left\{ \begin{array}{lr} 
\frac{1}{\sqrt{2\pi}} \\\\ 
\sigma=\frac{1}{2\pi}+\frac{1}{2\pi} +\frac{1}{2\pi} \\\\ 
x=ky 
\end{array} \right\}

                 

变换等字体符号(如傅立叶变换)

这个其实就是个字体的问题,比较简单,建议参考wiki的资料[2],
比如我们常用的傅立叶变换符号是\mathcal{F}, 效果就是 。

最常用的

太多了,直接上图片吧!

 

Latex排版(俺用的WinEdt):

 

 

Latex排版报错

No.1: LaTeX Error: Can be used only in preamble.  引用包放错了位置。一般的usepackage {...} 语句应该放在形头,例如下面的位置就是对的,

\documentclass[a4paper,11pt]{article}
\usepackage{url}
\begin{document}
blablabla...
\end{document}

 

参考教程:
[1] https://www.latex-tutorial.com/tutorials/
[2] https://en.wikibooks.org/wiki/LaTeX/Mathematics
[3] https://www.cnblogs.com/jingwhale/p/4250296.html (Latex排版)
[4] https://blog.csdn.net/mr_cat123/article/details/80215341

 

 

 

关注
打赏
查看更多评论
  • 4浏览

    0关注

    464博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录