# Automatically change font size in main text and footnote

I am typesetting an article with a lot of quotes from poems, and I have defined a command that puts the poem information at the end of the line

\newcommand\poemcite[1]{\hfill{\small #1}}


But if I want to use this command in the footnote, I need to change the font size otherwise it will be too large compared with other text in the footnote. I know that I can define another command that uses \scriptsize instead of \small, but I wonder if there is a way to automatically determine if it is used in main text or footnote, so I can just use the same \poemcite command both in main text and footnotes.

A MWE

\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage[norule]{footmisc}
\newcommand\poemcite[1]{\hfill{\small #1}}

\begin{document}
\lipsum[2]
\begin{quote}
April is the cruellest month \poemcite{\emph{T.S. Eliot}}
\end{quote}
A footnote is here.\footnote{
\begin{quote}
April is the cruellest month \poemcite{\emph{T.S. Eliot}}
\end{quote}
But I want the command to achieve something like this
\begin{quote}
April is the cruellest month \hfill{\scriptsize\emph{T.S. Eliot}}
\end{quote}
}
\end{document}


## 1 Answer

Use the relsize package's \smaller (or \larger) macro to step to a font size relative to the current font size:

\documentclass[12pt]{article}
\usepackage{lipsum,relsize}
\usepackage[norule]{footmisc}
\newcommand\poemcite[1]{\hfill{\smaller\emph{#1}}}

\begin{document}
\lipsum[2]
\begin{quote}
April is the cruellest month \poemcite{T.S. Eliot}
\end{quote}
A footnote is here.\footnote{
\begin{quote}
April is the cruellest month \poemcite{T.S. Eliot}
\end{quote}
But I want the command to achieve something like this
\begin{quote}
April is the cruellest month \hfill{\emph{\scriptsize T.S. Eliot}}
\end{quote}
}
\end{document}