首页 > 其他分享 >latex个人学习笔记

latex个人学习笔记

时间:2022-10-14 15:36:53浏览次数:70  
标签:latex begin end usepackage 笔记 学习 tabular hline table


别人的博客

各种width各种空格

符号

​希腊字母​​​​Latex常用数学符号输入方法​

名字

符号

代码

备注

自然连接

\bowtie

​latex如何输入自然连接 ⋈​

并且

\wedge

或者

\vee


\cup

Latex——交集、并集


\cap

Latex——交集、并集

包含于

\subseteq

技巧

  1. 在enumerate中的item后换行用\par,这样与正文之间会有一条缝隙。
  2. latex个人学习笔记_javascript_07

  3. 如果使用​​\\​​换行则标题与正文之间没有缝隙,很难看
  4. latex个人学习笔记_ico_08

公式中插入中文

\text{中文}

左引号

左单引号(键盘上1左边那个)

`

左双引号(按两下键盘上1左边的按键)

``

把下标放到正下方

使用underset

这种方法可用于任何符号

\underset{theta}{\bowtie}

效果

感谢RMan大佬告知。

使用limits

参考:​​https://zhidao.baidu.com/question/873705252499505652.html​​ 仅限于放到数学运算符下方

\sum\limits_{i=1}

效果:

若是普通符号,那么要用\mathop先转成数学运算符再用\limits

\mathop{\bowtie}\limits_{theta}

效果:

插入图片

单张图片

参考:
​​​https://zhidao.baidu.com/question/556236943.html​​​​https://www.jianshu.com/p/5f342de813d9​

\usepackage{graphicx}
\begin{figure}
\center\includegraphics[width=\textwidth]{img/condition.png}
\caption{标题}
\end{figure}

其中​​\center​​​表示图片位置居中,​​width=\textwidth​​​表示宽度与页面等宽,​​img/condition.png​​​是图片文件的相对位置。
如果不想让图片乱动,可以加​​​[H]​​选项

\begin{figure}[H]

但是前面要

\usepackage{float}

嵌套图片

\begin{figure}[H]
\begin{center}
\subfigure{
\includegraphics[width=0.98\textwidth]{img/国债1.png}
}
\subfigure{
\includegraphics[width=0.98\textwidth]{img/国债2.png}
}
\end{center}
\end{figure}

latex个人学习笔记_缩进_12


两张图片就被放在一起了。如果用单张图片的方式则会使得两张图片之间的间隔很大。

绕排

​https://www.zhihu.com/question/26837705​​​​wrapfigure指定行数​

枚举

编号

使用enumerate。可以自定义enumerate的编号样式。
自定义编号样式时要用到的包:

\usepackage{enumerate}

它的使用非常直观。例如要实现这样的编号样式

1)
2)

就这样

\begin{enumerate}[1)]

如果要

(a)
(b)

\begin{enumerate}[(a)]

或者这样

1、
2、
3、
\begin{enumerate}[1、]

小圆点

\begin{itemize}
\item aaaa \par
bbb
\item ccc \par
\item ddddd
\end{itemize}

latex个人学习笔记_ico_13

插入表格

基本表格

\begin{tabular}{|c|c|c|c|c|}
\hline
& A & B & C & D \\
\hline
$P_0$ & 0 & 1 & 0 & 0 \\
\hline
$P_1$ & 0 & 4 & 2 & 1 \\
\hline
$P_2$ & 1 & 0 & 0 & 1 \\
\hline
$P_3$ & 0 & 0 & 2 & 0 \\
\hline
$P_4$ & 0 & 6 & 4 & 2 \\
\hline
\end{tabular}
  • ​|c|​​: 居中并且单元格两侧添加竖线。(Centering)
  • hline: 水平线(Horizontal LINE)

效果

latex个人学习笔记_Latex_14

合并单元格

\usepackage{multirow}
\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2}*{进程} %纵向合并2行单元格
&
\multicolumn{4}{|c|}{Work} \\
\cline{2-5} %为2到5列添加横线
& A & B & C & D \\
\hline
& 1 & 5 & 2 & 0 \\
\hline
$P_0$ & 1 & 6 & 3 & 0 \\
\hline
$P_3$ & 1 & 12 & 6 & 2 \\
\hline
$P_1$ & 2 & 14 & 9 & 3 \\
\hline
$P_2$ & 3 & 17 & 15 & 8 \\
\hline
$P_4$ & 3 & 17 & 16 & 12 \\
\hline
\end{tabular}

居中

  • 使用center环境
\begin{center}
\begin{tabular}{|c|c|c|c|c|}
........
\end{tabular}
\end{center}
  • 使用table环境,设置\center属性
\begin{table}
\centering
\begin{tabular}{|c|c|c|c|c|}
...........
\end{tabular}
\end{table}

如果不想让它乱跑可以用​​\begin{table}[H]​​​,但是要加上​​\usepackage{float}​

设置标题

用​​\caption{标题}​

放在表上方

\begin{table}
\centering
\caption{23333}
\begin{tabular}{|c|c|c|}
\hline
A & B & C \\
\hline
D & 1 & 2 \\
\hline
E & 3 & 4 \\
\hline
\end{tabular}
\end{table}

latex个人学习笔记_缩进_16

放到表下面

把​​\caption{标题}​​​放到​​\end{table}​​前面

\begin{table}
\centering
\begin{tabular}{|c|c|c|}
\hline
A & B & C \\
\hline
D & 1 & 2 \\
\hline
E & 3 & 4 \\
\hline
\end{tabular}
\caption{23333}
\end{table}

latex个人学习笔记_javascript_17

不自动给标题编号

参考:​​https://zhidao.baidu.com/question/616239100442857532.html​​ 直接把标题作为表的一行就好了。

\begin{tabular}{|c|c|c|}
\multicolumn{3}{c}{23333}\\
\hline
A & B & C \\
\hline
D & 1 & 2 \\
\hline
E & 3 & 4 \\
\hline
\end{tabular}

latex个人学习笔记_javascript_18

去掉左边的缩进

默认情况下,tabular左边可能会有缩进,如图

latex个人学习笔记_ico_19


如果不想要这个缩进,将tabular包裹在一个​​table​​环境中即可。

\begin{enumerate}
\item 有缩进!\par
\begin{tabular}{|c|c|c|}
\multicolumn{3}{c}{23333}\\
\hline
A & B & C \\
\hline
D & 1 & 2 \\
\hline
E & 3 & 4 \\
\hline
\end{tabular}
\item 没缩进了!\par
\begin{table}[H]
\begin{tabular}{|c|c|c|}
\multicolumn{3}{c}{23333}\\
\hline
A & B & C \\
\hline
D & 1 & 2 \\
\hline
E & 3 & 4 \\
\hline
\end{tabular}
\end{table}
\end{enumerate}

latex个人学习笔记_ico_20

设置页边距

\usepackage{geometry}
\geometry{top=1.5cm,bottom=1.5cm, left=1.5cm, right=1.5cm}

插入公式

\usepackage{amsmath}

等式

​equation*​​​中的​​*​​表示不要编号。

\begin{equation*}
10 + \frac{20}{(1+y)^{\frac{5}{12}}} - \frac{20}{(1+y)^\frac{9}{12}} = 0
\end{equation*}

latex个人学习笔记_Latex_21

公式集

\usepackage{amsmath}
\begin{gather*}
Co2Low1(lightIntensity, temperature) \\
Co2Low2(lightIntensity, temperature)
\end{gather*}

latex个人学习笔记_缩进_22

标签

用​​\label​​​创建标签,用​​\ref​​引用标签

\begin{equation}\label{t1}
10 - \frac{20}{(1+y)^{\frac{5}{12}}} = 0
\end{equation}

代入(\ref{t1})中,得

latex个人学习笔记_javascript_23


latex个人学习笔记_javascript_24


插入代码

\usepackage{listings}
\usepackage{xcolor}
\usepackage{fontspec}
\usepackage{inconsolata}
\fontspec{inconsolata}
\setmonofont[StylisticSet=1]{inconsolata} %1 or 3??? 让0中间有一个斜线,让l不像1。

在​​\maketitle​​后面设定默认的代码样式。下面是适合黑白打印的设定:

\lstset{ %  
backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
basicstyle=\ttfamily, %ttfamily is consolas
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
breaklines=true, % sets automatic line breaking
deletekeywords={...}, % if you want to delete keywords from the given language
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
morekeywords={*,...}, % if you want to add more keywords to the set
numbers=left, % where to put the line-numbers; possible values are (none, left, right)
numbersep=5pt, % how far the line-numbers are from the code
numberstyle=\ttfamily,
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false, % underline spaces within strings only
showtabs=false, % show tabs within strings adding particular underscores
stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered
tabsize=4, % sets default tabsize to 2 spaces
columns=fullflexible,
}

直接插入代码

\begin{lstlisting}[numbers=none]
mpirun -n 20 ./xhpl
\end{lstlisting}

latex个人学习笔记_ico_25

注意代码块里的空格和tab都会如实显示出来。

从文本中读取代码

\lstinputlisting{hello.c}

latex个人学习笔记_ico_26


标签:latex,begin,end,usepackage,笔记,学习,tabular,hline,table
From: https://blog.51cto.com/seekstar/5757007

相关文章

  • Mybatis-plus学习
    Mybatis-plus学习自动填充功能实体类字段添加注解packagecom.hw.mpstart.entity;importcom.baomidou.mybatisplus.annotation.*;importjava.io.Serializable;......
  • 前端学习网址推荐
    HTMLW3CSchool:​​https://www.w3school.com.cn/html/index.asp​​CSSCSSTricks:​​https://css-tricks.com/​​​张鑫旭博客:​​https://www.zhangxinxu.com/wordpres......
  • 撬开多线程的大门——学习多线程必须掌握的基本概念
    1.进程进程的概念从字义上理解相对还是比较抽象的,但进程实际上对我们并不陌生,可以说它无时不刻的伴随着我们的生活。当你每天上班打开电脑,运行微信与好友通讯、运行浏览......
  • 深度学习算法工程师内心感悟
    某网友:数据放在第一位,成也数据,败也数据。深刻认识数据的重要性,把数据集维护好,数据量够了,再谈后面的模型优化,数据都不干净,用再好的模型,也不会出好的结果。启动开发前,多问......
  • SQL笔记
    日期转换函数参考:https://blog.csdn.net/qq_45515347/article/details/126457842参考:https://www.w3school.com.cn/sql/sql_create_table.asp......
  • 2022-2023-1 20221312 《计算机基础与程序设计》第七周学习总结
    ------------恢复内容开始------------作业信息班级链接:https://edu.cnblogs.com/campus/besti/2022-2023-1-CFAP作业要求:https://www.cnblogs.com/rocedu/p/9577842.htm......
  • Java学习之路:流程控制
    2022-10-1110:58:41......
  • Fabric 源码学习:如何实现批量管理远程服务器?
    前不久,我写了一篇《​​Fabric教程​​》,简单来说,它是一个用Python开发的轻量级的远程系统管理工具,在远程登录服务器、执行Shell命令、批量管理服务器、远程部署等场景......
  • [学习笔记]参数服务器
    好家伙今天翻博客发现了之前的参数服务器相关的东西没有发布,今天发出来吧~~~~~~~~~~~~~~~~参数服务器,顾名思义就是参数的服务器[doge]咳咳参数服务器在ROS中主要用于实现不同节点之间的......
  • java学习记录1
    关于头文件:(pta)importjava.util.*(导入包)publicclassMain{publicstaticvoidmain(String[]args){}}输入:Scannerin(可以是任意字母)=newScanner(Syst......