LaTeX学习笔记(持续更新中.....)

基本思想:将内容与格式分离,在导言区统一设置格式,在文稿区编辑内容

主要内容:

1、基本操作

2、如何显示中文

3、字体属性

4、文章结构

一、一些基本操作

单$f(x)=3x^2+2$表示行内公式,双$$f(x)=3x^2+2$$表示行间公式。

\\可以空一行但是不产生缩进

\par  产生新段落

扫描二维码关注公众号,回复: 10818437 查看本文章

插入空的一行也可以产生新段落

\newpage 换页

\date{}   大括号里面填写想要的日期,如果不想显示日期,就空着。

equation环境用于产生代编号的行间公式:

\begin{equation}

a^2=b^2+c^2

\end{equation}

用cmd命令打开texdoc ctex可以打开ctex宏包文档

texdoc lshort-zh   打开中文latex教程

\ctexset 更改ctex宏包的一些设置,详情查看ctex宏包手册

\tableofcontents   产生目录

\usepackage{hyperref}   目录生成超链接 注意要编译两次,第二次超链接才会生效

二、显示中文

编辑器UTF-8   使用ctex宏包即可。或者直接\documentclass{ctexart}

三、字体属性

字体编码

字体族(罗马字体,无衬线字体,打字机字体)

罗马\textrm{Roman Family}             或者    \rmfamily Roman Family

无衬线\textsf{Sans Serif Family}      或者    \sffamily Sans Serif Family

打字机\texttt{Typewriter Family}       或者    \ttfamily Typewriter Family

字体系列  粗细、宽度

\textmd{Medium Series}   或者    \mdseries Medium Series

\textbf{Boldface Series}    或者    \bfseries Boldface Series

字体形状  直立 斜体 伪斜体 小型大写

\textup{内容}     或者   \upshape 内容

\textit{内容}       或者   \itshape 内容

\textsl{内容}      或者   \slshape 内容

textsc{内容}      或者   \scshape 内容

字体大小

相对于normalsize而言,normalsize是由文档类的参数控制的例如

\documentclass[10pt]{article}

\documentclass[11pt]{article}

\documentclass[12pt]{article}

只能取10、11、12磅

由小到大

\tiny

\scriptsize

\footnotesize

\small

\normalsize

\large

\Large

\LARGE

\huge

\Huge

中文字体

\songti 宋体     \heiti  黑体     \fangsong  仿宋      \kaishu楷书

中文的粗体\textbf{内容}    斜体\textit{内容}

中文字体大小

\zihao{参数}

参数具体取值查看ctex宏包文件

四、文章结构

section 小节  subsection 子小节  subsubsection 子子小节

\section{引言}

\section{实验方法}

\section{实验结果}

  \subsection{数据}

     \subsubsection{实验条件}

  \subsection{图表}

  \subsection{结果分析}

\section{结论}

\section{致谢}

五、特殊字符

1、空白字符

\quad  产生一个1em的空格,即当前字体中M的宽度

\qquad 产生一个2em的空格。

\thinspace 产生1/6个em

\enspace 产生一个0.5em

\    反斜杠加空格

~ 硬空格  不可分割的空格

1pc=12pt=4.218mm

\kern 1pc 

\kern -1em

\hskip 1em

\hspace{35pt}

2、控制字符

前面要加反斜杠     

要输出反斜杠   用\textbackslash

3、latex标志符号

\TeX     \LaTeX    \LaTeXe

4、引号

~  左单引号

' 右单引号

~~ 左双引号

'' 右双引号

5、连字符

-短 --中 ---长  

六、插图

导言区:

\usepackage{graphicx}

\graphicspath{{figures/},{pics/}} 图片保存路径,可以同时添加多个路径

支持格式:eps、pdf、png、jpeg、bmp

文稿区:

\includegraphics[width=1cm,height=1cm,scale=0.1,angle=45]{文件名} 

宽度  高度  放大缩小比例   旋转角度 

七、表格

