TeXの非互換性2009年07月28日 12時43分05秒

文書データの互換性を確保するために私は昔からテキストファイルとTeX文書でドキュメントを作成することを進めてきました。

今回の10年以上前のLaTeX文書も現在の環境において何の問題もなく利用できるものと思っていました。

TeXは互換性という意味では一般的にはお勧め出来ないかも

要するに、ずっと昔から常にTeX環境の動向を追い続けている人たちにしか互換性は維持されていないかも、という印象です。

例えば以下のソースは処理できません。

\documentstyle{jarticle}
\begin{document}
\begin{equation}
V=V(x_0, \ldots, x_n)= \left(
  \begin{array}{cccc}
   1 & 1 & \cdots & 1 \\
   x_0 & x_1 & \cdots & x_n \\
   \vdots & \vdots & & \vdots \\
   x_0^n & x_1^n & \cdots & x_n^n
  \end{array}
  \right)
\end{equation}
\end{document}

これはTeXのすすめのサンプルです。

これを「latex sample.tex」というように処理させようとすると以下のエラーが出ます。

This is e-TeXk, Version 3.1415926-2.2 (Web2C 2009) (format=latex 2009.7.12)  28 JUL 2009 12:40
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**sample.tex
(./sample.tex
LaTeX2e <2005/12/01>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, german-x-2008-06-18, ngerman-x-2008-06-18, ancientgreek, ibycus, ar
abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc
h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono
greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, la
tin, latvian, lithuanian, mongolian, mongolian2a, bokmal, nynorsk, polish, port
uguese, romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedi
sh, turkish, ukenglish, ukrainian, uppersorbian, welsh, loaded.
(c:/tex/share/texmf/tex/latex/base/latex209.def
File: latex209.def 1998/05/13 v0.52 Standard LaTeX file


          Entering LaTeX 2.09 COMPATIBILITY MODE


*************************************************************
    !!WARNING!!    !!WARNING!!    !!WARNING!!    !!WARNING!!   

 This mode attempts to provide an emulation of the LaTeX 2.09
 author environment so that OLD documents can be successfully
 processed. It should NOT be used for NEW documents!
 
 New documents should use Standard LaTeX conventions and start
 with the \documentclass command.
 
 Compatibility mode is UNLIKELY TO WORK with LaTeX 2.09 style
 files that change any internal macros, especially not with
 those that change the FONT SELECTION or OUTPUT ROUTINES.
 
 Therefore such style files MUST BE UPDATED to use
          Current Standard LaTeX: LaTeX2e.
 If you suspect that you may be using such a style file, which
 is probably very, very old by now, then you should attempt to
 get it updated by sending a copy of this error message to the
 author of that file.
  *************************************************************

\footheight=\dimen102
\@maxsep=\dimen103
\@dblmaxsep=\dimen104
\@cla=\count79
\@clb=\count80
\mscount=\count81
(c:/tex/share/texmf/tex/latex/base/tracefnt.sty
Package: tracefnt 1997/05/29 v3.0j Standard LaTeX package (font tracing)
\tracingfonts=\count82
LaTeX Info: Redefining \selectfont on input line 101.
)
\symbold=\mathgroup4
\symsans=\mathgroup5
\symtypewriter=\mathgroup6
\symitalic=\mathgroup7
\symsmallcaps=\mathgroup8
\symslanted=\mathgroup9
LaTeX Font Info:    Redeclaring math alphabet \mathbf on input line 293.
LaTeX Font Info:    Redeclaring math alphabet \mathsf on input line 294.
LaTeX Font Info:    Redeclaring math alphabet \mathtt on input line 295.
LaTeX Font Info:    Redeclaring math alphabet \mathit on input line 301.
LaTeX Info: Redefining \em on input line 311.

(c:/tex/share/texmf/tex/latex/base/latexsym.sty
Package: latexsym 1998/08/17 v2.2e Standard LaTeX package (lasy symbols)
\symlasy=\mathgroup10
LaTeX Font Info:    Overwriting symbol font `lasy' in version `bold'
(Font)                  U/lasy/m/n --> U/lasy/b/n on input line 47.
)
LaTeX Font Info:    Redeclaring math delimiter \lgroup on input line 375.
LaTeX Font Info:    Redeclaring math delimiter \rgroup on input line 377.
LaTeX Font Info:    Redeclaring math delimiter \bracevert on input line 379.

(c:/tex/share/texmf/tex/latex/config/latex209.cfg
(c:/tex/share/texmf/tex/latex/tools/rawfonts.sty
Compatibility mode: package `' requested, but `rawfonts' provided.
Package: rawfonts 1994/05/08 Low-level LaTeX 2.09 font compatibility

(c:/tex/share/texmf/tex/latex/tools/somedefs.sty
Package: somedefs 1994/06/01 v0.03 Toolkit for optional definitions
)
LaTeX Font Info:    Try loading font information for U+lasy on input line 44.

(c:/tex/share/texmf/tex/latex/base/ulasy.fd
File: ulasy.fd 1998/08/17 v2.2e LaTeX symbol font definitions
))))
(c:/tex/share/texmf/tex/jlatex/base/jarticle.cls)
(c:/tex/share/texmf/tex/jlatex/base/j-article.cls
Document Class: j-article 2000/05/19 v1.4b Standard JLaTeX document class
(c:/tex/share/texmf/tex/jlatex/base/j-size10.clo
File: j-size10.clo 2000/05/19 v1.4b Standard JLaTeX file (size option)

(c:/tex/share/texmf/tex/jlatex/base/jresize10.clo)
! Illegal unit of measure (pt inserted).
<to be read again> 
                   z
l.101   \setlength\parindent{1zw}
                                 
? 
! Emergency stop.
<to be read again> 
                   z
l.101   \setlength\parindent{1zw}
                                 
End of file on the terminal!
 
 
Here is how much of TeX's memory you used:
 372 strings out of 494448
 4390 string characters out of 1163007
 48908 words of memory out of 1500000
 3538 multiletter control sequences out of 15000+50000
 18987 words of font info for 72 fonts, out of 2000000 for 2000
 714 hyphenation exceptions out of 8191
 22i,0n,20p,301b,82s stack positions out of 3000i,500n,5000p,500000b,5000s
No pages of output.

訂正(latexコマンドではなくplatexコマンドを使う)

latexコマンドで処理できなかった上記のソースですが、platexコマンドの実行で処理できました。

ちょっと久しぶりに使う人間だと気付かないかも。

とは言え、どっちにしろ私の作成文書には処理できないものが多いようです。

ひとつひとつ解決していく根性もないので、結局処理できないドキュメントは捨てられることになってしまうでしょう。

バカらしいな。自分でTeXを推進してたのに・・・

例えば以下を使っている部分は正常処理できていません。

  • supertabular環境を使ったもの
  • picture環境を使ったもの
  • {\normalsize 文字}をつかったもの(文字に#が含まれるもの)

TeXインストールエラー「JsclassesのGetInfoで例外が発生しました」対応2009年07月27日 22時33分29秒

10年以上前に作成したLaTeXのドキュメントを久々に確認しようとおもいましたが、最近購入したパソコンの環境の全てにおいてLaTeX環境はインストールしていませんでした。

そこで簡単にインストールする方法を検索したところ、阿部紀行氏の作成したTeXインストーラというものがあるということがわかりました。
全体のインストールはこちらが詳しいでしょう。

ところが、私の環境ではインストールの最初の段階でエラーが出ます。同じ症状の人も結構検索すると見つかります。

ということで以下に対応について整理してみます。

現象

インストールの初期段階で「JsclassesのGetInfoで例外が発生しました」というエラーダイヤログが表示されて先に進めません。
ログには「Jsclasses::GetInfo : getaddrinfo: no address associated with hostname.」または「Jsclasses::GetInfo : 接続済みの呼び出し先が一定の時間を過ぎても正しく応答しなかったため、接続できませんでした。または接続済みのホストが応答しなかったため、確立された接続は失敗しました。 - connect(2)」と格納されていると思います。
現象としては作者の掲示板の「jsclassesについて」と同じです。

この掲示板ではインストーラとしてのエラーは解決していません。

対応方法

以下の概要で対応できます。インストーラの機能をあくまでも使うということが前提です。
  1. 奥村さんのページからjsclasses本体をダウンロード
  2. ダウンロードしたjsclasses.zipをkakuto3フォルダにコピーする
  3. kakuto3\pluginフォルダにあるjsclasses.rbファイルを修正する

jsclasses.rbの修正内容

奥村さんのページからダウンロードするURLが記述されている部分をローカル指定に変えてしまいます。

修正結果は以下のようになります。要は13行目のURLを「file://」の形式に変更して57行目から87行目をコメントにして「http:チェックをはずす」ということです。

require 'net/http'
require 'uri'
require 'time'

Net::HTTP.version_1_2

class JsclassesClass
	
	def initialize
		@ini = ""
		@log = ""
		
		@url = "file:///c:/kakuto3/jsclasses.zip"
		@size = 0
		@success = false
		@definstall = true
		return true
	end
	
	def Info
		return [{"softname" => "jsclasses", "info" => "奥村さんによる日本語用のクラスファイルです."}]
	end
	
	
	def Init(ini,log)
		@ini = ini
		@log = log
	end
	
	
	def IsNeedReboot()
		return false
	end
	
	
	def IsNeedSetting(soft)
		return false
	end
	
	
	def Set(hwnd,soft)
		return
	end
	
	
	def GetInfo(hwnd)
		Log("jsclassesの情報取得開始");
		if Kakuto3::GETINIINT(@ini,"Connect","UseNetwork") == 0 then
			begin
				@definstall = File.exist?(Kakuto3::GETINISTR(@ini,"Dir","Hozon") + "jsclasses.zip");
			rescue
				@definstall = false;
			end
			return true;
		end
		uri = URI.parse(@url);
#		if uri.scheme != "http" then
#			Log("httpでないとダメです.");
#			return false;
#		end
#		Kakuto3::ADDMESSAGE(hwnd,"\r\n\r\n♪jsclassesの情報取得開始♪\r\n");
#
#		response = nil;
#		Kakuto3::ADDMESSAGE(hwnd,uri.host + "に接続し情報を取得します.\r\n");
#		
#		proxy = Kakuto3::GETINISTR(@ini,"Connect","Proxy");
#		if proxy == "" then
#			proxydata = Kakuto3::GETIEPROXYINFO();
#			if proxydata == nil || proxydata["server"] == "" then
#				proxy = nil;
#				proxyport = nil;
#			else
#				proxy = proxydata["server"];
#				proxyport = proxydata["port"];
#			end
#		else
#			proxyport = Kakuto3::GETINIINT(@ini,"Connect","Port");
#		end;
#		Net::HTTP::Proxy(proxy,proxyport).start(uri.host){|http|
#			response = http.head(uri.path);
#		}
#		Log(uri.host + "に接続成功");
#		if response == nil then
#			Kakuto3::ADDMESSAGE(hwnd,"情報取得に失敗.\r\n")
#			Log("情報取得に失敗.")
#			return false
#		end
		
		begin
			localtime = File.atime(Kakuto3::GETINISTR(@ini,"Dir","Hozon") + "jsclasses.zip");
			@size = response['Content-Length'].to_i
			nettime = Time.parse(response['last-modified']) + 120
			@definstall = (localtime < nettime)
		rescue
			@definstall = true
		end
		
		Log("jsclassesの情報取得終了")
		Kakuto3::ADDMESSAGE(hwnd,"完了\r\n")
		@success = true
		return true
	end
	
	
	def GetDownloadData(soft)
		if Kakuto3::GETINIINT(@ini,"Connect","UseNetwork") == 0 then
			return {
				"success" => true,
				"downnum" => 0,
				"dls" => []};
		else
			return {
				"success" => @success,
				"downnum" => 1,
				"dls" => [{
					"url" => @url,
					"file" => "jsclasses.zip",
					"size" => @size}]};
		end
	end
	
	
	def IsDefaultInstall(soft)
		return @definstall
	end
	
	
	def Install(hwnd,soft)
	# 2007/08/03 W32TeXがptexディレクトリをなくす
#		dir = Kakuto3::GETINISTR(@ini,"Dir","Install") + "share\\texmf-local\\ptex\\platex\\jsclasses\\"
		dir = Kakuto3::GETINISTR(@ini,"Dir","Install") + "share\\texmf-local\\tex\\platex\\jsclasses\\"
		from = Kakuto3::GETINISTR(@ini,"Dir","Hozon") + "jsclasses.zip"
		Kakuto3::ADDMESSAGE(hwnd,"jsclassesのインストール……")
		if Kakuto3::ZIPDLG(hwnd,from,dir) then
			Kakuto3::ADDMESSAGE(hwnd,"成功\r\n")
			Log("jsclassesのインストールに成功")
			return true
		else
			Kakuto3::ADDMESSAGE(hwnd,"失敗\r\n")
			Log("jsclassesのインストールに失敗")
			return false
		end
	end
	
	
private
	def Log(l)
		begin
			fp = File.open(@log,"a+")
		rescue
			return
		end
		fp.write(l + "\n");
		fp.close()
	end
	
end

Jsclasses = JsclassesClass.new

考察

スクリプトを修正してから再度インストーラを実行するとインストーラはエラーを出さずに先に進めるはずです。
私の想像ですが、この現象は接続しているプロバイダなどの環境に依存しているのではないかと思います。

ということで私の接続環境を書いておきます。

  • Bフレッツマンションタイプ
  • VDSL接続
  • asahi-net
  • WebCaster V100
  • バッファローBBR-4HG
  • WindowsXP Professional SP3