如果我使用包 sidenotes 并尝试以下操作:
Test\sidenote{Side note.}, continue.
逗号前有一个大空格。
有可能避免这种情况吗?
答案1
感谢 cgnieder 发现一些缺失的%
符号。但即使修复了这个问题,它仍然为我添加了太多空格。所以我删除了一些空格。我检查了一下,当输入两位数时,它似乎不会出现空格错误,所以你可能没问题。
\documentclass{article}
\usepackage{sidenotes}
\makeatletter
\renewcommandtwoopt{\sidenote}[3][][]{%
\sidenotemark[#1]%
\sidenotetext[#1][#2]{#3}%
\@ifnextchar\sidenote{\kern-0.07em\textsuperscript{,}}%
{\@ifnextchar\sidecite{\kern-0.07em\textsuperscript{,}}{}}% <<SPACE REMOVED
}
\renewcommandtwoopt{\sidenotetext}[3][][]{%
\ifthenelse{\isempty{#1}}{% sitenotemark given?
\addtocounter{sidenote}{-1}%
\ifthenelse{\isempty{#2}}% offset given?
{\marginpar{\textsuperscript{\thesidenote}{}#3}}% <<<SPACE REMOVED
{\marginnote{\textsuperscript{\thesidenote}{}#3}[#2]}% <<<SPACE REMOVED
\addtocounter{sidenote}{1}}%
{\ifthenelse{\isempty{#2}}% offset given?
{\marginpar{\textsuperscript{#1}#3}}% <<<SPACE REMOVED
{\marginnote{\textsuperscript{#1}#3}[#2]}}% <<<SPACE REMOVED
}%
\makeatother
\begin{document}
Test\sidenote{Side note.}, continue.
\end{document}