1

How can a footnote in a minipage use the same font for footnotemark and footnotetext. The mark in the example uses

\bfseries\sffamily\Huge

where the text uses the normalfont. The same does a "direct" footnote

\documentclass{article}
\usepackage{%
expl3,%   
xparse,%  
}

\newcounter{Foot}

\newcommand\Mark{%
  \stepcounter{Foot}%
  \footnotemark[\theFoot]%
}% Mark

\newcommand\Meaning[1]{%
  \stepcounter{Foot}%
  \footnotetext[\theFoot]{#1}%
}% Meaning

\NewDocumentEnvironment{Test}{O{t}D(){\empty}}{%
  \begin{minipage}[#1]{6cm}%
    \bfseries\sffamily\Huge%
    \renewcommand{\thefootnote}{\alph{footnote}}%
    \setcounter{Foot}{0}%
}{%
  \ifx#2\empty\else%
    \setcounter{Foot}{0}%
    #2%
  \fi%
  \end{minipage}%
}% Test

\begin{document}
Start Text

\begin{Test}(\Meaning{First}\Meaning{Second})
  Word1\Mark word2\footnote{FN1}\\
  word3\Mark word4\footnote{FN2}
\end{Test}

After Text
\end{document}
2
  • John, it seems to me that reset@font is not called at all in this example. Can you show me in detail what your solution is. Thanks Jack
    – Jack
    Commented Dec 4, 2016 at 12:04
  • Inside a minipage \footnote uses a different counter, but \footnotemark doesn't. \thefootnote should have no effect on \footnote inside a minipage. Instead one should use \thempfn. Commented Dec 4, 2016 at 18:25

1 Answer 1

1

You can use \footnotesize to control the size of the footnote text, while \reset@font controls the font type.

\documentclass{article}
\usepackage{%
expl3,%   
xparse,%  
}

% modify \footnotemark to use same counter as \footnote
\makeatletter
\def\footnotemark{\@ifnextchar[\@xfootnotemark{\stepcounter\@mpfn
 \protected@xdef\@thefnmark{\thempfn}
 \@footnotemark}}

\def\@xfootnotemark[#1]{%
 \begingroup
   \csname c@\@mpfn\endcsname #1\relax
   \unrestored@protected@xdef\@thefnmark{\thempfn}%
 \endgroup
 \@footnotemark}
\makeatother

\newcounter{Foot}

\newcommand\Mark{%
  \stepcounter{Foot}%
  \footnotemark[\value{Foot}]%
}% Mark

\newcommand\Meaning[1]{%
  \stepcounter{Foot}%
  \footnotetext[\theFoot]{#1}%
}% Meaning

\NewDocumentEnvironment{Test}{O{t}D(){\empty}}{%
  \begin{minipage}[#1]{6cm}%
    \bfseries\sffamily\Huge
    \let\footnotesize=\Huge
    \expandafter\let\csname reset@font\endcsname=\relax
    %\renewcommand{\thempfn}{\alph{\csname @mpfn\endcsname}}%
    \setcounter{Foot}{0}%
}{%
  \ifx#2\empty\else%
    \setcounter{Foot}{0}%
    #2%
  \fi%
  \end{minipage}%
}% Test

\begin{document}
Start Text

\begin{Test}(\Meaning{First}\Meaning{Second})
  Word1\Mark word2\footnote{FN1}\\
  word3\Mark word4\footnote{FN2}
\end{Test}

After Text
\end{document}

demo

2
  • Thanks, John. I guess it does what I asked for, but my question meant to be that the footnotes are in a font(size) relative to the font in the minipage. In the example this is "\bfseries\sffamily\Huge", so the footnotesize might be something like "Large". But in reality the font in the minipage will be set by a user calling a macro and I don't know what it will be. Is there also a solution for this?
    – Jack
    Commented Dec 4, 2016 at 21:20
  • I could live with either the Mark/Meaning or the footnote solution. I don't need both.
    – Jack
    Commented Dec 4, 2016 at 21:27

You must log in to answer this question.

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