我尝试使用hidealllines
mdframed 的密钥,但它不起作用,无论是作为本地参数还是在 中\mdfsetup
。当我设置所有topline=false
等时,它可以工作,但当我只使用 — 时则不行hidealllines
,而且,hidealllines
似乎撤消如果每行都明确隐藏,则隐藏!
平均能量损失
\documentclass{article}
\usepackage[tikz]{mdframed}
\begin{document}
\mdfsetup{backgroundcolor=blue!10}
% all lines, as expected
\begin{mdframed}
Text.
\end{mdframed}
% all lines (huh?)
\begin{mdframed}[hidealllines]
Text.
\end{mdframed}
% no lines, as expected
\begin{mdframed}[topline=false,rightline=false,bottomline=false,leftline=false]
Text.
\end{mdframed}
% all lines (huh??!)
\begin{mdframed}[topline=false,rightline=false,bottomline=false,leftline=false,hidealllines]
Text.
\end{mdframed}
\end{document}
答案1
虽然文档中没有说明,但您必须明确设置 hidealllines=true
,而不是简单地hidealllines
。 (文档示例确实使用了它,但关键描述只是说“您可以使用简短形式hidealllines
。”)
修正后的 MWE:
\documentclass{article}
\usepackage{xcolor}
\usepackage{mdframed} % works with tikz/pstricks as well
\begin{document}
\mdfsetup{backgroundcolor=blue!10}
\begin{mdframed}[hidealllines]
Lines are not hidden.
\end{mdframed}
\begin{mdframed}[hidealllines=true]
Lines are hidden.
\end{mdframed}
\end{document}