将一些等式数字加粗

将一些等式数字加粗

我想制作一些方程式数字(将定义特别指定大胆的,而其他则不然。我只能想办法让所有大胆的或者不加粗,这不是我想要的。

\documentclass[leqno]{book}
\usepackage{amsmath,amssymb,amsthm, amscd}
\usepackage[a4paper, textwidth=39cm, margin=1.2in, vmargin=3cm, marginparsep=20pt, marginparwidth=.6in,]{geometry} 
\usepackage{fancyhdr}
%\renewcommand\theequation{\bfseries\thesection.\arabic{equation}}
\begin{document}

\begin{equation}
x-y=z
\end{equation}

\begin{equation}
a+b=c
\end{equation}

\end{document}

答案1

据我所知,唯一的办法就是每次想要这样做时都关闭和打开粗体。最干净的解决方案是定义一个新版本,equation自动将公式编号加粗:

\documentclass{article}
\begin{document}

\renewcommand\theequation{\thesection.\arabic{equation}}
\newenvironment{boldequation}{\renewcommand\theequation{\textbf{\thesection.\arabic{equation}}}\equation}
   {\endequation}

\begin{boldequation} 1+1=2 \end{boldequation}

\begin{equation} 1+1=2 \end{equation}

\end{document}

这使:

在此处输入图片描述

或者,一种更粗鲁的方法是使用“开关”,例如:

\documentclass{article}
\begin{document}

\newcommand\boldequations{\renewcommand\theequation{\textbf{\thesection.\arabic{equation}}}}
\newcommand\normalequations{\renewcommand\theequation{\thesection.\arabic{equation}}}

\boldequations
\begin{equation} 1+1=2 \end{equation}

\normalequations
\begin{equation} 1+1=2 \end{equation}

\end{document}

输出是一样的。

答案2

让我详细说明一下我的评论:该mathtools包定义了\(re)newtagform有助于定义标签“样式”的命令。然后\usetagform{name}是一个在数学环境之外使用的开关。您可以使用 恢复到通常的样式\usetagform{default}

此外,我定义了一个命令,允许更改one多行方程组的方程的标记样式,以便强调该特定方程。此命令的定义不是通用的,因为\usetagstyle在此上下文中不起作用,因此如果您想更改样式,则必须更改其定义。

以下是一个例子:

\documentclass[12pt,a5paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{xcolor}

\newtagform{coloured}[\bfseries]{\color{red}(}{\mdseries)}
\newcommand\boldtag{\refstepcounter{equation}\tag*{(\textbf{\color{red}\theequation})}}

\begin{document}

\usetagform{coloured}
\begin{align}
 a & = b + c \\
 a^2 & = b^2 + c^2
\end{align}

\usetagform{default}

\begin{align}
 a & = b + c \\
 a^2 & = b^2 + c^2 \boldtag \\
 a^3 & =b^3 + c^3
\end{align}

\end{document} 

在此处输入图片描述

相关内容