![基于 Linux Arch 的发行版 (arcolinux) 上的国际象棋字体特定问题](https://linux22.com/image/480778/%E5%9F%BA%E4%BA%8E%20Linux%20Arch%20%E7%9A%84%E5%8F%91%E8%A1%8C%E7%89%88%20(arcolinux)%20%E4%B8%8A%E7%9A%84%E5%9B%BD%E9%99%85%E8%B1%A1%E6%A3%8B%E5%AD%97%E4%BD%93%E7%89%B9%E5%AE%9A%E9%97%AE%E9%A2%98.png)
简而言之,它是关于让(白色和)黑色小雕像字体发挥作用,这样输入一些国际象棋页面时就会专注于国际象棋,而不是周围的乳胶杂乱。明确地说:
问题:柏林象棋字体无法使用。我的机器上可能存在哪些问题?如何解决?
我将首先陈述问题,尝试将其隔离在一个相对最小的样本案例中,同时也尝试展示使用方向。我的问题是一个有三条边的连接问题
- latex 是其中一个组件,所以这就是出现在这个 stackexchange 域中的原因,
- Linux 发行版 arcolinux,基于 arch,使用标准 texlive 包用于 latex 目的,以及我挑选和添加的 AUR 存储库,因此它也可以满足其他用户的需求,
- 我的机器上的安装,是的,这也可能是原因,所以我必须解释一下这个隧道里发生了什么。
我在这里提问而不是在拱门网站上提问,因为我觉得这是一个乳胶问题(可能只在我的计算机上)。
latex 安装包含以下软件包:
[dan@k9 ~]$ pacman -Ss texlive | grep -F installed
extra/texlive-basic 2024.0-3 (texlive) [installed]
extra/texlive-bibtexextra 2024.0-3 (texlive) [installed]
extra/texlive-bin 2024.0-1 [installed]
extra/texlive-binextra 2024.0-3 (texlive) [installed]
extra/texlive-context 2024.0-3 (texlive) [installed]
extra/texlive-fontsextra 2024.0-3 (texlive) [installed]
extra/texlive-fontsrecommended 2024.0-3 (texlive) [installed]
extra/texlive-fontutils 2024.0-3 (texlive) [installed]
extra/texlive-formatsextra 2024.0-3 (texlive) [installed]
extra/texlive-games 2024.0-3 (texlive) [installed]
extra/texlive-humanities 2024.0-3 (texlive) [installed]
extra/texlive-langeuropean 2024.0-3 (texlive-lang) [installed]
extra/texlive-langgerman 2024.0-3 (texlive-lang) [installed]
extra/texlive-latex 2024.0-3 (texlive) [installed]
extra/texlive-latexextra 2024.0-3 (texlive) [installed]
extra/texlive-latexrecommended 2024.0-3 (texlive) [installed]
extra/texlive-luatex 2024.0-3 (texlive) [installed]
extra/texlive-mathscience 2024.0-3 (texlive) [installed]
extra/texlive-meta 2024.0-3 [installed]
extra/texlive-metapost 2024.0-3 (texlive) [installed]
extra/texlive-music 2024.0-3 (texlive) [installed]
extra/texlive-pictures 2024.0-3 (texlive) [installed]
extra/texlive-plaingeneric 2024.0-3 (texlive) [installed]
extra/texlive-pstricks 2024.0-3 (texlive) [installed]
extra/texlive-publishers 2024.0-3 (texlive) [installed]
extra/texlive-xetex 2024.0-3 (texlive) [installed]
没有 arch 官方texlive-full
软件包。(AUR 中的软件包可以安装在 下\opt
,这绝对不是我想要的。)AUR 里面有一个对我的目的来说似乎有用的软件包:
[dan@k9 ~]$ yay -Ss chess-merida
aur/chess-merida-unicode 1.1-1 (+2 0.02) (Out-of-date: 2024-01-22)
A truetype chess font for diagrams and figurine notation
aur/chess-merida 1.1-2 (+6 0.00) (Installed)
A truetype chess font for diagrams and figurine notation
对应的 aur 信息在https://aur.archlinux.org/packages/chess-merida。
以下代码尝试(也)获取黑后小雕像,并以自然的方式使用它。例如,我们正在写一个关于纳道夫的长篇故事,并想用简单的方式解释这些棋子的位置。构建一个像“♛c7 是主要攻击者……”这样的句子可能比“黑棋 ♕c7 是主要攻击者……”更简单,因此轻松访问黑棋小雕像为书籍作者提供了一些自由。
红色注释的部分就是问题所在。
示例代码:
\documentclass{amsart}
\usepackage{chessfss,chessboard,xskak,texmate}
% \pdfmapfile{=chess-enpassant.map}
% \usetextfig
\usesymfig
\setchessfontfamily{berlin}
\newcommand\p{{\raisebox{-0.33ex}\BlackPawnOnWhite}}
\newcommand\n{{\raisebox{-0.33ex}\BlackKnightOnWhite}}
\renewcommand\b{{\raisebox{-0.33ex}\BlackBishopOnWhite}}
\renewcommand\r{{\raisebox{-0.33ex}\BlackRookOnWhite}}
\newcommand\q{{\raisebox{-0.33ex}\BlackQueenOnWhite}}
\renewcommand\k{{\raisebox{-0.33ex}\BlackKnightOnWhite}}
\renewcommand\P{\pawn}
\newcommand\N{\knight}
\newcommand\B{\bishop}
\newcommand\R{\rook}
\newcommand\Q{\queen}
\newcommand\K{\king}
\parindent0pt
\advance\textwidth by 4cm
\advance\oddsidemargin by -2cm
\begin{document}
\sf\small
White pieces: \P\N\B\R\Q\K
using \verb:\pawn\knight\bishop\rook\queen\king:
Black pieces: \p\n\b\r\q\k
using \verb:\BlackPawnOnWhite\BlackKnightOnWhite: and so on.
\bigskip
White pieces using \verb+\textsymfigsymbol+
-- {\color{red}not the right Berlin font}:
\verb+\textsymfigsymbol{p}+ \textsymfigsymbol{p}\par
\verb+\textsymfigsymbol{n}+ \textsymfigsymbol{n}\par
\verb+\textsymfigsymbol{b}+ \textsymfigsymbol{b}\par
\verb+\textsymfigsymbol{r}+ \textsymfigsymbol{r}\par
\verb+\textsymfigsymbol{q}+ \textsymfigsymbol{q}\par
\verb+\textsymfigsymbol{k}+ \textsymfigsymbol{k}\par
Black pieces using \verb+\textsymfigsymbol+
-- {\color{red}not the right Berlin font, thus also bad fontshape}:
\verb+{\fontshape{bl}\selectfont \textsymfigsymbol{p}}+ {\fontshape{bl}\selectfont \textsymfigsymbol{p}}\par
\verb+{\fontshape{bl}\selectfont \textsymfigsymbol{n}}+ {\fontshape{bl}\selectfont \textsymfigsymbol{n}}\par
\verb+{\fontshape{bl}\selectfont \textsymfigsymbol{b}}+ {\fontshape{bl}\selectfont \textsymfigsymbol{b}}\par
\verb+{\fontshape{bl}\selectfont \textsymfigsymbol{r}}+ {\fontshape{bl}\selectfont \textsymfigsymbol{r}}\par
\verb+{\fontshape{bl}\selectfont \textsymfigsymbol{q}}+ {\fontshape{bl}\selectfont \textsymfigsymbol{q}}\par
\verb+{\fontshape{bl}\selectfont \textsymfigsymbol{k}}+ {\fontshape{bl}\selectfont \textsymfigsymbol{k}}\par
\bigskip
White queen moves to c4 with \verb+\wmove+: \wmove{Qc4}
Black queen moves to c5 with \verb+\bmove+: \bmove{Qc5}
\begin{center}
Diagram XXX
\\
\chessboard[
setfen=r1b1k2r/2qnbppp/p2pp3/1p4P1/3NPP2/2N2Q2/PPP4P/2KR1B1R w kq - 1 13
, moveid=13w]
\\
% Position after |Nf6-d7|, white exchanged |Bg5| for one |Nf6|
% \\
Position after \n f6-d7, white exchanged \B g6 for the \n f6
\end{center}
\bigskip
In Diagram XXX the plan for white is to maximally use the combined action of |Qf3| with the remained pieces.
Possible targets are via |Qf3-a8|, |Qf3-h3-e6|, |Qg3-g7|.
|Qc7| is a strong attacking and devensive ressource for black. Combined with |Ra8-b8| or |Nd7-c5|\dots
\q c7 is a strong attacking and devensive ressource for black. Combined with \r a8-b8 or \n d7-c5\dots
\bigskip
From Diagram XXX there are the following lines:
Line A, pawn sac: |13.f5 Bxg5+ 14.Kb1 Ne5 15.Kb1|
Line A, pawn sac: \verb:13.f5 Bxg5+ 14.Kb1 Ne5 15.Kb1:
Line A, pawn sac: \verb:|13.f5 Bxg5+ 14.Kb1 Ne5 15.Kb1|:
\end{document}
当对上述代码运行 pdflatex 时,latex 编译器会显示以下消息:
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
LaTeX Font Warning: Font shape `LSF/berlin/m/n' undefined
(Font) using `LSF/skaknew/m/n' instead on input line 27.
图片显示了许多我仍需以某种方式解决的小问题。这个问题仅解决其中之一,即如何获取正确的字体,从而获得可用的黑色字体形状:
笔记:在我输入第一个代码r
以运行到最后之后,代码编译时会出现错误。我真正想要的是,有一种简单的方式可以输入动作和国际象棋特定的符号。这应该不受总是在主线或变体中的限制。因此,如果计划是 Qc7-Qb6、Rb8、b5,并且 Q 现在是 b2,那么类似于
|Qc7-Qb6, Rb8, b5|, and |Q| targets now |b2|
是我想要输入的内容。我想,2005 年就是这种情况,当时我导入了chess
,但管道符号没有主线连接。(现在,那些日子里的 latex 代码不再起作用,babel 也依然存在。)作者想要的和他或她现在拥有的有很大的不同,现在我必须输入\q c7-b6, \r b8, b5, and \q{} targets now b2
。此外,国际象棋特定的格式(如粗体或移动数字周围的空格)不再被捕获。
后续编辑:是的,完整解决方案黄威利开箱即用,效果非常好。为了展示这种显著的差异,以及为什么我对一款带有黑色小雕像的好字体如此感兴趣,下面是该berlin
字体的一个示例用法,这是柏林体育出版社的旧翻译书(俄文原版)的怀旧而美丽的纪念品:
\documentclass{amsart}
\usepackage{chessfss,chessboard,xskak,texmate}
\usesymfig
\setchessfontfamily{berlin}
\renewcommand\P{\pawn}
\newcommand\N{\knight}
\newcommand\B{\bishop}
\newcommand\R{\rook}
\newcommand\Q{\queen}
\newcommand\K{\king}
\newcommand\p{{\fontshape{bl}\selectfont \textsymfigsymbol{p}}}
\newcommand\n{{\fontshape{bl}\selectfont \textsymfigsymbol{n}}}
\renewcommand\b{{\fontshape{bl}\selectfont \textsymfigsymbol{b}}}
\renewcommand\r{{\fontshape{bl}\selectfont \textsymfigsymbol{r}}}
\newcommand\q{{\fontshape{bl}\selectfont \textsymfigsymbol{q}}}
\renewcommand\k{{\fontshape{bl}\selectfont \textsymfigsymbol{k}}}
\parindent0pt
\advance\textwidth by 4cm
\advance\oddsidemargin by -2cm
\begin{document}
\sf\small
We switch to the \verb+\sl\large+ setting:
{\sl\large\par
White pieces: \P\N\B\R\Q\K\par
Black pieces: \p\n\b\r\q\k}
\bigskip
We are now back in the the \verb+\sf\small+ setting:\par
White pieces: \P\N\B\R\Q\K\par
Black pieces: \p\n\b\r\q\k
\bigskip
\begin{center}
Diagram XXX
\\
\newchessgame[moveid=13w,id=001]
\chessboard[smallboard
, setfen=r1b1k2r/2qnbppp/p2pp3/1p4P1/3NPP2/2N2Q2/PPP4P/2KR1B1R w kq - 1 13]
\\
{\bfseries B99:}
Position after \n f6-d7, white exchanged \B g5 for the \n f6
\end{center}
\bigskip
In Diagram XXX the plan for white is to maximally use the combined action
of \Q f3 with the remained pieces.\par
$\square$ possible targets are attacked via \Q f3-a8, \Q f3-h3-e6, \Q g3-g7.
\q c7 is a strong attacking and devensive ressource.
Combined with \r a8-b8 or \n d7-c5\dots
\bigskip
From Diagram XXX there are the following lines:
Line A, pawn sac, keeping initiative:
\variation{13.f5 Bxg5+ 14.Kb1 Ne5 15.Kb1}\par
Setting for black: \b g5, \n e5, \q d8 (but not \q e7, defending \p e6).\par
Note that \Q h5! wins back \p e6.\par
$\blacksquare$ counterplay on the f-file.\par
$\square$ controls, often occupies d5 via \N c3-d5, and the h-file.
\bigskip
Line B, slow improvement:
\variation{13.a3 Rb8 14.h4 b4 15.axb4 Rxb4 16.Bh3 Qc5! 17.Nb3 Qb6}\par
There are different nuances and ideas for each of the other earlier possible \q-moves):\par
16\dots\q b8? - allows \N c6 hitting \q b8, \r b4.\par
16\dots\q b7?! - allows 17.\B h3\takes e6 \p f7\takes e6 18.\N d4\takes e6-g7+ and \k often ends on \k d8.
Here, \p d6 is pinned, so white wins a tempo with \Q e3, \q b7 does not defend \n c5.\par
16\dots\q b6 - allows \N f5-\N g7+ in some variations, \P b2 for \p g7, both \K c1, \k e8 are exposed,
however \K c1 is slightly safer, all black pieces rather converge on the b-file.
\end{document}
结果格式如下:
答案1
由于您已经从 AUR 安装东西,我已经制作了一个 PKGBUILD 文件,您可以在此处使用。
- 在某处创建一个新目录。
- 在目录中创建一个名为的文件,
PKGBUILD
内容如下
pkgname=tex-enpassant
pkgver=1.1
pkgrel=1
pkgdesc='Enpassant chess fonts for diagrams and figurine notation'
arch=(any)
url='https://ctan.org/tex-archive/fonts/chess/enpassant'
license=('custom')
source=('https://mirrors.ctan.org/fonts/chess/enpassant.zip')
md5sums=('5d047d1c83416882b558226ce1c0fa53')
sha1sums=('0bd6240e4431a1f5cee7a11798f8e2ed315be9fa')
sha256sums=('4e921b822f46793eeea19729feb8596b4137a123a5e0c7c0e5ce5ada3dda58a9')
package() {
cd $srcdir
install -m644 -D -t "$pkgdir"/usr/share/texmf-dist/fonts/tfm/chess/enpassant enpassant/*.tfm
install -m644 -D -t "$pkgdir"/usr/share/texmf-dist/fonts/type1/chess/enpassant enpassant/*.pfb
install -m644 -D -t "$pkgdir"/usr/share/texmf-dist/fonts/afm/chess/enpassant enpassant/*.afm
install -m644 -D -t "$pkgdir"/usr/share/texmf-dist/fonts/enc/chess/enpassant enpassant/*.enc
install -m644 -D -t "$pkgdir"/usr/share/texmf-dist/tex/latex/chessfss/enpassant enpassant/*.fd
install -m644 -D -t "$pkgdir"/usr/share/texmf-dist/fonts/map/chess/enpassant enpassant/chess-enpassant.map
cd ..
install -m644 -D -t "$pkgdir"/var/lib/texmf/arch/installedpkgs/ $pkgname.maps
}
- 在目录中创建一个名为的文件,
tex-enpassant.maps
内容如下
Map chess-enpassant.map
- 在目录中,运行
makepkg
。 - 如果没有错误,运行
makepkg -si
评论。这只是最低限度的测试。(我检查了软件包是否构建良好,文件是否放置在正确的位置,以及在运行 时是否正确删除了它们pacman -R
。但我没有通过编译任何文档进行检查。)而且我没有费心处理 Ulrike 仅提供指标的字体。(如果您需要它们,请随意编辑PKGBUILD
。)