4

New to macros here, I need to be able to create a document with the regular footnote commands and a custom command that makes footnotes work identically to the regular one but add a prefix ''R'' before (stands for remarks).

4
  • Where should this R appear: Before the footnote number at the footer?
    – user31729
    Jul 1, 2016 at 16:25
  • Yes that is it. It should look something like this: R1 (insert footnote text here).
    – Xyd
    Jul 1, 2016 at 16:32
  • 3
    You could use the package manyfoot. In page 4 you can find how to define a new footnote.
    – Jagath
    Jul 1, 2016 at 16:37
  • Should the "R"-styled footnotes use the same number sequence that the normal one or should be independent?
    – Rmano
    Jul 2, 2016 at 7:58

2 Answers 2

7

There is a package named manyfoot which can be used to create new type of footnotes along with the default footnote. The following code will show how to define a new footnote:

\documentclass{article}

\usepackage{manyfoot}

\DeclareNewFootnote{A}
\DeclareNewFootnote{B}
\renewcommand\thefootnoteB{R\arabic{footnoteB}}
\let\footnoteR\footnoteB
\let\footnote\footnoteA
\begin{document}

Test\footnote{Regular footnote.} and Remark\footnoteR{Remark footnote}.

\end{document}
5

Using no particular package, just 'hacking' the usual definitions of latex.ltx and article.cls (for example)

\documentclass{article}


\makeatletter

\newcommand{\myfootnoteprefix}{R}

\newcommand\@makeremfntext[1]{%
  \parindent 1em%
  \noindent
  \hb@[email protected]{\hss\myfootnoteprefix\@makeremfnmark}: #1}% Prevent raised footnote number here with \@makeremfnmark


\def\@makeremfnmark{\hbox{\normalfont\@thefnmark}}% No \@textsuperscript!

\def\remfootnote{\@ifnextchar[\@xfootnote{\stepcounter\@mpfn
     \protected@xdef\@thefnmark{\thempfn}%
     \@footnotemark\@remfootnotetext}}
 \long\def\@remfootnotetext#1{\insert\footins{%
     \reset@font\footnotesize
     \interlinepenalty\interfootnotelinepenalty
     \splittopskip\footnotesep
     \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
     \hsize\columnwidth \@parboxrestore
     \protected@edef\@currentlabel{%
       \csname p@footnote\endcsname\@thefnmark
     }%
     \color@begingroup% Use `\@makeremfntext instead of \@makefntext
     \@makeremfntext{%
       \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
     \color@endgroup}}%


 \makeatother


\begin{document}
Some footnote\remfootnote{Hello}

Some other footnote\remfootnote{Hello again!}
\end{document}

enter image description here

You must log in to answer this question.

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