ご質問はこちらへ
数式記号に日本語フォントを使うには
本文をリュウミンRとCentury Old Style、囲み記事を新ゴMで組んでいるのですが、本文の数式では
数字、=、+、-、×、±、μ、εなどの記号はリュウミンR
アルファベットはCentury Old Style
囲み記事は数式もすべて新ゴM
という指示が入ってきました。
texファイルにおいてアルファベット、数字、=、+、-は1バイトにしており、×は\times、±は\pm、μは\mu、εは\varepsilonと書いてあります。連分数やルート、下付き添え字、上付き添え字、別行建て数式は多用されています。
プリアンブル部かマクロを書いて一発で指定する方法はあるでしょうか。
pdfcrypt.exe による PDFの暗号化について
pdfcrypt.exe を使ったPDFの暗号化を試みました.
foo.pdf を暗号化したのが new.pdf とします.
-------------------------------
C:\Users\Desktop> pdfcrypt foo.pdf new.pdf
Input owner password: *******
Input user password: ******
PDF document encryptor
Reading foo.pdf
java.io.IOException: Rebuild failed: trailer not found.; Original message: trail
er not found.
at com.lowagie.text.pdf.PdfReader.readPdf(Unknown Source)
at com.lowagie.text.pdf.PdfReader.<init>(Unknown Source)
at com.lowagie.text.pdf.PdfReader.<init>(Unknown Source)
at encrypt_pdf.main(encrypt_pdf.java:56)
-------------------------------
なにやら Java に関連したエラーが出てきたようですが理解できません.よろしくお願いします.
(追)
試行錯誤の結果,
dvipdfmx で生成された foo.pdf のPDF versionは 1.5 のときは上記のエラーになりますが,
versionを 1.4 に下げて実行すると,正しく暗号化されました.
-------------------------------
C:\Users\Desktop> pdfcrypt foo.pdf new.pdf
Input owner password: *******
Input user password: ******
PDF document encryptor
Reading foo.pdf
Writing new.pdf
Done.
-------------------------------
(1)pdfcrypt.exe は上記のように,1.4 ならば正常に処理できましたが,
単純にPDFのversionの問題と考えてよいと思いますがどうでしょうか?
(dvipdfmo で更にversionを下げて 1.2 あるいは 1.3 にして実験したところ成功しました)
(2)上記に関連したものですが
texmf-dist/tex/generic/oberdiekに pdfcrypt.sty がありますが,PDFTEX-W32.txt を読むと
pdfeTeX では、pdfcrypt 機能が削除されたとあります.上記の pdfcrypt.exe を使うようにとのこと
ですので,pdfcrypt.sty は不要になったと考えて宜しいのでしょうか.
LuaLaTeX-ja のコンパイル時間が異常に長い.
sourceforge.jp/projects/luatex-ja/wiki/LuaTeX-ja
にある sample.tex を使いコンパイルしてみました.
コンパイル経過の一部は次の通りです.
C:\Users\Desktop> luajitlatex sample.tex
-----------------------
This is LuajitTeX, Version beta-0.77.0 (TeX Live 2013/W32TeX) (rev 47)
(中途略)
Module luatexbase-mcb warning: several functions in 'define_font',
(luatexbase-mcb) only one will be active.
(c:/w32tex/share/texmf-dist/tex/luatex/luatex-ja/ltj-base.sty)
(c:/w32tex/share/texmf-dist/tex/luatex/luatex-ja/ltj-latex.sty
(c:/w32tex/share/texmf-dist/tex/luatex/luatex-ja/patches/lltjfont.sty)
(c:/w32tex/share/texmf-dist/tex/luatex/luatex-ja/patches/lltjdefs.sty
luaotfload | db : Version mismatch; expected 2.207, got 2.203
luaotfload | db : Force rebuild
(ここで約10分経過しました)
(c:/w32tex/share/texmf-dist/tex/luatex/luatex-ja/jfm-ujis.lua)
luaotfload | db : Version mismatch; expected 2.207, got 2.203
luaotfload | db : Force rebuild
(ここで約10分経過しました)
luaotfload | db : Version mismatch; expected 2.207, got 2.203
luaotfload | db : Force rebuild
(延々と続く)
※ 結局,コンパイル開始から約1時間経過後,
luaotfload | db : Force rebuildAttempt to allocate memory failed.
となり,コンパイルは失敗で終了しました.
-----------------------
このようにコンパイル時間が異常に長い原因に対処するにはどうすれば
よいでしょうか?
Emacsで編集したTeXファイルの日本語が表示されず困っています.
TeXファイルはeuc-japan形式とutf-8の両方を試し,Mac OS X 10.7.5,Emacs24.3を使っています.
platex -versionを実行すると
pTeX 3.1415926-p3.4-110825-2.6 (utf8.euc)
のように表示されます.また,platexでTeXファイルをコンパイルすると
! Text line contains an invalid character.
と表示され,無理矢理xdviでプレビューするとターミナルに残るログに
xdvi-xaw: Warning: Character 9277 not defined in font cmr10
のように表示されます(日本語に対応する部分のエラー?).
Googleで探しまわりましたが対応策が見つからず,お手上げ状態です.よろしくおねがいします.
A new program: ps2otfps.exe
dvipsk-w32.tar.xz および win64/dvipsk-w64.tar.xz に新しいプログラム ps2otfps.exe を入れました。 これは Japanese OpenType fonts を用いて dvips によって 作成された PostSctipt ファイルを Ghostscript で 扱えるように書き換える簡単なプログラムです。 ユーザがしなければいけないことは、OpenType fonts を PostScript 名で Ghostscript の Resource/CIDFont に コピーして置くことだけです。 Resource/Font に沢山の ファイルを作成しておく必要はありません。 ただし今のところ、サポートする OpenType fonts は HiraginoPro, HiraginoProN, KozukaPro, KozukaPr6N だけです。 また元の PS ファイルにバイナリ データは無いものと仮定しています。 やっていることは簡単で、 例えば、dvips で作成した次の test.ps %!PS-Adobe-2.0 %%Creator: dvips(k) 5.993 Copyright 2013 Radical Eye Software %%Title: test.dvi %%CreationDate: Mon Sep 30 11:41:08 2013 %%Pages: 1 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%DocumentFonts: HiraMinPro-W3-H CMR10 %%DocumentPaperSizes: a4 %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -u+hiragino-ps test %DVIPSParameters: dpi=600 %DVIPSSource: TeX output 2013.09.30:1139 %%BeginProcSet: tex.pro 0 0 ... ... を ps2otfps test.ps test1.ps で変換すると、test1.ps は %!PS-Adobe-2.0 %%Creator: dvips(k) 5.993 Copyright 2013 Radical Eye Software %%Title: test.dvi %%CreationDate: Mon Sep 30 11:41:08 2013 %%Pages: 1 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%DocumentFonts: HiraMinPro-W3-H CMR10 %%BeginFont: HiraMinPro-W3-H /HiraMinPro-W3-H /H /CMap findresource [/HiraMinPro-W3 /CIDFont findresource] composefont pop %%EndFont %%DocumentPaperSizes: a4 %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -u+hiragino-ps test %DVIPSParameters: dpi=600 %DVIPSSource: TeX output 2013.09.30:1139 %%BeginProcSet: tex.pro 0 0 ... ... のようになって、 Ghostscript で扱えるようになります。
dvipfmx で pdfmfnt.map が見つからない
使う分には支障は無いのですが気になります。
C:\Users\tony\Documents>dvipdfmx --help
** WARNING ** Couldn't open font map file "pdfmfnt.map".
This is dvipdfmx-20130923 by the DVIPDFMx project team,
modified for TeX Live,
an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks.
Copyright (C) 2002-2013 by the DVIPDFMx project team
This is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Usage: dvipdfmx [options] dvifile
-c Ignore color specials (for B&W printing)
-d number Set PDF decimal digits (0-5) [2]
-f filename Set font map file name [cid-x.map]
-g dimension Annotation "grow" amount [0.0in]
-l Landscape mode
-m number Set additional magnification [1.0]
-o filename Set output file name [dvifile.pdf]
-p papersize Set papersize [a4]
-q Be quiet
-r resolution Set resolution (in DPI) for raster fonts [600]
-s pages Select page ranges (-)
-t Embed thumbnail images of PNG format [dvifile.1]
-x dimension Set horizontal offset [1.0in]
-y dimension Set vertical offset [1.0in]
-z number Set zlib compression level (0-9) [9]
-v Be verbose
-vv Be more verbose
-C number Specify miscellaneous option flags [0]:
0x0001 reserved
0x0002 Use semi-transparent filling for tpic shading command,
instead of opaque gray color. (requires PDF 1.4)
0x0004 Treat all CIDFont as fixed-pitch font.
0x0008 Do not replace duplicate fontmap entries.
0x0010 Do not optimize PDF destinations.
Positive values are always ORed with previously given flags.
And negative values replace old values.
-D template PS->PDF conversion command line template [none]
-E Enable DVIPDFM emulation mode
-I number Image cache life in hours [-2]
0: erase all old images and leave new images
-1: erase all old images and also erase new images
-2: ignore image cache
-K number Encryption key length [40]
-O number Set maximum depth of open bookmark items [0]
-P number Set permission flags for PDF encryption [0x003C]
-S Enable PDF encryption
-V number Set PDF minor version [4]
All dimensions entered on the command line are "true" TeX dimensions.
Argument of "-s" lists physical page ranges separated by commas, e.g., "-s 1-3,5
-6"
Papersize is specified by paper format (e.g., "a4") or by w<unit>,h<unit> (e.g.,
"20cm,30cm").
Please type "dvipdfmx -vh" for the list of available paper formats.
updmap で作成されるのは dvipdfm.map でした。以前は pdfmfnt.map が作成されていたように思いました。
何か勘違いをしているのでしょうか。
C:\Users\tony\Documents>updmap
Working with cm.map ...
Working with cmextra.map ...
Working with cyrillic.map ...
Working with euler.map ...
Working with latxfont.map ...
Working with symbols.map ...
Working with lm.map ...
Working with fpls.map ...
Working with xypic.map ...
I updated psfonts.map.
I updated pdftex.map.
I updated dvipdfm.map.
I updated pspksupp.map.