Skip to content

Commit

Permalink
exppl2e.sty: handle penalty before \footnotetext
Browse files Browse the repository at this point in the history
  • Loading branch information
h-kitagawa committed Aug 2, 2016
1 parent 8adee34 commit f5c907b
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ pythontex-files-*/
# xypic precompiled matrices
*.xyc

# WinEdt
# WinEdt, Emacs
*~
*.bak
*.sav

Expand Down
70 changes: 61 additions & 9 deletions exppl2e.sty
Original file line number Diff line number Diff line change
Expand Up @@ -251,22 +251,53 @@
%
% \section{$B5SCm$N9g0uD>8e$G$N2~9T$r5v2D(B}
%
% \begin{macro}{\@footnotetext}
% $B%$%s%5!<%H%\%C%/%9(B|\footins|$B$K5SCm$N%F%-%9%H$rF~$l$^$9!#(B
%
% p\TeX{}$B$G$O(B|\insert|$B$ND>8e$KOBJ8J8;z$,Mh$?>l9g!"$=$3$G$N2~9T$O5v$5$l$J$$(B
% $B$H$$$&5sF0$K$J$C$F$$$^$9!#$3$N$?$a!"=>Mh$O5SCmHV9f!J9g0u!K$ND>8e$N2~9T$,(B
% $BM^@)$5$l$F$$$^$7$?!#$7$+$7!"(B|\hbox|$B$ND>8e$KOBJ8J8;z$,Mh$?>l9g$O!"$=$3$G(B
% $B$N2~9T$O5v$5$l$^$9$+$i!":G8e$K(B|\null|$B$rDI2C$7$^$9!#(B
%
% \changes{v1.0a}{1995/04/07}{$BAHJ}8~$NH=Dj$r%\%C%/%9$N30$G$9$k$h$&$K$7$?(B}
% \changes{v????}{????/??/??}{$B5SCm$N9g0uD>8e$G$N2~9T$,6X;_$5$l$F$7$^$&(B
% $BLdBj$KBP=h(B}
% \begin{macrocode}
%</plcore>
%<platexrelease>\plIncludeInRelease{????/??/??}{\@footnotetext}
%<platexrelease> {Allow break after \footnote}%
%<*plcore|platexrelease>
% \end{macrocode}
% \begin{macro}{\pltx@foot@penalty}
% \begin{macro}{\footnotetext}
% \begin{macro}{\footnotemark}
% \begin{macro}{\footnote}
% $BJD$83g8LN`$ND>8e$K(B |\footnotetext| $B$,B3$$$?>l9g!"(B|\footnotetext| $B$NA0$G$N2~9T$O(B
% $BK>$^$7$/$"$j$^$;$s!#$3$N$h$&$J>l9g$KBP=h$9$k$?$a$K!"(B|\pltx@foot@penalty| $B$H$$$&(B
% $B%+%&%s%?$rMQ0U$7$^$7$?!#(B|\footnotetext| $B$N:G=i$G!VD>A0$N%Z%J%k%F%#CM!W(B
% $B$H$7$F$3$N%+%&%s%?$,=i4|2=$5$l$^$9!#(B
% |\footntoemark|,~|\footnote| $B$G$O;H$o$J$$$N$G(B0$B$K@_Dj$7$F$$$^$9!#(B
%
% $B$^$?!"9g0u$NA0$NJ8;z$H9g0u$N4V$O86B'%Y%?AH$G$9!JC"$7!"(BJIS~X~4051$B$K$ONc30M-$j!K!#(B
% $B$=$N$?$a!"9g0u$r=PNO$9$k(B |\footntoemark|,~|\footnote| $B$N:G=i$G(B |\inhibitglue| $B$r(B
% $B<B9T$7$F$*$/$3$H$K$7$^$9!J(B|\@makefnmark| $B$NCf$KCV$$$F$b8zNO$,$"$j$^$;$s!K!#(B
% \begin{macrocode}
\ifx\undefined\pltx@foot@penalty \newcount\pltx@foot@penalty\fi
\def\footnote{\inhibitglue\pltx@foot@penalty\z@
\@ifnextchar[\@xfootnote{\stepcounter\@mpfn
\protected@xdef\@thefnmark{\thempfn}%
\@footnotemark\@footnotetext}}
\def\footnotemark{\inhibitglue\pltx@foot@penalty\z@%
\@ifnextchar[\@xfootnotemark
{\stepcounter{footnote}%
\protected@xdef\@thefnmark{\thefootnote}%
\@footnotemark}}
\def\footnotetext{\pltx@foot@penalty\lastpenalty\unpenalty%
\@ifnextchar [\@xfootnotenext
{\protected@xdef\@thefnmark{\thempfn}%
\@footnotetext}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@footnotetext}
% |\footnotetext|,~|\footnote| $B$ND>8e$G2~9T$r2DG=$K$7$^$9!#(B
% \begin{macrocode}
\long\def\@footnotetext#1{%
\ifydir\def\@tempa{\yoko}\else\def\@tempa{\tate}\fi
\insert\footins{\@tempa%
Expand All @@ -281,7 +312,19 @@
\color@begingroup
\@makefntext{%
\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
\color@endgroup}\null}
% \end{macrocode}
%
% p\TeX{}$B$G$O(B|\insert|$B$ND>8e$KOBJ8J8;z$,Mh$?>l9g!"$=$3$G$N2~9T$O5v$5$l$J$$(B
% $B$H$$$&5sF0$K$J$C$F$$$^$9!#$3$N$?$a!"=>Mh$O5SCmHV9f!J9g0u!K$ND>8e$N2~9T$,(B
% $BM^@)$5$l$F$$$^$7$?!#$7$+$7!"(B|\hbox|$B$ND>8e$KOBJ8J8;z$,Mh$?>l9g$O!"$=$3$G(B
% $B$N2~9T$O5v$5$l$^$9$+$i!":G8e$K(B|\null|$B$rDI2C$7$^$9!#(B
% $B$^$?!"(B|\pltx@foot@penalty| $B$NCM$,(B0$B$G$O$J$+$C$?>l9g!"(B
% $B5SCm$NA0$K%Z%J%k%F%#$,$"$C$?$H$$$&$3$H$G$9$+$i!"I|3h$5$;$F$*$-$^$9!#(B
% \begin{macrocode}
\color@endgroup}\null
\ifnum\pltx@foot@penalty=\z@\else\penalty\pltx@foot@penalty\fi}
% \end{macrocode}
% \begin{macrocode}
%</plcore|platexrelease>
%<platexrelease>\plEndIncludeInRelease
%<platexrelease>\plIncludeInRelease{0000/00/00}{\@footnotetext}
Expand All @@ -301,8 +344,17 @@
%<platexrelease> \@makefntext{%
%<platexrelease> \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
%<platexrelease> \color@endgroup}}
%<platexrelease>\def\footnote{\@ifnextchar[\@xfootnote{\stepcounter\@mpfn
%<platexrelease> \protected@xdef\@thefnmark{\thempfn}%
%<platexrelease> \@footnotemark\@footnotetext}}
%<platexrelease>\def\footnotemark{\@ifnextchar[\@xfootnotemark
%<platexrelease> {\stepcounter{footnote}%
%<platexrelease> \protected@xdef\@thefnmark{\thefootnote}%
%<platexrelease> \@footnotemark}}
%<platexrelease>\def\footnotetext{\@ifnextchar [\@xfootnotenext
%<platexrelease> {\protected@xdef\@thefnmark{\thempfn}%
%<platexrelease> \@footnotetext}}
%<platexrelease>\plEndIncludeInRelease
%<*plcore>
% \end{macrocode}
% \end{macro}
%
Expand Down
30 changes: 30 additions & 0 deletions tests/footnote.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
%#!ptex2pdf -l footnote
\documentclass[twocolumn]{jarticle}
\textwidth42zw
\columnsep2zw
\parindent0zw
\begin{document}

「*」のある行は望ましくない出力
(本来は起きないが,わざと例示している)

1あああああああああああああああああああ\par
1*ああああああああああああああああああ\footnote[1]{いいいいい}\hskip0pt,ううううう\par
11ああああああああああああああああああ\footnote[1]{いいいいい},ううううう\par
12ああああああああああああああああああ\footnotemark[1],ううううう\par
13ああああああああああああああああああ\footnotetext[1]{いいいいい},ううううう\par
2あああああああああああああああああああ)\footnote[1]{いいいいい}うううううううう\par
2*ああああああああああああああああ)\footnote[1]{いいいいい}\nobreak (ううううううう\par
21ああああああああああああああああ)\footnote[1]{いいいいい}(ううううううう\par
22ああああああああああああああああ)\footnotemark[1](うううううう\par
23ああああああああああああああああ)\footnotetext[1]{いいいいい}(ううううううう\par
24ああああああああああああああああああ)\footnote[1]{いいいいい}うううううううう\par
25ああああああああああああああああああ)\footnotemark[1]ううううううう\par
3あああああああああああああああああああ\footnote[1]{いいいいい}\\うううううううう\par
4ああああああああああああああああああ(\footnote[1]{いいいいい}うううううううう\par
4*あああああああああああああああああ(\hskip0pt\footnotetext[1]{いいいいい}うううううううう\par
41あああああああああああああああああ(\footnotetext[1]{いいいいい}うううううううう\par
42あああああああああああああああああ(\footnotemark[1]うううううううう\par

\end{document}

0 comments on commit f5c907b

Please sign in to comment.