ctex-kit icon indicating copy to clipboard operation
ctex-kit copied to clipboard

使用unicode字符形式的「en-dash(U+2013)」和「em-dash(U+2014)」的空格问题

Open Explorer-cc opened this issue 2 months ago • 0 comments

已知有如下的三种「连字符」(From TeXbook):

Image

其中:

看来自这里tex-text.map的信息,理论上:

  • 「U+002D U+002D」等价于「U+2013」
  • 「U+002D U+002D U+002D」等价于「U+2014」

但如下例子所示:

% XeLaTeX
\documentclass[border=5pt]{standalone}
\usepackage{xeCJK}
\begin{document}

\begin{tabular}{|*{6}{p{2cm}|}}
\hline
& \texttt{-}(U+002D) & \texttt{--}(U+2013) & \texttt{---}(U+2014) & –(U+2013) & —(U+2014) \\
\hline
无空格 & A-B & A--B & A---B & A–B & A—B \\
\hline
有空格 & A - B & A -- B & A --- B & A – B & A — B \\
\hline
无空格 & 你-好 & 你--好 & 你---好 & 你–好 & 你—好 \\
\hline
有空格 & 你 - 好 & 你 -- 好 & 你 --- 好 & 你 – 好 & 你 — 好 \\
\hline
\end{tabular}
\end{document}

Image

如上图所指,此处的「U+2013」和「U+2014」在处理其后的西文间隔时似乎是不符合预期的(且与-----的行为不一致)?

Maybe related:

  • https://github.com/CTeX-org/ctex-kit/issues/225#issue-121685123
  • https://github.com/CTeX-org/ctex-kit/issues/667#issuecomment-1615979070
  • https://github.com/CTeX-org/ctex-kit/issues/659#issue-1672276952

Explorer-cc avatar Nov 29 '25 09:11 Explorer-cc