質問用フォーラムです。ご質問の前に質問のしかたをご覧ください。

(e)-(u)pTeX において読み込む TCX ファイルの指定方法

- yudai-nkt の投稿

次のような plain TeX ファイルを用意してタブ文字を foo.out に書き込もうとすると,pdfTeX と LuaTeX では意図通りタブ文字が書き込まれる一方で,(e)-(u)pTeX では 2 行とも ^^I が書き込まれます(XeTeX と Knuthian TeX も同様です).

\newwrite\tmp
\immediate\openout\tmp=foo.out
\begingroup
  \catcode`\^^I=12  % ASCII TAB
  \immediate\write\tmp{^^I}
  \immediate\write\tmp{ }  % ブレース内はタブ文字をベタ書き
\endgroup
\immediate\closeout\tmp
\bye

TeX.SX のこの回答によると,TCX ファイルというものによって左右されるそうで,TUG の Web サイトに従って %& -translate-file=cp227.tcx をファイル冒頭に加えると,ログを見る限りは

This is pTeX, Version 3.14159265-p3.7.1 (utf8.euc) (TeX Live 2017) (preloaded format=ptex 2017.11.17)  25 NOV 2017 10:09
 restricted \write18 enabled.
 %&-line parsing enabled.
 (/usr/local/texlive/2017/texmf-dist/web2c/cp227.tcx)
**mwe.tex
(./mwe.tex
\tmp=\write0
\openout0 = `foo.out'.

 )
No pages of output.

cp227.tcx が読み込まれていそうなのですが,foo.out には依然 ^^I が書き込まれています.一方で cp227.tcx を使用したフォーマットを作成して利用すると,タブ文字が書き込まれます.

XeTeX で同様のことをすると (WARNING: translate-file "cp227.tcx" ignored) と警告が出て,Knuthian TeX ではそもそも %&-line parsing enabled. になりませんでした.TUG の Web サイトに記載されていた方法がいずれのエンジンでも機能しないのですが,すくなくとも (e)-(u)pTeX においてはどのようにすれば TCX ファイルの指定ができるのでしょうか?この件で TCX ファイルというものをはじめて知ったこともありほとんど何も知らないので,「そもそも (e)-(u)pTeX で cp227.tcx を読み込むのは危険だ」などということがあれば,あわせてご教授いただければ幸いです.

なお,OS X EL Capitan 上で TeX Live 2017 を使用しています.


何故このようなことをしているのかが見えづらいと思うので簡単に理由を述べますと,TikZ パッケージの external ライブラリが提供する Makefile 生成機能を upLaTeX においても利用可能にしたいのがそもそもの動機です.

超初心者ですお教えください

- 伊藤 静一 の投稿
「LaTex2e美文書作成入門」を頼りにレポートを作成しました。その後サンプル文書を頂き開きましたら、逆スラッシュが%_になっており、日本語のところが化けていました。詳しい知識がないのにエンコードをIsoLatin9にマクロを使って変更しました。最初に書いたレポートも同じ状態になってしまいました。
元にもどしたいのです。PCはマックです。なお、最初のレポート作成時には、逆スラッシュが「シフト+¥」で出ましたが、今は「シフト+¥」ですと¥yenと表示されてしまいます。以上よろしくお願いいたします。

ページをまたがるリンクに警告

- Toshio Otaguro の投稿
自力で解決できないので,ここに質問します.

長い日本語の文章の中で,hyperrefパッケージの\hrefマクロを使って日本語の文字列にURLへのリンクを張っています.

ちょっと長めのリンクがたまたまページをまたぐと,dvipdfmxが以下のようなwarningを出し,リンク文字列のうち,改ページ前の文字列には正しくリンクが張られるのですが,改ページ後の文字列にはリンクが張られません.

