pagenote 将空格转换为换行符并中断逐字排版

pagenote 将空格转换为换行符并中断逐字排版

我想排版逐字结尾注释(使用铸造)。 很遗憾页注将我的页面注释中的所有空格转换为换行符,如下面的最小示例所示:

\documentclass{memoir}
\makepagenote
\begin{document}
main text
\pagenote[1]{page note text}
\printpagenotes
\end{document}

查看生成的*.ent文件,我们发现页面注释中的每个空格都已转换为换行符:

\startnoteentry{0}
{1}
{pagenote1-1}
{}
page
note
text
\endnoteentry

我怎样才能阻止这种转换,以便我可以在 pagenotes 中使用逐字排版?

是否有其他方式来排版逐字尾注?

答案1

评论太长了。

这是一个示例文件,显示了实际发生的情况。补丁删除了 ,\newlinechar='40然后将其默认为-1。通过运行此文件可以看到,此时当我们获得数据时,原始换行符已经转换为空格,因此现在做任何事情都为时已晚。如果您绝对需要在页面注释中铸字(我可能会重新考虑并使用附录或类似内容),那么您可能需要一个基于环境的界面来将这些讨厌的块写入 ent 文件。

\documentclass{memoir}
\makepagenote
\usepackage{minted}

%\newenvironment{minted}[1]{\par\medskip}{\par}

\usepackage{xpatch}
\tracingpatches
\makeatletter
\xpatchcmd{\m@m@wrpnote}{\newlinechar='40}{}{\typeout{patched}}{\typeout{nope}}
\makeatother


\begin{document}
main text
\pagenote[1]{
\begin{minted}{latex}
  test LaTeX test

  asdfsd asdfsadf
\end{minted}
asdf}


%\printpagenotes

% just so we never run the minted env
\makeatletter
\immediate\closeout\@notefile
\makeatother


The actual ent file:

\verbatiminput{\jobname.ent}


\end{document}

在此处输入图片描述

相关内容