
我想確保我可以為每個輸入文件的圖表和文字內容加載相同的字體。這與我下面的陳述有關,
儘管 PSTricks 不能
pdflatex
直接使用,但它確實不會打擾我們,因為敏捷用戶(採用最佳實踐範例「關注點分離」)知道圖表應該與文字內容分開。這意味著每個圖表都應該放在一個單獨的、獨立的、但可編譯的輸入檔中。對於 PSTricks,該圖的輸入檔必須按順序編譯latex-dvips-ps2pdf
。它的產品是PDF格式的圖表,可用於pdflatex
編譯主輸入檔(即包含文字文件的輸入檔)。是否有意義?
和
我們可以創建自己的套件
common.sty
來載入常用設定(字體等)。然後可以從每個輸入文件(圖表或文字文件)載入該套件。因此,圖表中使用的字體(以及其他常見設定)與文字文件中使用的字體完全相同。
那麼有沒有什麼字體只能載入pdflatex
而不能載入呢latex-dvips-ps2pdf
?如果沒有這樣的字體,我就處於安全位置。
答案1
大多數「標準」TeX 字體都可以由兩者加載pdflatex
,latex
因此適用於任一途徑。
然而,pdfTeX 與 TeX 不同,可以.ttf
直接使用 truetype ( ) 字型。所以你需要避免使用這類字體。使用這些的包包並不多。兩個是winfonts
和gtamacfonts
。
您可以輕鬆檢查您的套件是否使用此類字體。建立包含各種類型的文字和數學的範例文檔,確保包含一些使用者可能需要的內容。編譯pdflatex
並檢查它在 PDF 檢視器中或使用pdffonts
.
pdffonts
這是我最近產生的文檔的輸出:
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
CCNYNY+LMRomanCaps10-Regular Type 1 Custom yes yes no 105 0
FDLWIA+LMRoman8-Regular Type 1 Custom yes yes no 106 0
CCNYNY+LMRomanCaps10-Regular Type 1 Custom yes yes no 107 0
FDLWIA+LMRoman8-Regular Type 1 Custom yes yes no 108 0
GVOTOJ+LMRoman10-Bold Type 1 Custom yes yes no 109 0
PUROLC+Webdings TrueType WinAnsi yes yes no 110 0
DictSym Type 1 Builtin yes no no 111 0
ZWSJHO+AppleSymbols TrueType WinAnsi yes yes no 112 0
UIRPQW+wasy10 Type 1 Builtin yes yes no 113 0
CPKUDH+LMMathSymbols7-Regular Type 1 Custom yes yes no 114 0
ZISKEU+LMRoman7-Regular Type 1 Custom yes yes no 115 0
ZISKEU+LMRoman7-Regular Type 1 Custom yes yes no 116 0
ZNZYUX+MarVoSym Type 1 Builtin yes yes no 117 0
XTZZTM+Archaic-Linear-B Type 1 Builtin yes yes no 118 0
ZISKEU+LMRoman7-Regular Type 1 Custom yes yes no 119 0
EEVCBJ+LMRoman10-Regular Type 1 Custom yes yes no 120 0
KUEEZQ+Dingbats Type 1 Builtin yes yes no 121 0
INSJOE+Wingdings2 TrueType WinAnsi yes yes no 122 0
QIJIVE+Wingdings TrueType WinAnsi yes yes no 123 0
NBXRIW+LMRoman5-Bold Type 1 Custom yes yes no 124 0
CSLKTL+SkakNew-Figurine Type 1 Builtin yes yes no 125 0
KSIRXI+LMRoman5-Regular Type 1 Custom yes yes no 126 0
BTAZIL+Archaic-Poor-Mans-Hieroglyphs Type 1 Builtin yes yes no 127 0
VERRCN+phaistos Type 1 Builtin yes yes no 128 0
ZFJTFV+LMMathExtension10-Regular Type 1 Custom yes yes no 129 0
EEVCBJ+LMRoman10-Regular Type 1 Custom yes yes no 130 0
IFGYIN+HoeflerText-Ornaments TrueType WinAnsi yes yes no 131 0
BHBUPA+LMRoman7-Bold Type 1 Custom yes yes no 132 0
ZISKEU+LMRoman7-Regular Type 1 Custom yes yes no 133 0
QMGXWG+LMRoman8-Italic Type 1 Custom yes yes no 134 0
GBNVNG+LMRoman10-BoldItalic Type 1 Custom yes yes no 135 0
GBNVNG+LMRoman10-BoldItalic Type 1 Custom yes yes no 136 0
NCZUCO+LMRoman12-Bold Type 1 Custom yes yes no 137 0
GENWMA+LMRoman8-Bold Type 1 Custom yes yes no 138 0
GENWMA+LMRoman8-Bold Type 1 Custom yes yes no 139 0
GENWMA+LMRoman8-Bold Type 1 Custom yes yes no 140 0
GVOTOJ+LMRoman10-Bold Type 1 Custom yes yes no 141 0
QGFRJE+MSAM7 Type 1 Builtin yes yes no 142 0
向下查看列表,TrueType
第二列中的所有行都會有問題。所有有的線都Type 1
可以。 [請注意,我特意選擇了一個使用大量 truetype 字體的文檔來進行演示。我產生的絕大多數文件都更為典型,根本不包含任何 truetype 字體。
另一件需要注意的事情是元字體。它們可以與 TeX 和 pdfTeX 一起使用,但在許多 PDF 檢視器(特別是acroread
AdAdobe Reader)中渲染效果非常差。如果您使用「標準」TeX 字體,請確保cm-super
安裝並\usepackage[T1]{fontenc}
包含字體或使用 Latin Modern 是避免此陷阱的好方法。