dvipdfmx:warning: Can't begin an annotation when one is pending.
dvipdfmx:warning: Interpreting special command bann (pdf:) failed.
dvipdfmx:warning: >> at page="187" position="(120.084, 100.742)" (in PDF)
dvipdfmx:warning: >> xxx "pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 0]/C[0 1 1]/A<..."
dvipdfmx:warning: >> Reading special command stopped around >><</Type/Annot/Subtype/Link/Border[0 0 0]/C[0 1 1]/A<</S/URI/...<<
][188
dvipdfmx:warning: Tried to end an annotation without starting one!
dvipdfmx:warning: Interpreting special command eann (pdf:) failed.
dvipdfmx:warning: >> at page="188" position="(103.661, 623.287)" (in PDF)
dvipdfmx:warning: >> xxx "pdf:eann"

これを解決するにはどのようにすればよいでしょうか?なお,リンクを貼る文字列はURLではなく普通の文字列なので,\hrefの代わりに\urlを使うという回避策は取れないと思っています.

なお,hyperrefパッケージのオプションbreaklinksをtrueにしても状況は変わりません.
また,システムはUbuntu上のTeXLive2017で,tlmgrで常に最新版にアップデートしているつもりです.
プリアンブルは以下のとおりです.

\documentclass[uplatex,dvipdfmx,ja=standard,b5j,11pt,openany]{bxjsbook}
\usepackage[deluxe]{otf} % for multiple typefaces (see below)
\usepackage[sourcehan-otc,unicode]{pxchfon}

\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{lmodern}
\usepackage{ascmac}
\usepackage{mflogo}
\usepackage{makeidx}

\usepackage[dvipdfmx, colorlinks=true, bookmarks=true, bookmarksnumbered=true, %
bookmarkstype=toc, filecolor=blue, urlcolor=blue, linkcolor=blue, %
linktocpage=true, citecolor=red, menucolor=black, %
pdfnewwindow=true, breaklinks=false]{hyperref}
\usepackage{pxjahyper} % not necessary for most cases

\renewcommand{\footnotesize}{\fontsize{9pt}{11pt}\selectfont}
\makeatletter
\ifcase \@ptsize
\setlength{\footnotesep}{9pt}
\or
\setlength{\footnotesep}{10pt}
\or
\setlength{\footnotesep}{11pt}
\fi
\makeatother

美文書第7版のDVDでTex Liveの設定が完了しない

- zephyrus24 の投稿
美文書第7版のDVDを使用してwindows10へのインストールを試みています。
研究室のPCには問題なくインストールが完了しました。MAC(High Sierra)へも
問題なくインストールできました。
しかし、自宅のPC(windows10Pro CPUi7-2600k 3.40GHz RAM32GB)にインスト
ールしようとすると、インストールがすべて完了し、インストール用ウインド
ウを閉じ、小さなTex Liveのセットアップ用ウインドウが開かれた段階で、シ
ステムから「bibunnsyoは動作を停止しました。問題が発生したため、プログ
ラムが正しく動作しなくなりました。プログラムは閉じられ、解決策がある場
合にはWindowsから通知されます。」と表示されてしまって、Tex Liveの設定
が完了しません。
インストールは完了していますので、Texworksを立ち上げることは可能です
し、第7版の説明にあるようなタイプセット等の設定も可能です。しかし、
MACや研究室で作成したTex文書をコンパイルするとつれなく
This is ptex2pdf[.lua] version 0.9.

Processing ○○○.tex

ptex2pdf processing of ○○○.tex failed.

となってしまいます。(○○○.texはTex文書のファイル名)

インストール時にすべてのアプリを閉じ、ウイルス対策ソフトを切ってやって

みても結果は同じでした。

管理者権限でインストールしようとすると、「コマンドの構文が誤っていま

す。(終了コードは255)」となってインストールできません。

どなたか解決策をご存じないでしょうか。

どうぞよろしくお願いいたします。

脚注が適切な位置に現れない

- 宮沢 弘 の投稿
論文で、1ページ目の下に、脚注番号を付けずに脚注を入れようと思い、以下のようなtexファイルを作ったのですが、脚注が、INTRODUCTIONの上に現れてしまいます。また、脚注番号もついてしまいます。どうしたらよいでしょうか?

\documentstyle[a4,12pt]{article}

\textheight=23cm
\textwidth=16cm

\begin{document}

\title{{\bf CONSIDERATIONS IN THE FOOTNOTE}}

\author{Nagano Matsumoto\\ National Institute of Informatics\\ 2-1-2 Hitotsubashi, Chiyoda-ku, Tokyo 101-8430, Japan\\ {e-mail: keiji@nii.ac.jp} \vspace{2em}\\
Hiroshi Miyazawa \\ Faculty of Mathematics, Kyushu University\\ 744 Motooka, Nishi-ku, Fukuoka-city, Fukuoka 819-0385, Japan\\ {e-mail: miyazawa@math.kyushu-u.ac.jp}}
\date{}
\maketitle
\footnote{}{It has been published in the Quantum Communication Meeting held in 1996 and was appeared in Quantum Communication, Computing, and Measurement, Pllenum Press, pp. 381-386}
\section{INTRODUCTION}
\quad The purpose of this study is to investigate time-energy uncertainty relation from the viewpoint of hypothesis testing.

\end{document}

日本語でハイフネーション(?)処理を操作する方法について

- 長迫 真平 の投稿

日本語において、単語の最中で文字が次の行に回り込むことは許されていますが、表の中などでは、単語が意図しない場所で分割されることは避けたいと思っています。

例えば、

ポケットモンスターオーシャン

と言う、ポケットモンスターシリーズのゲームタイトルがあったと仮定して、

「ポケットモンスター(改行)オーシャン」だと、ポケットモンスターシリーズのゲームタイトルだと受け入れられるため、問題ないわけですが、「ポケットモン(改行)スターオーシャン」だと、異なるゲームタイトルである「スターオーシャンシリーズ」に「ポケットモン」と言う何かがあるのかと誤解を受ける恐れがあります。力技で全角スペースを適当に埋めればそれらしくできますが、美しくないし、大変です。

その辺を、ポケットモンスターやウルトラマンなど、ハイフネーション(?)を禁止する単語をプリアンブル等に羅列することで定義できるような、何かスマートな方法はあるのでしょうか?

以上、よろしくお願いします。

newcommandでの定義の部分的な変更はできますか?

- 佐々木 新一 の投稿
\newcommand{\bangou}[1]{%
\ifcase #1\or (1)\or (2)\or (3)\or (4)\or (5)\or (6)\or
(7)\or (8)\or (9)\or (10)\or (11)\or (12)\or (13)\or
(14)\or (15)\or (16)\or (17)\or (18)\or (19)\or (20)\or
(21)\or (22)\or (23)\or (24)\or (25)\or (26)\fi}

この定義をたとえば,\bangou{3} で(3)ですが,\bangou{3}で(X)となるように,部分的に変更する記述のしかたはありませんか?
ご存知でしたら教えてください.(_ _;)

tex writerと文字コード

- rah mtk の投稿
初めて質問させていただきます。よろしくお願いします。
普段はパソコンで原稿を作成しています(texworks、文字コードshift-JIS)。今日はたまたまiPadで編集しようと、Dropboxを介して、あるファイルをtex writerで開いてしました。 tex writerはshift-JISに対応していなくて、UTF8のみだと思うのですが、意識せず開いてしまい(ここですでに文字化け)、一瞬コンパイルボタンも押してしまいました。そのままDropboxのファイルも上書きされてしまい、パソコンの方へ戻ると文字化けしていました。初めは、UTF8で保存されただけかと思い、texworks下部の文字コードの変換をしてみましたが、うまくいきませんでした。
さらに、nkfも試したのですが、これもうまくいきません。(すでに文字化けした原稿ファイルをコピーして)試したのは、
1、nkf -g foo.tex (結果はutf8)
2、nkf -s foo.tex > foo2.tex
3、nkf -w ~
4、nkf -S -w ~
5、nkf -S -s ~
など、考えられる操作はしてみたのですが、うまくいきません。
どうにか文字を元に戻したいのですが、ご存じのことがありましたら、ご教授いただけると幸いです。よろしくお願いします。
(説明不足の箇所があり、追加しました。よろしくお願いします。)

High Sierra にアップしたらコンパイルできなくなりました

- 坂本 の投稿
本日 High Sierra にアップしました。
システムのアップに関しては以前も苦労しましたので注意していましたが、Sierra から High Sieera だから問題なかろうと思ってアップしてしましました。
その後、タイプセットをクリックすると、次のようなログファイルが出てきました。問題はどこにあるかお教え下さい。

This is ptex2pdf[.lua] version 0.9.

Processing 譁ーA_3_蝗ウ 蠖「.tex

This is e-pTeX, Version 3.14159265-p3.7-160201-2.6 (sjis.euc) (TeX Live 2016) (preloaded format=platex)

restricted ¥write18 enabled.

entering extended mode

(./^96A_3_^9b 綵「.tex

pLaTeX2e <2016/11/29> (based on LaTeX2e <2016/03/31> patch level 3)

Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.


(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/platex/base/jarticle

.cls

Document Class: jarticle 2016/11/22 v1.7b Standard pLaTeX class


(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/platex/base/jsize11.

clo)) (./skmt_macros.sty

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/platex/base/ascmac.s

ty

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/platex/base/tascmac.

sty))

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/amsmath/amsmat

h.sty

For additional information on amsmath, use the `?' option.


(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/amsmath/amstex

t.sty

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/amsmath/amsgen

.sty))

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/amsmath/amsbsy

.sty)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/amsmath/amsopn

.sty))

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/tools/array.st

y)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/amsfonts/amssy

mb.sty

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/amsfonts/amsfo

nts.sty))

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/curves/curves.

sty)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/eepic/eepic.st

y

Extension to Epic and LaTeX. Version 1.1e - Released Dec 21, 1999

)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/eepic/epic.sty

Enhancements to Picture Environment. Version 1.2 - Released June 1, 1986

)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/fancybox/fancy

box.sty

Style option: `fancybox' v1.4 <2010/05/15> (tvz)

)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/graphics/graph

