去掉MySolution环境中解后面的数字

发布于 2025-05-06 21:19:23

原代码

\documentclass{ctexart}
\usepackage{amsmath}

\usepackage[skins]{tcolorbox}
\newtheorem{Example}{例}
\newtheorem{MySolution}{解}
\tcolorboxenvironment{MySolution}{
    colframe = blue!50!black, % 边框颜色
    colback = blue!10, % 背景颜色
    fonttitle = \bfseries, % 标题字体加粗
    before upper = {\itshape}, % 内容字体为斜体
    title = 解,
    boxrule = 1pt % 边框宽度
}
\begin{document}
\begin{Example}
    证明
    \begin{equation*}
        \int_{0}^{1} \frac{1}{x} \mathrm{d}x = \ln 2.
    \end{equation*}
\end{Example}
\begin{MySolution}
    \begin{equation*}
        \int_{0}^{1} \frac{1}{x} \mathrm{d}x = \int_{0}^{1} \frac{1}{x} \cdot \frac{1}{1    \mathrm{d}x} = \int_{0}^{1} \frac{1}{1} \cdot \frac{1}{x} \mathrm{d}x = \int_{0}^{1} \frac{1}{x} \mathrm{d}x.
    \end{equation*}
    因此
    \begin{equation*}
        \int_{0}^{1} \frac{1}{x} \mathrm{d}x = \ln 2.
    \end{equation*}
\end{MySolution}
\end{document}

如何去掉解字后面的这个序号呢?

image.png

查看更多

关注者
0
被浏览
199
3 个回答
Martin
Martin 3天前
这家伙很懒,什么也没写!
\documentclass{ctexart}
\usepackage{amsthm}
\usepackage{amsmath}

\usepackage[skins]{tcolorbox}
\newtheorem{Example}{例}
\newtheorem*{MySolution}{解}
\tcolorboxenvironment{MySolution}{
    colframe = blue!50!black, % 边框颜色
    colback = blue!10, % 背景颜色
    fonttitle = \bfseries, % 标题字体加粗
    before upper = {\itshape}, % 内容字体为斜体
    title = 解,
    boxrule = 1pt % 边框宽度
}
\begin{document}
    \begin{Example}
        证明
        \begin{equation*}
            \int_{0}^{1} \frac{1}{x} \mathrm{d}x = \ln 2.
        \end{equation*}
    \end{Example}
    \begin{MySolution}
        \begin{equation*}
            \int_{0}^{1} \frac{1}{x} \mathrm{d}x = \int_{0}^{1} \frac{1}{x} \cdot \frac{1}{1    \mathrm{d}x} = \int_{0}^{1} \frac{1}{1} \cdot \frac{1}{x} \mathrm{d}x = \int_{0}^{1} \frac{1}{x} \mathrm{d}x.
        \end{equation*}
        因此
        \begin{equation*}
            \int_{0}^{1} \frac{1}{x} \mathrm{d}x = \ln 2.
        \end{equation*}
    \end{MySolution}
\end{document}
Sagittarius Rover
我要成为Typst糕手/(ㄒoㄒ)/~~

当代码够短时,不要上传文件。实际上长的代码就不应该发上来提问。

您的标签能不能别乱写!!!! 第N+1次了,『解1去掉1』作为tag质量十分低劣!!!

image.png


查看tcolorbox文档...

image.png

所以你的问题等价于,在\newtheorem如何去掉1?

请自行对比和思考下例:

\documentclass{ctexart}
\usepackage{amsmath}
\newtheorem{MySolution}{解}
\begin{document}
\begin{MySolution}
    \begin{equation*}
        \int_{0}^{1} \frac{1}{x} \mathrm{d}x = \int_{0}^{1} \frac{1}{x} \cdot \frac{1}{1    \mathrm{d}x} = \int_{0}^{1} \frac{1}{1} \cdot \frac{1}{x} \mathrm{d}x = \int_{0}^{1} \frac{1}{x} \mathrm{d}x.
    \end{equation*}
\end{MySolution}
为什么会有\texttt{1}呢? 这一问题实际上与\texttt{tcolorbox}毫无关系.
\end{document}

image.png

\documentclass{ctexart}
\usepackage{amsmath}
\usepackage{amsthm}
\newtheorem*{MySolution}{解}
\begin{document}
\begin{MySolution}
    \begin{equation*}
        \int_{0}^{1} \frac{1}{x} \mathrm{d}x = \int_{0}^{1} \frac{1}{x} \cdot \frac{1}{1    \mathrm{d}x} = \int_{0}^{1} \frac{1}{1} \cdot \frac{1}{x} \mathrm{d}x = \int_{0}^{1} \frac{1}{x} \mathrm{d}x.
    \end{equation*}
\end{MySolution}
\end{document}

image.png

荨
3天前
这家伙很懒,什么也没写!

谢谢了

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览