我有下一个文档(在 ltxmdf 类中),它可以完美编译(查看图像)。
我想要放入一个文档书籍类。可以吗?
我已经尝试过了,但出现 4 个错误。我该如何更改标题?
提前致谢。
\documentclass[parskip=false,11pt]{ltxmdf}
\newcommand\Loadedframemethod{default}
\usepackage[framemethod=\Loadedframemethod]{mdframed}
\mdfsetup{skipabove=\topskip,skipbelow=\topskip}
\newrobustcmd\ExampleText{%
An \textit{inhomogeneous linear} differential equation has the form
\begin{align}
L[v ] = f,
\end{align}
where $L$ is a linear differential operator, $v$ is
the dependent variable, and $f$ is a given non-zero
function of the independent variables alone.
}
\begin{document}
\newcounter{theo}[section]
\newenvironment{theo}[1][]{%
\stepcounter{theo}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=blue!20]
{\strut Theorem~\thetheo};}}
}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=blue!20]
{\strut Theorem~\thetheo:~#1};}}%
}%
\mdfsetup{innertopmargin=10pt,linecolor=blue!20,%
linewidth=2pt,topline=true,
frametitleaboveskip=\dimexpr-\ht\strutbox\relax,}
\begin{mdframed}[]\relax%
}{\end{mdframed}}
\begin{theo}[Inhomogeneous Linear]
\ExampleText
\end{theo}
\begin{theo}
\ExampleText
\end{theo}
\end{document}
答案1
只需要对序言进行少量修改:
\documentclass[parskip=false,11pt]{book}
\usepackage[framemethod=tikz]{mdframed}
\mdfsetup{skipabove=\topskip,skipbelow=\topskip}
\usepackage{mathtools}
\newcommand\ExampleText{%
An \textit{inhomogeneous linear} differential equation has the form
\begin{align}
L[v ] = f,
\end{align}
where $L$ is a linear differential operator, $v$ is
the dependent variable, and $f$ is a given non-zero
function of the independent variables alone.
}
代码的其他部分与你的 MWE 中的相同。得到的定理图像也相同。