ics.sty

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/graphics/trig.

sty)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/graphics-cfg/g

raphics.cfg)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/graphics-def/d

vips.def))

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/graphics/graph

icx.sty

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/graphics/keyva

l.sty))

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/base/latexsym.

sty)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/platex/japanese-otf-

uptex/otf.sty

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/platex/japanese-otf/

ajmacros.sty))) (./^96A_3_^9b 綵「.aux)


LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <40> not available

(Font) size <24.88> substituted on input line 22.



LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <50> not available

(Font) size <24.88> substituted on input line 23.


[1] (./^96A_3_^9b 綵「.toc

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/amsfonts/umsa.

fd)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/amsfonts/umsb.

fd)

(/Applications/TeXLive/Library/texlive/2016/texmf-dist/tex/latex/base/ulasy.fd)

) [2]

Overfull ¥hbox (0.65903pt too wide) in paragraph at lines 158--158

[][][]


Overfull ¥hbox (0.65903pt too wide) in paragraph at lines 187--187

[][][]

[3] [4] [5]

Overfull ¥hbox (0.4pt too wide) in paragraph at lines 338--411

[]

[6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]

(./^96A_3_^9b 綵「.aux)


LaTeX Font Warning: Size substitutions with differences

(Font) up to 25.12pt have occurred.


)

