ラベル LaTeX の投稿を表示しています。 すべての投稿を表示
ラベル LaTeX の投稿を表示しています。 すべての投稿を表示

1.13.2011

Making dvipdfmx's Output Landscape

I use platex and dvipdfmx to publish *.pdf from *.tex, and Texlipse to write *.tex. Texlipse is the Eclipse's plug-in for composing tex docs. In some cases, I have to publish *.pdf in a landscape style. When using command line, it can be achieved by "l" option.
$ platex foo.tex
$ platex foo.tex
$ divpdfmx -l foo.dvi
Of course, this option is available even if I use it through Texlipse. However, it is not so smart to change configure Texlipse's option for each *.tex. After exploring the web, I found how to include this option in *.tex. That is achieved by adding a following line into *.tex.
\AtBeginDvi{\special{landscape}}

Reference:
http://xtori.blogspot.com/2010/01/texlandscape.html
情報処理学会で指定されてる論文のフォーマットが用紙を横向きに使うものなんですが,
lscape パッケージを利用しても dvipdfmx で出力される PDF は縦向き….
コマンドラインから横向きに出力するには
$ platex hoge.tex
$ platex hoge.tex
$ divpdfmx -l hoge.dvi
とやればいいのですが,普段 Texlipse (Eclipse の tex 用プラグイン) からコンパイルをしているので
パラメータやらオプションやらを文書毎に指定するのは非常に面倒.
そこで調べてみたらドンピシャな記事を発見したのでメモ.

研究な日々: TexでLandscape
http://xtori.blogspot.com/2010/01/texlandscape.html

tex ファイルに以下の記述をすると,dvipdfmx の方で横向きに出力してくれるとのこと.
\AtBeginDvi{\special{landscape}}
実際に試したところ,l オプションを付けなくても横向きに出力されるようになりました.

10.08.2010

** ERROR ** Could not find encoding file "H".

Cygwin 上の日本語 LaTeX 環境で
** ERROR ** Could not find encoding file "H".
というエラーが出たときの対処についてのメモです.
おそらく Linux でも同様に対応可能だと思います.


状況
tex -> dvi -> pdf と生成するために platex, dvipdfmx を使って以下のようにしているのですが,
別件で ghostscript をアップデートしてから dvipdfmx 実行中に前述のエラーが出るようになりました.
% platex hoge.tex
% dvipdfmx hoge


対処
どうやら有名なエラーらしく,フォントの読み込みに失敗している模様.
ghostscript のアップデートにより,フォント関係のパスが変わったことが原因のようでした.
結論としては以下のコマンドで正常に動作するようになりました.
% ln -s /usr/share/ghostscript/8.50/Resource/ /usr/local/teTeX/share/texmf/dvipdfm/
% mktexlsr
このときフォントの位置は ghostscript のバージョンやインストール先によって異なります.また,リンクを配置すべき位置も tex をどこにインストールしたかによって異なりますが, mktexlsr 実行時に出力されるディレクトリがヒントになると思います.
当方の環境では以下のようになっていました.
% mktexlsr
mktexlsr: Updating /usr/local/teTeX/share/texmf/ls-R...
mktexlsr: Updating /usr/local/teTeX/share/texmf-config/ls-R...
mktexlsr: Updating /usr/local/teTeX/share/texmf-dist/ls-R...
mktexlsr: Updating /usr/local/teTeX/share/texmf-var/ls-R...
mktexlsr: Done.

以下の位置にシンボリックリンクを張っている例を多数見かけたので,そのまま同じようにしてまったく問題解決できなくてハマっていました.フォントへのリンクを張り直したのにうまくいかない方はリンクを置く位置をよく確認してみてください.
/usr/share/texmf/dvipdfm/