2

I have a single environment, fancyfoot, in which I would like footnotes to have no rules.

\documentclass{memoir}

\usepackage{lipsum}

\newenvironment{fancyfoot}{
    \renewcommand{\footnoterule}{}
}{
}
\begin{document}
    \begin{fancyfoot}
        \lipsum[1]\footnote{First footnote}
        \lipsum[2]
    \end{fancyfoot}
\end{document}

I know that although it sound a little funny, it should be feasible to change the properties of \footnote by environment scope, e.g. with \newcommand{\gloss}[1]{{\renewcommand{\thefootnote}{\fnsymbol{footnote}}\footnote{##1}}}.

lockstep
  • 250,273
Simon Kuang
  • 1,861
  • 1
    The commands that typeset the footnotes are executed at the time of page shipping --- it can happen anywhere, in your environment or outside. What would you want if in the same page you have the two types of footnotes? – Rmano Jul 30 '15 at 18:34
  • @Rmanno I don't know, actually. I'd love to see if there is a package that does for footnotes what amsthm does for theorems. – Simon Kuang Jul 30 '15 at 18:35
  • You can do this with footnotes inside a minipage (http://tex.stackexchange.com/questions/204913/footnotes-in-minipages-without-footnote-separator-and-increased-indent/205030#205030), or inside table environments (http://tex.stackexchange.com/questions/226013/how-to-remove-footnote-separator-underneath-table). In both of these cases the footnotes are typeset at the bottom of the environment rather than the bottom of the page. – musarithmia Jul 30 '15 at 19:03
  • @AndrewCashner, I think I probably don't want a minipage since this text has to break across pages. – Simon Kuang Jul 30 '15 at 19:04
  • What will you do if you have a fancyfoot environment, with unruled footnotes at the bottom of the page, on the same page as a regular footnote? – musarithmia Jul 30 '15 at 19:06
  • @AndrewCashner, I'd like to assume that that won't happen. I'm just trying to create this particular behavior with minimal side-effects. – Simon Kuang Jul 30 '15 at 19:06
  • 2
    @SimonKuang --- the problem is not well defined. If you just want sometime footnotes without rules and sometime not, without any fine control, just say \let\oldf=\footnoterule\renewcommand{\footnoterule}{} when the "no rule zone" start and \let\footnoterule=\oldf where it finishes, and cross fingers. Otherwise, you have to define all the corner cases before starting to program. The corner cases *will" appear. Ever. – Rmano Jul 30 '15 at 21:15
  • @Rmano, that is exactly what I am trying to do. Consult my MWE. My question was why this does not work inside an environment. – Simon Kuang Jul 30 '15 at 21:18
  • @Rmano first comment is really the answer to this question. Add newpage to the body of your environment you'll see. – touhami Jul 30 '15 at 22:47
  • @touhami, a \newpage between the two paragraphs makes it work, but not a \newpage outside the environment. \AtNextShipout{\renewcommand{\footnoterule}{}} doesn't work either (everyshi package). – Simon Kuang Jul 30 '15 at 22:56
  • the page where fancyfoot start will have no rule, the page where fancyfoot end will have a rule. So in your example the first page will have a rule if you add new page and fancyfoot end in page 2 the first page will have no rule. – touhami Jul 30 '15 at 23:03
  • with everyshi package you can do this \let\mtfootnoterule\footnoterule \newenvironment{fancyfoot}{ \gdef\footnoterule{} }{\AtNextShipout{\global\let\footnoterule\mtfootnoterule} } – touhami Jul 30 '15 at 23:10
  • @touhami, I see an answer there. – Simon Kuang Jul 30 '15 at 23:31
  • @SimonKuang i think it's better if you define a newcommand \myfootnote{footnote text} that delete the rule frome the page (next page will have a rule if no \myfootnote is used) – touhami Jul 30 '15 at 23:47
  • @touhami, that doesn't seem necessary, since this behavior is relevant only at environment scope. – Simon Kuang Jul 30 '15 at 23:47
  • 2
    But @touhami's suggestion is simpler and will achieve the same purpose with somewhat less scope for unexpected oddities. It makes no sense to say that a separate command doesn't seem necessary when you are proposing a much more complex solution. It is that added complexity - interfering with the page shipping out etc. which seems unnecessary. Why make it so much more complicated when you'll still have to worry about all the corner cases yourself? – cfr Jul 31 '15 at 00:23

0 Answers0