Debianサーバ構築編
2010/07/01
このページが動いているサーバは,Debianで構築されています.
Debianは大型計算機から,デスクトップ,低スペックの録画サーバまで(例が変?),
様々なスケールのシステムに利用できます.
このサーバ構築の方法について,順を追って記録しておきます.
--- Environment --- C:\usr\dviout\dviout.exe dviout : Ver 3.18.1 (July 20, 2006) OS : Windows2000 Version 6.0 (4 日本語 (日本)) ←つまり,Vistaです.Windows Vista Business 32bit. comctl32.dll : Version 5.82 shell32.dll : Version 6.0 printer : Brother HL-5070DN series(1200dpi) TeX 3.1415926 (Web2C 7.5.7) pTeX 3.1415926-p3.1.10 (sjis) (Web2C 7.5.7) dvips(k) p1.7b dvipdfmx-20090115(cvs) GPL Ghostscript 8.64 (2009-02-03) TEXMF="" TEXMFMAIN="" TEXMFCNF="" GS_LIB="" PATH="C:\Program Files\ImageMagick-6.5.7-Q16;C:\Program Files\ImageMagick-6.5.5-Q16;C:\Program Files\Intel\WiFi\bin\;c:\l2h\zlib\bin;c:\l2h\tool;c:\l2h\tiff\bin;c:\l2h\rle\bin;c:\l2h\png\bin;c:\l2h\netpbm\bin;c:\l2h\jpeg\bin;c:\l2h\jbigkit\bin;C:\MinGW\bin;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\gs\gs8.64\lib;C:\gs\gs8.64\bin;C:\usr\bin;C:\Program Files\Lenovo\Client Security Solution;C:\Program Files\ThinkPad\ConnectUtilities\;c:\Program Files\Common Files\Lenovo;C:\Windows\System32\Wbem;C:\Windows;C:\Windows\system32;C:\PROGRA~1\JUSTSY~1\JSLIB32;C:\Perl\bin;C:\Perl\site\bin;C:\Program Files\ThinkPad\Bluetooth Software\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\JustSystems\JSLIB32;C:\Software\gfortran\libexec\gcc\i586-pc-mingw32\4.5.0;C:\Software\MinGW\bin;C:\borland\bcc55\Bin;c:\l2h\jbigkit\bin;c:\l2h\jpeg\bin;c:\l2h\netpbm\bin;c:\l2h\png\bin;c:\l2h\rle\bin;c:\l2h\tiff\bin;c:\l2h\tool;c:\l2h\zlib\bin;C:\borland\bcc55\Bin;C:\Software\gnuplot\bin;C:\Program Files\OpenVPN\bin;C:\Software\pstoedit;C:\Software\potrace-1.8.win32-i386;C:\Software\gfortran\libexec\gcc\i586-pc-mingw32\4.5.0;C:\Software\MinGW\bin;" --- parameters --- multi=4 dpi=600 GS=16 gsx="C:\gs\gs8.64\bin\gswin32c.exe " spi=c:\usr\dviout ToEdit=^c^V gen="`C:\usr\bin\mktexpk.exe --dpi ^d --bdpi ^D --mag ^M ^s" Wshow=+ TEXROOT=C:\usr\share\texmf\fonts;C:\usr\share\texmf-local\fonts TEXPK=^r\tfm\\^s^tfm;^r\pk\\^s.^dpk;^r\vf\\^s.vf;^r\ovf\\^s.ovf;^r\tfm\\^s.tfm --- End ---
#self.tmp_path = tempfile.mkdtemp() self.tmp_path = 'c:/tmp/textext/' self.tmp_base = 'tmp'730行付近.パスを消す必要はないのでそれをコメントアウトします.
def remove_temp_files(self): """Remove temporary files""" base = os.path.join(self.tmp_path, self.tmp_base) for filename in glob.glob(base + '*'): self.try_remove(filename) #self.try_remove(self.tmp_path)この2個所の編集で,ちゃんとTeX記法で数式が打てるようになるはずです.
import inkex import codecs import os, sys, tempfile, traceback, glob, re, md5, copy from lxml import etree720行目付近
# Convert TeX to PDF # Write tex f_tex = open(self.tmp('tex'), 'w') try: #f_tex.write(texwrapper) sjis_tex = codecs.getwriter('shift_jis')(f_tex) sjis_tex.write(texwrapper) finally: f_tex.close() # Exec pdflatex: tex -> pdf #exec_command(['pdflatex', self.tmp('tex')] + latexOpts) exec_command(['platex', self.tmp('tex')] + latexOpts) exec_command(['dvipdfmx', self.tmp('dvi')]) if not os.path.exists(self.tmp('pdf')): raise RuntimeError("pdflatex didn't produce output")850行目付近
# Exec pstoedit: pdf -> svg exec_command(['gswin32c', '-dSAFER', '-q', '-dBATCH', '-dNOPAUSE', '-sDEVICE=epswrite', '-dEPSCrop', '-r9600', '-sOutputFile='+self.tmp('eps'), self.tmp('pdf')]) exec_command(['pstoedit', '-f', 'plot-svg', self.tmp('eps'), self.tmp('svg')] + pstoeditOpts)これで,日本語化ができたと思います.