我的设置:TeX Live
我如何将插槽 39 重新映射到插槽 13?
我尝试通过创建虚拟字体来实现这一点:
tftopl cmtt10.tfm > cmtt10.vpl
patch <<EOF
--- cmtt10.vpl
+++ cmtt10.vpl
@@ -1,3 +1,4 @@
+(MAPFONT D 0 (FONTNAME cmtt10))
(FAMILY CMTT)
(FACE O 352)
(CODINGSCHEME TEX TYPEWRITER TEXT)
@@ -192,6 +193,7 @@
(CHARACTER O 47
(CHARWD R 0.524996)
(CHARHT R 0.611112)
+ (MAP (SETCHAR O 15))
)
(CHARACTER O 50
(CHARWD R 0.524996)
EOF
vptovf cmtt10.vpl
rm cmtt10.tfm cmtt10.vpl
创建 test.tex:
\tt '
\bye
tex test.tex
编辑:事实上,正如所cfr
建议的,存在无限递归:
dvicopy test.dvi expand.dvi
DVI: font 29 = cmtt10.
DVI: font 0 = cmr10.
DVI: processing page 1.
DVI: font 29 = cmtt10.
TFM: font 0 = cmtt10.
VF file: '',
for font 0 = cmtt10.
VF: font 0 = cmtt10.
!Infinite VF recursion?
level=10 font = cmtt10 char=13
level=9 font = cmtt10 char=13
level=8 font = cmtt10 char=13
level=7 font = cmtt10 char=13
level=6 font = cmtt10 char=13
level=5 font = cmtt10 char=13
level=4 font = cmtt10 char=13
level=3 font = cmtt10 char=13
level=2 font = cmtt10 char=13
level=1 font = cmtt10 char=13
level=0 font = cmtt10 char=39
!Sorry, DVIcopy capacity exceeded [recursion=10].
答案1
这按要求工作(与上面的不同之处仅在于cmtt10
更改为mycmtt10
)
tftopl cmtt10.tfm > mycmtt10.vpl
patch <<EOF
--- mycmtt10.vpl
+++ mycmtt10.vpl
@@ -1,3 +1,4 @@
+(MAPFONT D 0 (FONTNAME cmtt10))
(FAMILY CMTT)
(FACE O 352)
(CODINGSCHEME TEX TYPEWRITER TEXT)
@@ -192,6 +193,7 @@
(CHARACTER O 47
(CHARWD R 0.524996)
(CHARHT R 0.611112)
+ (MAP (SETCHAR O 15))
)
(CHARACTER O 50
(CHARWD R 0.524996)
EOF
vptovf mycmtt10.vpl
rm mycmtt10.vpl
为了可移植性,编译如下:
tex -jobname test '\font\tentt=mycmtt10 \input test.tex'