0

When I put a footnote in a minipage, the footnote appears right after the text:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2.00cm, right=3.00cm, top=1.00cm, bottom=1.00cm]{geometry}

\begin{document} \begin{minipage}{0.5\linewidth} Some text here\footnote{with a footnote} \end{minipage}\hfill% \begin{minipage}{0.45\linewidth} \includegraphics[width=\linewidth]{example-image-a} \end{minipage} \end{document}

I would like it to appear the the bottom of the minipage, leaving some space between the normal text and the footnote. Ideally it should align with the bottom of the picture in the right minipage.

For normal text outside of a minipage I use the package footmisc with the option [bottom], but that's not working in the minipage, for some reason.

I have also tried egreg's solution with \valign instead of minipages, but the footnote does not appear.

Andyc
  • 555

1 Answers1

2

you can set a height for the minipage and then stretch the content. I removed inputenc, as utf8 is the default in a current LaTeX.

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx,calc}
\usepackage[left=2.00cm, right=3.00cm, top=1.00cm, bottom=1.00cm]{geometry}

\begin{document} \begin{minipage}[c][\heightof{\includegraphics[width=0.45\linewidth]{example-image-a}}][s]{0.5\linewidth} Some text here\footnote{with a footnote} \end{minipage}\hfill% \begin{minipage}{0.45\linewidth} \includegraphics[width=\linewidth]{example-image-a} \end{minipage} \end{document}

enter image description here

Ulrike Fischer
  • 327,261
  • I would have used a savebox and avoided converting the image twice. – John Kormylo May 01 '21 at 12:52
  • @JohnKormylo yes, would work too, but the actual height isn't the main point of the question and it is not really clear which height is actually wanted, so I choose a lazy way. – Ulrike Fischer May 01 '21 at 12:57
  • @UlrikeFischer Sorry if the question was not clear, but that's exactly what I wanted. However, doesn't the [s] option stretch the text inside the minipage vertically so that, if it's any longer than just one line, it will add space between the lines of text as well? – Andyc May 01 '21 at 14:23
  • @JohnKormylo How would you do it with a savebox? – Andyc May 01 '21 at 14:24
  • @Andyc why don't you try? – Ulrike Fischer May 01 '21 at 14:38
  • @UlrikeFischer Right: I read yet another answer by egreg and didn't notice that he put something else besides the [s], which increased line spacing. That's why I thought it was [s] that did the trick, but it's not. By the way, how do you paste the result of the code run? I tried once, but I got a lot of white space and it didn't look good. – Andyc May 01 '21 at 14:58
  • you mean the picture? I use the in-built app of windows to make a screenshot of a part of my screen. – Ulrike Fischer May 01 '21 at 15:07