0

is there a way to write something just right below an mdframed-box?

MWE:

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

Next I will add the output with an added red letter: enter image description here

I want to add a letter or a symbol (square, triangle, circle, whatever) directly in that corner. Is there an easy way to do so?

1
  • Well, your title and text is misleading. You don't want to have the letter below, you want it inside at the lower right corner ...
    – user31729
    Mar 18, 2017 at 19:21

1 Answer 1

1

If you want to put the letter at the end of the line, just use \hfill to set the letter at the end of the line

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

enter image description here

If you want to move the letter further down and right, use \rlap and \raisebox judiciously, like this:

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

enter image description here

1
  • Your 2nd approch will do it. Thank you!
    – Shalec
    Mar 19, 2017 at 8:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .