0

I’d like to rotate a fancy box made with mdframed for a take home message on a poster. This is a MWE where rotatebox fails. Also tried package rotation with same effect. Left the minipage environment I’d like to use in the poster.

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{lmodern}
\usepackage{tikz}
\usepackage{tcolorbox}
\usepackage[framemethod=TikZ]{mdframed


\begin{document}
\begin{minipage}[t]{0.5\textwidth}
Text
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\rotatebox{20}{
\begin{mdframed}
\large{Text}
\end{mdframed}
}
\end{minipage}
\end{document}
1
  • 5
    Unrelated: since you are already loading tcolorbox why use mdframed at all? It is my impression that tcolorbox is vastly more powerful. – daleif Aug 7 '20 at 8:57
1

I don't know why it doesn't work but you can use \usepackage{rotating} and turn environment instead.

\documentclass{scrartcl}

\usepackage{microtype}
\usepackage{lmodern}
\usepackage{tikz}
\usepackage{tcolorbox}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{rotating}


\begin{document}
\begin{minipage}[t]{0.5\textwidth}
Text
\end{minipage}
\begin{turn}{56}
\begin{minipage}[t]{0.5\textwidth}

\begin{mdframed}
\large{Text}
\end{mdframed}%

\end{minipage}
\end{turn}
\end{document}

enter image description here

1
  • turn-environment does’t work inside the minipage wrapping the mdframed-box, but since I don’t need this, this solution is fine for me – Alex Aug 8 '20 at 14:57
2

I agree with daleif, just use tcolorbox:

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{lmodern}
\usepackage{tcolorbox}
\tcbuselibrary{skins}

\begin{document}

\begin{tcolorbox}[%
    enhanced,
    width=.5\textwidth,
    tikz={rotate=15,transform shape}
]%
    Some fancy test.
\end{tcolorbox}

\end{document}

rotated box

1
  • Probably a good idea but I have a fully specified mdframed-box at hand already and wanted to use it – Alex Aug 8 '20 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.