我正在格式化我的课堂笔记,并使用\tcolorboxenvironment
fromtcolorbox
包中的proof
fromamsmath
为我的校样设置了新的格式。这是代码
\documentclass[12pt, a4paper, report]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\tcbuselibrary{breakable}
\tcolorboxenvironment{proof}{% 'proof' from 'amsthm'
blanker,breakable,left=5mm,
before skip=10pt,after skip=10pt,
borderline west={1mm}{0pt}{red}
}
\begin{document}
\begin{proof}
$ $\newline
This is a proof.
\end{proof}
\end{document}
它按预期进行编译,构建了以下内容
然而,后来我使用了该extract
软件包,虽然代码没有出现任何警告或错误,编译也同样顺利,但tcolorbox
格式从我的原始文件中消失了,证明又回到了通常的证明样式格式,但在软件包创建的amsmath
新文件中运行良好。所以我的原始代码停止了它所做的工作,但副本运行良好。proofs
extract
在这种情况下为什么不一起extract
合作呢?tcolorbox
这是之前的代码,添加了extract
包
\documentclass[12pt, a4paper, report, oneside, reqno]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\tcbuselibrary{breakable}
\tcolorboxenvironment{proof}{% 'proof' from 'amsthm'
blanker,breakable,left=5mm,
before skip=10pt,after skip=10pt,
borderline west={1mm}{0pt}{red}
}
\usepackage[active, copydocumentclass=true, generate=proofs, extract-env={proof}]{extract}
\begin{extract}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\tcbuselibrary{breakable}
\tcolorboxenvironment{proof}{% 'proof' from 'amsthm'
blanker,breakable,left=5mm,
before skip=10pt,after skip=10pt,
borderline west={1mm}{0pt}{red}
}
\end{extract}
\begin{document}
\begin{proof}
$ $\newline
This is a proof.
\end{proof}
\end{document}
这是最后一次构建的打印件
答案1
简单的解决方法:将tcolorbox
东西移到后面extract
。
\documentclass[12pt, a4paper, report, oneside, reqno]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[active, copydocumentclass=true, generate=proofs, extract-env={proof}]{extract}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\tcbuselibrary{breakable}
\tcolorboxenvironment{proof}{% 'proof' from 'amsthm'
blanker,breakable,left=5mm,
before skip=10pt,after skip=10pt,
borderline west={1mm}{0pt}{red}
}
\begin{extract}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\tcbuselibrary{breakable}
\tcolorboxenvironment{proof}{% 'proof' from 'amsthm'
blanker,breakable,left=5mm,
before skip=10pt,after skip=10pt,
borderline west={1mm}{0pt}{red}
}
\end{extract}
\begin{document}
\begin{proof}
$ $\newline
This is a proof.
\end{proof}
\end{document}