Last active
May 31, 2022 14:20
-
-
Save h20y6m/221129022513a40a1c4d55652533f461 to your computer and use it in GitHub Desktop.
(u)pLaTeX で latex-lab するためのなにか
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ExplSyntaxOn | |
% (u)pLaTeXでなければ何もしない | |
\bool_lazy_or:nnF | |
{ \sys_if_engine_ptex_p: } | |
{ \sys_if_engine_uptex_p: } | |
{ | |
\ExplSyntaxOff | |
\file_input_stop: | |
} | |
% tagpdfのinterwordspaceオプションが(u)pLaTeXでエラーになるのを回避する | |
% tagpdf v0.95 で修正済み | |
% \AddToHook{file/tagpdf.sty/after}{% | |
% \keys_define:nn { __tag / setup } | |
% { | |
% interwordspace .choices:nn = { true, on, false, off } | |
% { \msg_warning:nnn {tag}{sys-no-interwordspace}{(u)pTeX} }, | |
% interwordspace .default:n = true, | |
% show-spaces .bool_set:N = \l__tag_showspaces_bool | |
% } | |
% } | |
\AddToHook{file/latex-lab-testphase-new-or.sty/after}{% | |
\AddToHook{cmd/@makecol/before}{\let\pltx@textbottom\@textbottom} | |
\AddToHook{cmd/@makecol/after}{\let\@textbottom\pltx@textbottom} | |
\def\@makecol@cfgpoint {% | |
% フロート→脚注の順序で挿入 | |
\@outputbox@attachfloats% フロートを挿入 | |
% 脚注の上に \@textbottom を挿入 | |
\ifx\@textbottom\relax \else | |
\@outputbox@append{\@textbottom}% | |
\let\@textbottom=\relax | |
\fi | |
\@outputbox@reinsertbskip% よくわからない | |
\@outputbox@appendfootnotes% 脚注を挿入 | |
% 縦組み時にフッタがずれないようにする | |
\@outputbox@append{% | |
\pltx@adjust@wd@outputbox | |
\vskip-\@outputbox@depth}% 謎の補正 | |
} | |
} | |
\AddToHook{file/latex-lab-footnotes.ltx/after}{% | |
% pLaTeXが再定義したものをlatex-lab-footnotesが再々定義するので再々々定義 | |
\renewcommand\@makefnmark{% | |
\ifydir \hbox{}\hbox{\@textsuperscript{\normalfont\@thefnmark}}\hbox{}% | |
\else\hbox{\yoko\@textsuperscript{\normalfont\@thefnmark}}\fi} | |
% \fnote_footnotemark:にパッチを当てる | |
\tl_replace_once:Nnn \fnote_footnotemark: | |
{ \@makefnmark } { \pltx@makefnmark@cfgpoint } | |
\cs_set_eq:NN \@footnotemark \fnote_footnotemark: | |
% 脚注記号の出力位置の調整(pLaTeXの\@footnotemark) | |
\def\pltx@makefnmark@cfgpoint{% | |
\ifydir\@makefnmark | |
\else\hbox to\z@{\hskip-.25zw\raise.9zh\@makefnmark\hss}\fi | |
} | |
} | |
\ExplSyntaxOff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
Example