建议

建议

我刚买了一台新电脑并安装了 mikTeX、emacs 和 auctex。

然后我尝试从 mdframed 文档中编译一个基本示例:

\documentclass{article}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}
\usepackage{pstricks}
\usepackage[framemethod=PSTricks]{mdframed}

\begin{document}

Bla!

\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.
}


\global\mdfdefinestyle{exampledefault}{%
linecolor=red,middlelinewidth=3pt,%
leftmargin=1cm,rightmargin=1cm
}
\begin{mdframed}[style=exampledefault,roundcorner=5]
\ExampleText
\end{mdframed}

\end{document}

我使用 dvips 和 ps2pdf 进行编译:在 auctex 中:命令 -> TeXing 选项 -> DVI 中的 PDF -> dvips + ps2pdf

我在日志文件中多次收到同样的错误:

./[activite]-trajectoire.tex:34: 未定义控制序列。\c@lor@to@ps ->\PSTricks _Not_Configured_For_This_Format l.34 \end{mdframed}

我怀疑配置问题与 mikTeX 有关,但没有发现任何问题。

答案1

您必须使用xelatexlatex后跟。dvipsps2pdf

\documentclass{article}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}
\usepackage{pstricks}
\usepackage[framemethod=PSTricks]{mdframed}

\begin{document}

Bla!

\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.
}


\global\mdfdefinestyle{exampledefault}{%
linecolor=red,middlelinewidth=3pt,%
leftmargin=1cm,rightmargin=1cm
}
\begin{mdframed}[style=exampledefault,roundcorner=5]
\ExampleText
\end{mdframed}

\end{document}

在此处输入图片描述

建议

使用tcolorbox包可能会更好,因为它具有更多功能和相对优秀的文档。

相关内容