在正文前面加入下面的宏包就可以了
\usepackage{showlabels}amsmath:一般数学符号的宏包; amssymb:特殊字体的数学字符宏包; amsthm:提供数学的定理环境等
主要代码:
\rule[升高距离]{宽度}{高度}举例:
\noindent\rule[0.25\baselineskip]{\textwidth}{1pt}其中,\baselineskip是指行间距。
对于英文来说: 在导言区中使用
\usepackage{ulem} \normalem然后在正文中使用
\sout{XXX}对于中文来说使用宏包`usepackage{CJKulem}`
\sout{想加删除线的中文}\mathrm{R} R \mathrm{R} R \newcommand\diff{\,\mathrm{d}} d \mathrm{d} d \mathbb{R} R \mathbb{R} R \mathbf{R} R \mathbf{R} R \mathbf{x} x \mathbf{x} x \boldsymbol{x} x \boldsymbol{x} x \mathcal{R} R \mathcal{R} R \usepackage{bm} \bm{R} R \bm{R} R
使用pifont宏包,那里面有很漂亮的带圈的各种数字符号(仅限于阿拉伯数字, 如果想使用加圈的中文“一”至“九”就不行了)。在.tex 文件中尝试下列命令 :\ding{172}~\ding{211}。
\underrightarrow{contents} c o n t e n t s → \underrightarrow{contents} contents A\stackrel{\underleftrightarrow{contents}}{ }B A c o n t e n t s ↔ B A\stackrel{\underleftrightarrow{contents}}{ }B A contentsB A\stackrel{\underrightarrow{contents}}{ }B A c o n t e n t s → B A\stackrel{\underrightarrow{contents}}{ }B A contentsB A\stackrel{\underleftarrow{contents}}{ }B A c o n t e n t s ← B A\stackrel{\underleftarrow{contents}}{ }B A contentsB \rightarrow → \rightarrow → \longrightarrow ⟶ \longrightarrow ⟶ \Longrightarrow ⟹ \Longrightarrow ⟹ 后来看了amsmath宏包的说明文档发现可以这样: \xleftarrow[under]{above} ← u n d e r a b o v e \xleftarrow[under]{above} above under
\xleftarrow[under]{above} → u n d e r a b o v e \xrightarrow[under]{above} above under
(amsmath) \xleftarrow: (amsmath) \xrightarrow: (amsmath) \xleftarrow: (amsmath) \xrightarrow:\usepackage{extarrows}中还包含下面的命令:
\xLongleftarrow: \xLongrightarrow: \xLongleftrightarrow: \xLeftrightarrow: \xlongleftrightarrow: \xlongrightarrow: \xleftrightarrow: \xlongleftarrow: \xlongleftarrow: \xlongrightarrow:如果在align环境中使用cases公式只会有个编号,也就是当作一个公式看待,而使用numcases是把公式当作多个看待。
\usepackage{breqn}%用于可以自动换行的数学公式环境
\renewcommand{\abstractname}{摘\quad 要} \renewcommand{\contentsname}{目\hspace{2em}录} \renewcommand{\figurename}{图} \renewcommand{\tablename}{表} \renewcommand{\partname}{部分} \renewcommand{\listfigurename}{\bfseries 插图目录} \renewcommand{\listtablename}{\bfseries 表格目录} \renewcommand{\refname}{\bfseries 参考文献} \renewcommand{\appendixname}{\bfseries 附\hspace{2em}录} \renewcommand{\indexname}{\bfseries 索\hspace{2em}引}
利用empheq宏包
\begin{empheq}[box=\fbox]{align*} (1-x)^{-n}&=\sums^\infty_{k=0}\left( \begin{array}{c} -n \\ k \\ \end{array} \right)(-x)^k\\ &=\sums^\infty_{k=0}(-n)(-n-1)\cdots(-n-k+1)(-x)^k\\ &=\sums^\infty_{k=0}n(n+1)\cdots(n+k-1)x^k\\ &=\sums^\infty_{k=0}\left( \begin{array}{c} n+k-1 \\ k \\ \end{array} \right)x^k\\ &\text{\hspace{-1.5cm}与二项展开相比,它实现的是“分母”的增加} \end{empheq}效果:
例如引用test.tex文件中的label, 只需在头文件中加入
\usepackage{xr} \externaldocument{test}首先,需要在文件头中写入下面代码
\usepackage{listings} \lstset{language=R}%代码语言使用的是R \lstset{ numbers=left, numberstyle= \tiny, keywordstyle= \color{ blue!70}, commentstyle= \color{red!50!green!50!blue!50}, frame=shadowbox, % 阴影效果 rulesepcolor= \color{ red!20!green!20!blue!20} , escapeinside=``, % 英文分号中可写入中文 xleftmargin=2em,xrightmargin=2em, aboveskip=1em, framexleftmargin=2em } \lstset{breaklines}%自动将长的代码行换行排版 \lstset{extendedchars=false}%解决代码跨页时,章节标题,页眉等汉字不显示的问题其次,正文中按下面的方法写入代码
{\footnotesize%实际字体的调整 \begin{lstlisting} fit=lm(x~y) a=a+b \end{lstlisting} }只需在文件头中写入
\allowdisplaybreaks可以使用命令{\color{red}公式 }实现
\documentclass{article} \usepackage{amsfonts,color} \begin{document} \begin{align} {\color{red}a}+b=c \end{align} \end{document}效果如下:
需要使用宏包ntheorem, 但是它会和amsthm冲突
\usepackage{ntheorem} \theoremstyle{break}以上这些命令可以让局部文本放大,但是不能让局部公式放大,但是\scalebox{2}{$a$}可以实现公式的局部放大。使用实例:
\begin{equation} \scalebox{2}{$a$}+b=c \end{equation}
利用\textcolor{red}{text}或者\color{red}就可以实现,实例如下:
\begin{align} a+b&=\textcolor{red}{m}+s-f\\ h-l&={\color{green}m}+g-j \end{align}subcaption 宏包 还同时提供了 subfigure 和 subtable 环境,它们的语法和功能与 minipage 完全相同,只是在里面可以直接使用 \caption 命令来表示子标题。 效果:
效果:
另外一种方法可以参考: https://blog.csdn.net/a6822342/article/details/80533135
\renewcommand{\thefigure}{R.\arabic{figure}}