\begin{tabular}{l  |  c   |   r}%l左对齐c居中对齐r右对齐,本例形成了三列的表格   “|”产生表格竖线   “||”产生双竖线

可以用p{1.5cm}产生宽度为1.5cm的一列

用&表示不同的列

\hline  产生表格横线

\hline\hline 产生双横线

姓名&性别&年龄\\

\end{tabular}

texdoc booktab   三线表

texdoc longtab   跨页长表格

texdoc tabu 综合表格

八、浮动体

\begin{figure}[htbp]

图片浮动体环境

\centering   让环境中的内容居中排版

\caption 设置标题

\end{figure}\label{}为浮动体设置标签   在正文中用\ref引用这个标签

\begin{table}

表格浮动体环境

\begin{table}

九、数学公式

\begin{document}
    \section{行内公式}
        \subsection{美元符号}
         $a+b=c$
        \subsection{小括号}
           \(a+b=c\) 
        \subsection{math环境}
           \begin{math}
            a+b=c
           \end{math}
    \section{上下标}
        \subsection{上标}
         使用^符号    $3x^2$    $3x^{20}$
        \subsection{下标}
         使用_符号    $a_0,a_1,a_2,...,a_{100}$
    \section{希腊字母}
     小写
     $\alpha$
     $\beta$
     $\gamma$
     $\epsilon$
     $\pi$
     $\omega$
     
     大写
     $\Delta$
     $\Theta$
     $\Gamma$
     $\Pi$
     $\Omega$
    \section{数学函数}
     $\log$
     $\sin$
     $\cos$
     $\arcsin$
     $\arccos$
     $\ln$

     根号$\sqrt$ 

    \section{分式}
     $3/4$或者    $\frac{3}{4}$
    \section{行间公式}
      \subsection{美元符号}
       $$a+b=c$$
      \subsection{中括号}
          \[a+b=c\]
      \subsection{displaymath环境}
        \begin{displaymath}
          a+b=c
        \end{displaymath}
      \subsection{自动编号公式equation环境}
        \begin{equation}
         a+b=c  \label{g1}
        \end{equation}
        我们使用公式\frc{g1}
      \subsection{不编号公式equation*环境}

        需要使用amsmath宏包
        \usepackage{amsmath}        

        \begin{equation*}
        a+b=c /label{g2}
        \end{equation*}
\end{document}


    

\begin{document}
    \section{行内公式}
        \subsection{美元符号}
         $a+b=c$
        \subsection{小括号}
           \(a+b=c\) 
        \subsection{math环境}
           \begin{math}
            a+b=c
           \end{math}
    \section{上下标}
        \subsection{上标}
         使用^符号    $3x^2$    $3x^{20}$
        \subsection{下标}
         使用_符号    $a_0,a_1,a_2,...,a_{100}$
    \section{希腊字母}
     小写
     $\alpha$
     $\beta$
     $\gamma$
     $\epsilon$
     $\pi$
     $\omega$
     
     大写
     $\Delta$
     $\Theta$
     $\Gamma$
     $\Pi$
     $\Omega$
    \section{数学函数}
     $\log$
     $\sin$
     $\cos$
     $\arcsin$
     $\arccos$
     $\ln$

     根号$\sqrt$ 

    \section{分式}
     $3/4$或者    $\frac{3}{4}$
    \section{行间公式}
      \subsection{美元符号}
       $$a+b=c$$
      \subsection{中括号}
          \[a+b=c\]
      \subsection{displaymath环境}
        \begin{displaymath}
          a+b=c
        \end{displaymath}
      \subsection{自动编号公式equation环境}
        \begin{equation}
         a+b=c  \label{g1}
        \end{equation}
        我们使用公式\frc{g1}
      \subsection{不编号公式equation*环境}

        需要使用amsmath宏包
        \usepackage{amsmath}        

        \begin{equation*}
        a+b=c /label{g2}
        \end{equation*}
\end{document}

十一、数学公式的矩阵

发布了23 篇原创文章 · 获赞 6 · 访问量 1332

猜你喜欢

转载自blog.csdn.net/weixin_42194139/article/details/84327919