(see the transcript file for additional information)

Output written on "^96A_3_^9b 綵「.dvi" (19 pages, 139300 bytes).

SyncTeX written on "譁ーA_3_蝗ウ 蠖「.synctex.gz"

Transcript written on "^96A_3_^9b 綵「.log".

譁ーA_3_蝗ウ 蠖「.dvi -> 譁ーA_3_蝗ウ 蠖「.pdf

[1

dvipdfmx:warning: Could not locate a virtual/physical font for TFM "hminr-h".

dvipdfmx:warning: >> This font is mapped to a physical font "HiraginoSerif-W3.ttc".

dvipdfmx:warning: >> Please check if kpathsea library can find this font: HiraginoSerif-W3.ttc

dvipdfmx:fatal: Cannot proceed without .vf or "physical" font for PDF output...


Output file removed.

ptex2pdf processing of 譁ーA_3_蝗ウ 蠖「.tex failed.


文字列に含まれるアラビア数字のカーニングについて

- S T の投稿
いつもお世話になります。
文字列に含まれるアラビア数字のカーニングについて違和感があり、下記の質問をしたいと思います。
1. 下記に提示する例のように文字列の中のアラビア数字の前後に配置されるアキが大きな気がしますが、これは一般的なのでしょうか(アキが大きいと感じる自分がおかしいのか)。
2. アラビア数字を含む文字列をLaTeXで記述するときに、特別な記法があるのでしょうか。
3. 文字列内のアラビア数字の前後を詰めるとしたら、どのような方法があるのでしょうか。
以上3点です。

%#!lualatex
\documentclass{ltjsarticle}
%\usepackage{times}
\begin{document}
HbA1c refers to glycated haemoglobin (A1c).
\end{document}

よろしくお願いします。
Timesの方がより主旨が伝わると思うので、timesパッケージを使った場合を添付します。
添付 HbA1c-times.png