有没有办法在 mdframed-box 的正下方写一些内容?
梅威瑟:
\documentclass[a4paper]{article}
\usepackage{mdframed}
\begin{document}
\begin{mdframed}[leftmargin=5mm, rightmargin=5mm]
Text of the full space of the mdframed. Just tried to fit the space fully.
\end{mdframed}
\end{document}
我想直接在那个角落添加一个字母或符号(正方形、三角形、圆形等)。有没有简单的方法可以做到这一点?
答案1
如果要将字母放在行末,只需使用\hfill
将字母设置在行末
\documentclass{article}
\pagestyle{empty}
\usepackage{mdframed, color}
\begin{document}
\begin{mdframed}[leftmargin=5mm, rightmargin=5mm]
Text of the full space of the mdframed. Just tried to fit the
space fully. \hfill\textcolor{red}{S}
\end{mdframed}
\end{document}
如果您想将字母进一步向下和向右移动,请明智地使用\rlap
,\raisebox
如下所示:
\documentclass{article}
\pagestyle{empty}
\usepackage{mdframed, color}
\begin{document}
\begin{mdframed}[leftmargin=5mm, rightmargin=5mm]
Text of the full space of the mdframed. Just tried to fit the
space fully.
\hfill\rlap{\raisebox{-\fboxsep}[0pt][0pt]{\hspace{\fboxsep}\textcolor{red}{S}}}
\end{mdframed}
\end{document}