其中有三种功能的组合正在chessboard
做一些意想不到的事情(在 nullfont 中排版一些字符):curvemove、标记不在单个文件中的移动以及非整数 boardfontsize。有没有办法避免丢失这些字符?
\documentclass{article}
% Running this code generates nullfont characters. From the log:
% Missing character: There is no . ("2E) in font nullfont!
% Missing character: There is no 7 ("37) in font nullfont!
% Missing character: There is no 5 ("35) in font nullfont!
\usepackage{chessboard}
\begin{document}
\chessboard[
pgfstyle=curvemove, % with pgfstyle=straightmove, the problem goes away.
boardfontsize=9.75pt, % with boardfontsize=10pt, the problem goes away.
markmoves={a2-b3} % with markmoves={a2-a4} or {a2-a3}, the problem goes away.
% Note: with markmoves={a2-b2,a2-c2,a2-d2,a2-f2}, a version of the issue persists
% (typesetting ".25" or ".5" or ".75" in nullfont), though markmoves={a2-e2}
% seems totally fine (possibly because of divisibility by four).
]
\end{document}
答案1
您可以尝试以下补丁。下一个棋盘版本将包含它。
\documentclass{article}
% Running this code generates nullfont characters. From the log:
% Missing character: There is no . ("2E) in font nullfont!
% Missing character: There is no 7 ("37) in font nullfont!
% Missing character: There is no 5 ("35) in font nullfont!
\usepackage{chessboard,etoolbox}
\ExplSyntaxOn
\makeatletter
\newcommand\board@divide@NN[2]{%
\dim_set:Nn#1 {#1*\dim_ratio:nn{1pt}{#2}}}%
\ExplSyntaxOff
\patchcmd\board@pgf@extractangle
{\divide \len@board@tempy by \strip@pt\len@board@tempx\relax}
{\board@divide@NN\len@board@tempy\len@board@tempx}{}{\fail}
\makeatother
\begin{document}
\chessboard[
pgfstyle=curvemove, % with pgfstyle=straightmove, the problem goes away.
boardfontsize=9.75pt, % with boardfontsize=10pt, the problem goes away.
markmoves={a2-b3} % with markmoves={a2-a4} or {a2-a3}, the problem goes away.
% Note: with markmoves={a2-b2,a2-c2,a2-d2,a2-f2}, a version of the issue persists
% (typesetting ".25" or ".5" or ".75" in nullfont), though markmoves={a2-e2}
% seems totally fine (possibly because of divisibility by four).
]
\end{document}