常用
Latex
底色
- 字体底色
\colorbox{yellow}{Thistext}
只适用于短句,大段文字加底色无法自动换行。
- 段落底色
\usepackage{color}
%\definecolor{shadecolor}{named}{Gray}
\definecolor{shadecolor}{rgb}{0.92,0.92,0.92}
\usepackage{framed}
\begin{shaded}
NOTE: the solutions and objectives two model are the same.
While, the results by python code are different.
The result of model 1 is better, so we use it to code.
But, we use the model 2 for writing manuscript.
\end{shaded}
- 公式底色
\colorbox{$\displaystyle + 公式$}
\colorbox{yellow}{\begin{equation*} ... \end{equation*}}
e.g.
\colorbox{yellow}{$\displaystyle x^2+y^3$}
\colorbox{yellow}{\begin{equation*}x^2+y^3\end{equation*}}
只适用于行内公式or单行公式。用于行内公式时,只有公式部分加底色;用于单行公式时,整行被加底色。
- 多行公式底色
和minipage配合使用,给整个页面加底色
\definecolor{mygray}{rgb}{0.92,0.92,0.92} % 定义颜色
\colorbox{mygray}{
\begin{minipage}{\textwidth} %调节minipage的宽度占比
%------------------------------------
\begin{align}
...
\end{align}
%------------------------------------
\end{minipage}
}
- 调整颜色
设置 颜色!百分比,比如red!20
,这是20%的红色加80%的白色混合出来的颜色,
也可以用多种颜色来混合,比如:red!20!blue!30
是20%的红色+30%的蓝色+50%的白色。
\colorbox{red!20!blue!30}{text}
\colorbox{mygray!20}{text}
公式
- 公式中的连字符 ‘-’
- 证明末尾的终止符黑方块
$\hfill\blacksquare$