Discussion:
Verbatim text in footnotes
Peter Percival
2017-04-10 15:39:21 UTC
Raw Message
\footnote{\verb|splat!|} seems not to work. Is that as intended?
--
Do, as a concession to my poor wits, Lord Darlington, just explain
to me what you really mean.
I think I had better not, Duchess. Nowadays to be intelligible is
to be found out. -- Oscar Wilde, Lady Windermere's Fan
Rolf Niepraschk
2017-04-10 17:48:36 UTC
Raw Message
Post by Peter Percival
\footnote{\verb|splat!|} seems not to work. Is that as intended?
See

http://www.tex.ac.uk/FAQ-verbwithin.html

...Rolf
Peter Flynn
2017-04-10 19:00:41 UTC
Raw Message
Post by Peter Percival
\footnote{\verb|splat!|} seems not to work. Is that as intended?
Yes, \footnote reads *all* of its argument as text right up to the
closing curly brace, and thus by the time it comes to do something with
it, it's too late to recognise the need of \verb to change the category
codes of its own argument.

See http://latex.silmaril.ie/formattinginformation/footnotes.html#footverb

///Peter
Peter Percival
2017-04-10 19:13:54 UTC
Raw Message
Post by Peter Percival
\footnote{\verb|splat!|} seems not to work. Is that as intended?
Thank you for the replies. It seems the thing to do is to use \tt
--
Do, as a concession to my poor wits, Lord Darlington, just explain
to me what you really mean.
I think I had better not, Duchess. Nowadays to be intelligible is
to be found out. -- Oscar Wilde, Lady Windermere's Fan
jfh
2017-04-11 22:43:19 UTC
Raw Message
Post by Peter Percival
Post by Peter Percival
\footnote{\verb|splat!|} seems not to work. Is that as intended?
Thank you for the replies. It seems the thing to do is to use \tt
That would work for \verb|splat!| but not easily for everything you might want to quote with \verb. I leave you to simulate this \verb by using \tt :

\documentclass{article}

\begin{document}
\verb|\begin $x=y$|

\end{document}
Post by Peter Percival
--
Do, as a concession to my poor wits, Lord Darlington, just explain
to me what you really mean.
I think I had better not, Duchess. Nowadays to be intelligible is
to be found out. -- Oscar Wilde, Lady Windermere's Fan
Peter Percival
2017-04-12 11:56:30 UTC
Raw Message
Post by jfh
Post by Peter Percival
Post by Peter Percival
\footnote{\verb|splat!|} seems not to work. Is that as intended?
Thank you for the replies. It seems the thing to do is to use \tt
\documentclass{article}
\begin{document}
\verb|\begin $x=y$|
\end{document}
Indeed so. I see that \tt[ and \verb|[| look quite different.
--
Do, as a concession to my poor wits, Lord Darlington, just explain
to me what you really mean.
I think I had better not, Duchess. Nowadays to be intelligible is
to be found out. -- Oscar Wilde, Lady Windermere's Fan
Uwe Siart
2017-04-12 14:51:51 UTC
Raw Message
Post by Peter Percival
Indeed so. I see that \tt[ and \verb|[| look quite different.
Huuh? I don't see much of a difference here:

% ----------------------
\documentclass{article}
\begin{document}
\verb|[| \texttt{[} \tt[
\end{document}
% ----------------------

Anyway, don't use \tt anymore. It's grossly obsolete. Use \texttt{} or
\ttfamily instead. Reasons are explained in l2tabuen.pdf.

What's more, don't use \verb if in the end don't need it's
functionality. If you just want typewriter text, use \texttt{}. By this
you simply avoid the problem you posted.
--
Uwe
Herbert Voss
2017-04-12 09:31:41 UTC
Raw Message
Post by Peter Percival
\footnote{\verb|splat!|} seems not to work. Is that as intended?
\documentclass{article}
\usepackage{fancyvrb}
\VerbatimFootnotes
\begin{document}

foo\footnote{\verb|\begin $x=y$|}

\end{document}
jfbu
2017-04-12 09:46:26 UTC
Raw Message
Post by Peter Percival
\footnote{\verb|splat!|} seems not to work. Is that as intended?
\documentclass{article}
\usepackage{footnotehyper}
\begin{document}

foo\begin{footnote}
\verb|\begin $x=y$|
\end{footnote}

\end{document}

or

foo%
\begin{footnote}

as the \begin{footnote} of package footnotehyper (deliberately) does no \unskip.

HIH,

Jean-François