Search code examples
rotationlatextikzlstlisting

How to rotate footnote with listings?


How can I rotate footnote, which contains a listings?

Currently my code looks like:

\documentclass[12pt]{article}

\usepackage{listings} %kod programów
\usepackage{graphicx}

\begin{document}
\rotatebox{180}{\footnote{Trzeba zastosować
\begin{minipage}{0.23\textwidth}
        \begin{lstlisting}
            \draw[stealth-]\end{lstlisting}
\end{minipage}}}
\end{document}

Sketch:

Reversed sketch - example

Many thanks in advance!


Solution

  • You can rotate the content of the footnote like this:

    \documentclass[12pt]{article}
    
    \usepackage{listings} %kod programów
    \usepackage{graphicx}
    \newsavebox{\LstBox}
    
    \begin{document}
    
    \begin{lrbox}{\LstBox}
    \begin{lstlisting}
    \draw[stealth-]
    \end{lstlisting}
    \end{lrbox}
    
    some text\footnote{\rotatebox{180}{Trzeba zastosować {\usebox{\LstBox}}}}
    
    
    \end{document}
    

    enter image description here