Page Layoutfootnote isn't displayed when it's inside shadequote (block quote)

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
thinkpadder
Posts: 11
Joined: Fri May 21, 2021 12:01 pm

footnote isn't displayed when it's inside shadequote (block quote)

Post by thinkpadder »

I'm trying to put an aphorism (a saying with a name underneath) inside a box, i.e. to make it more visible, using the code below, which I've found on the Internet. The aphorism is put inside a shadequote and it works quite fine. Now I'd like to add a footnote to it, to be able to show the aphorism's translation at the bottom. But when I add it inside the shadequote, it's not displayed at the bottom. How to make the footnote displayed at the bottom, even when it's inside the shadequote?

Note: I'm using the code below only because I wanted to accomplish the task which is as simple as making an aphorism look like an aphorism. Otherwise, this code is doing more than that. It's adding colored background and big double quotes, which I don't really need. I've tried some simpler codes but they didn't work, this one worked. Reminder: I'm a novice at LaTeX If you can suggest any code simpler than this, I'd like to try it.

Note 2: The "run latex here" button doesn't work.

Code: Select all

\documentclass[12pt]{article}

\usepackage[T1]{fontenc}

\usepackage{libertine}
\usepackage{graphicx}
\usepackage[svgnames]{xcolor}
\usepackage{framed}

\newcommand*\openquote{\makebox(25,-22){\scalebox{5}{``}}}
\newcommand*\closequote{\makebox(25,-22){\scalebox{5}{''}}}
\colorlet{shadecolor}{Azure}

\makeatletter
\newif\if@right
\def\shadequote{\@righttrue\shadequote@i}
\def\shadequote@i{\begin{snugshade}\begin{quote}\openquote}
\def\endshadequote{%
  \if@right\hfill\fi\closequote\end{quote}\end{snugshade}}
\@namedef{shadequote*}{\@rightfalse\shadequote@i}
\@namedef{endshadequote*}{\endshadequote}
\makeatother

\begin{document}

\begin{shadequote}
  Ignorance is bliss 
\footnote{Unwissenheit ist seligkeit}
  \par\emph{John Doe}
\end{shadequote}

  Ignorance is bliss \footnote{Unwissenheit ist seligkeit}
\par\emph{John Doe}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

footnote isn't displayed when it's inside shadequote (block quote)

Post by Stefan Kottwitz »

A simple workaround could be just using \footnotemark in the quote, and right after the quote \footnotetext{Unwissenheit ist Seligkeit}. That way you ensure the footnote text is printed (without a second marker) and the marker is placed within the quote.

The Run LaTeX here button works for me. Perhaps your browser has Javascript blocked or not enabled.

Stefan
LaTeX.org admin
thinkpadder
Posts: 11
Joined: Fri May 21, 2021 12:01 pm

footnote isn't displayed when it's inside shadequote (block quote)

Post by thinkpadder »

I'm trying to right-align the text at the bottom so that it looks like this:

Image

To do that I've used the ragged2e package and used the \begin{FlushRight} tags like so:

Code: Select all

\documentclass[12pt]{article}

\usepackage[T1]{fontenc}

\usepackage{libertine}
\usepackage{graphicx}
\usepackage[svgnames]{xcolor}
\usepackage{framed}

\newcommand*\openquote{\makebox(25,-22){\scalebox{5}{``}}}
\newcommand*\closequote{\makebox(25,-22){\scalebox{5}{''}}}
\colorlet{shadecolor}{Azure}

\makeatletter
\newif\if@right
\def\shadequote{\@righttrue\shadequote@i}
\def\shadequote@i{\begin{snugshade}\begin{quote}\openquote}
\def\endshadequote{%
  \if@right\hfill\fi\closequote\end{quote}\end{snugshade}}
\@namedef{shadequote*}{\@rightfalse\shadequote@i}
\@namedef{endshadequote*}{\endshadequote}
\makeatother

% A package to right or left align the text
\usepackage{ragged2e}

\begin{document}

\begin{shadequote}
  Ignorance is bliss 
\footnote{Unwissenheit ist seligkeit}
  \par
  \begin{FlushRight}  
  \emph{John Doe}
 \end{FlushRight}  
\end{shadequote}


\end{document}
But it throws the double quote under.

How to right-align the text, without causing the double quote to go under?
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

footnote isn't displayed when it's inside shadequote (block quote)

Post by Ijon Tichy »

The FlushRight environment ends before the quote is inserted. So this cannot be used.

Use \RaggedLeft or \raggedleft instead of an environment and the star variant of shadequote:

Code: Select all

\documentclass[12pt]{article}

\usepackage[T1]{fontenc}

\usepackage{libertine}
\usepackage{graphicx}
\usepackage[svgnames]{xcolor}
\usepackage{framed}
\usepackage[main=ngerman,english]{babel}

\newcommand*\openquote{\makebox(25,-22){\scalebox{5}{``}}}
\newcommand*\closequote{\makebox(25,-22){\scalebox{5}{''}}}
\colorlet{shadecolor}{Azure}

\makeatletter
\newif\if@right
\def\shadequote{\@righttrue\shadequote@i}
\def\shadequote@i{\begin{snugshade}\begin{quote}\openquote}
\def\endshadequote{%
  \if@right\hfill\fi\closequote\end{quote}\end{snugshade}}
\@namedef{shadequote*}{\@rightfalse\shadequote@i}
\@namedef{endshadequote*}{\endshadequote}
\makeatother

% A package to right or left align the text
\usepackage{ragged2e}

\begin{document}

\begin{shadequote*}
  \foreignlanguage{english}{Ignorance is bliss}\footnotemark
  \par
  \RaggedLeft
  \emph{John Doe}
\end{shadequote*}
\footnotetext{Unwissenheit ist Seligkeit}

\end{document}
As an alternative you could use \hspace{0pt plus 1filll} instead of \RaggedLeft, to move a at most one line text to the right.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
thinkpadder
Posts: 11
Joined: Fri May 21, 2021 12:01 pm

footnote isn't displayed when it's inside shadequote (block quote)

Post by thinkpadder »

That works. Particularly,\hspace{0pt plus 1filll} works like a charm. Thanks.
Post Reply