jsclasses の脚注先頭の \ignorespaces

jsclasses の脚注先頭の \ignorespaces

- wryz77 の投稿
返信数: 2

jsclasses において,脚注で \verb を使用可能にしていることの副作用だと思いますが,脚注先頭に \ignorespaces が挿入されていないような気がします。

\documentclass{jsarticle}
\begin{document}
あ\footnote{脚注。}\footnote{
  脚注。}。
\end{document}

今まで特に困る人はいなかったのかもしれませんが。

wryz77 への返信

Re: jsclasses の脚注先頭の \ignorespaces

- wryz77 の投稿
【追記】
出先なので簡単になりますが。
\jsc@f@@t の定義に \afterassignment\ignorespaces を入れれば解決するような気がしています。
 
\def\jsc@f@@t{\bgroup\aftergroup\jsc@@foot\afterassignment\ignorespaces\let\jsc@next}
wryz77 への返信

Re: jsclasses の脚注先頭の \ignorespaces

- ut の投稿
# 既に対応策もご提示なさっていますので、これはまぁ、書斎派に
# よるただの “賑やかし” みたいなものです。

jsclasses.dtx [2023/02/23 jsclasses (okumura, texjporg)] を
見てみますと、脚註コードの当該部分には、

 % \begin{macro}{\@footnotetext}
 %
 % 脚注で |\verb| が使えるように改変してあります。
 % Jeremy Gibbons, \textit{\TeX\ and TUG NEWS},
 %  Vol.~2, No.~4 (1993), p.~9)

との説明があります。

jsclasses の古いものをネットで適当に検索して探したところ、
“jsclasses-040429.zip” というのが見つかりましたが、その
中の jsclasses.dtx [2004/04/29 okumura] にも既に、まったく
同じ記述が見られます。

で、そもそも、ここで言及されている、1993 年に TeX and TUG
NEWS に掲載されていたコードでも、\ignorespaces は効いてな
かったぽいですね。

\documentclass{article}

\setlength{\textheight}{6\baselineskip}
\pagestyle{empty}

\makeatletter
% Jeremy Gibbons, ``Footnotes with verbatim material''
% (Id., ``Hey --- it works!'')
% TeX and TUG NEWS, Vol. 2, No. 4 (1993), p. 9.

% plainfootnote.sty: incorporate plain TeX's trickery into LaTeX's
% footnote macros, to allow \verb"..." within footnotes
% (the argument to \footnote is not read before it is executed)
\long\def\@footnotetext{%
  \insert\footins\bgroup
      \footnotesize
      \interlinepenalty\interfootnotelinepenalty
      \splittopskip\footnotesep
      \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
      \hsize\columnwidth \@parboxrestore
      \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
      \@makefntext{\rule{\z@}{\footnotesep}\ignorespaces}%
      \futurelet\next\fo@t
}
\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
                                \else \let\next\f@t\fi \next}
\def\f@@t{\bgroup\aftergroup\@foot\let\next}
\def\f@t#1{#1\@foot}
\def\@foot{\strut\egroup}
\makeatother

\begin{document}

Foo\footnote{foo.}, Bar\footnote{ bar.}.

\makeatletter
% https://okumuralab.org/tex/mod/forum/discuss.php?d=3925#p24533
\def\f@@t{\bgroup\aftergroup\@foot\afterassignment\ignorespaces\let\next}
\makeatother

Baz\footnote{baz.}, Qux\footnote{ qux.}.

\end{document}

------------------------------------------------------------
【参考 1】The TeXbook, p. 363 (Appendix B: Basic Control Sequences)

The \footnote macro has a few subtle features that can best be appreciated
by someone who reads Chapter 15 very carefully. It also uses some \bgroup and
\futurelet and \aftergroup trickery, so that the footnote text does not need to be a
parameter to \vfootnote:

【参考 2】今の LaTeX の \@footnotetext(ltfloat.dtx [2024/04/22 v1.2g])

\long\def\@footnotetext#1{\insert\footins{%
    \reset@font\footnotesize
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
    \def\@currentcounter{footnote}%
    \protected@edef\@currentlabel{%
      \csname p@footnote\endcsname\@thefnmark
    }%
    \color@begingroup
      \@makefntext{%
        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
    \par
    \color@endgroup}}%
------------------------------------------------------------

添付 3925.jpg