在Windows 7下使用dblatex将DocBook问题转换为PDF

时间:2013-07-11 11:51:50

标签: docbook pdflatex dblatex

我一直在使用WinL下的DBLaTeX使用AsciiDoc到PDF工具链一段时间没有(主要)问题。但是,试图让同一工具链在Win 7下工作我遇到了一些问题。我不确定我是否遗漏了一些明显的东西,或者它是否实际上是一个Win 7问题。

问题似乎与图像路径有关,在处理图像元素时,pdflatex(与MikTeX一起安装)会出现扼流圈。现在,我对DocBook,XSLT,LaTeX等的知识/理解充其量也很差。但是,看起来pdflatex将\img中的\zoso.png.\img\zoso.png视为(两个)处理指令。 目录分隔符应该是正斜杠而不是反斜杠吗?

当我查看详细输出时,我看到dblatex XSL样式表应用于源XML文档以生成.rtex文件作为第一阶段。在这个文件中,目录分隔符实际上是正斜杠(如源XML文件中所示)。但是,生成的.tex文件(我假设是pdflatex转换为PDF的源)这些正斜杠现在是反斜杠。

我试图在下面提供尽可能多的信息,但如果我错过任何关键/有用的信息,我会道歉。有没有人有任何想法如何解决这个问题?提前谢谢!

OS:
  Windows 7企业版64位,SP1

已安装工具
  AsciiDoc:8.6.8
  Python:2.7.5
  dblatex:0.3.4
  libxml2:2.7.8
  libxslt:1.1.26
  iconv:1.9.2
  zlib:1.2.5
  MiKTeX:2.9 64位

命令:

python C:/bin/Python27\scripts\dblatex --verbose --texinputs="C:/bin/Python27/share/dblatex/latex/contrib/db2latex" --xsl-user="C:/bin/Python27/share/dblatex/latex/contrib/db2latex/param-db2latex-sa.xsl" --texstyle="db2latex-sa" --param toc.section.depth=3 --param doc.section.depth=3 --param draft.mode=yes "C:\bin\asciidoc-custom\install-test\cf-sa-asciidoc-customisation_test.xml"

命令输出:

Build the book set list...
xsltproc -o c:\users\wstubben\appdata\local\temp\tmpemvwua\doclist.txt --xinclude --xincludestyle doclist.xsl C:\bin\asciidoc-custom\install-test\cf-sa-asciidoc-customisation_test.xml
Build the listings...
xsltproc -o c:\users\wstubben\appdata\local\temp\tmpemvwua\listings.xml --xinclude --xincludestyle --param current.dir 'C:\bin\asciidoc-custom\install-test' C:\bin\Python27\share\dblatex\xsl\common\mklistings.xsl C:\bin\asciidoc-custom\install-test\cf-sa-asciidoc-customisation_test.xml xsltproc -o cf-sa-asciidoc-customisation_test.rtex --xinclude --xincludestyle --param current.dir 'C:\bin\asciidoc-custom\install-test' --param listings.xml 'c:\users\wstubben\appdata\local\temp\tmpemvwua\listings.xml' c:\users\wstubben\appdata\local\temp\tmpemvwua\custom.xsl C:\bin\asciidoc-custom\install-test\cf-sa-asciidoc-customisation_test.xml
XSLT stylesheets DocBook - LaTeX 2e (0.3.4)
===================================================
Build cf-sa-asciidoc-customisation_test.pdf
built-in module pdftex registered
no support found for ifxetex
no support found for fontspec
no support found for xltxtra
no support found for fontenc
no support found for inputenc
no support found for fancybox
built-in module makeidx registered
no support found for db2latex-sa
building additional files...
checking if compiling is necessary...
the output file doesn't exist
pdflatex -interaction=batchmode cf-sa-asciidoc-customisation_test.tex
pdflatex: No connection could be made because the target machine actively refused it.
pdflatex: Data: connect failed in tcp_connect()
pdflatex failed
c:\users\wstubben\appdata\local\temp\tmpemvwua\cf-sa-asciidoc-customisation_test.tex:115: Undefined control sequence \img.
c:\users\wstubben\appdata\local\temp\tmpemvwua\cf-sa-asciidoc-customisation_test.tex:115: leading text: ...spectratio=true]{.\img\zoso.png}}}}{Zoso}
c:\users\wstubben\appdata\local\temp\tmpemvwua\cf-sa-asciidoc-customisation_test.tex:115: Undefined control sequence \zoso.
c:\users\wstubben\appdata\local\temp\tmpemvwua\cf-sa-asciidoc-customisation_test.tex:115: leading text: ...spectratio=true]{.\img\zoso.png}}}}{Zoso}
c:\users\wstubben\appdata\local\temp\tmpemvwua\cf-sa-asciidoc-customisation_test.tex:115: Undefined control sequence \img.
c:\users\wstubben\appdata\local\temp\tmpemvwua\cf-sa-asciidoc-customisation_test.tex:115: leading text: ...spectratio=true]{.\img\zoso.png}}}}{Zoso}
c:\users\wstubben\appdata\local\temp\tmpemvwua\cf-sa-asciidoc-customisation_test.tex:115: Undefined control sequence \zoso.
c:\users\wstubben\appdata\local\temp\tmpemvwua\cf-sa-asciidoc-customisation_test.tex:115: leading text: ...spectratio=true]{.\img\zoso.png}}}}{Zoso}
Unexpected error occured
Error: pdflatex compilation failed

XML文件片段

<mediaobject>
  <imageobject>
  <imagedata fileref="./img/zoso.png"/>
  </imageobject>
  <textobject><phrase>Zoso</phrase></textobject>
</mediaobject>

rtex file snip

\begin{center}
\imgexists{./img/zoso.png}{{\imgevalsize{./img/zoso.png}{\includegraphics[width=imgwidth,height=\imgheight,keepaspectratio=true]{./img/zoso.png}}}}{ͰtZosoͱt}\end{center}

tex文件片段

\begin{center}
\imgexists{.\img\zoso.png}{{\imgevalsize{.\img\zoso.png}{\includegraphics[width=\imgwidth,height=\imgheight,keepaspectratio=true]{.\img\zoso.png}}}}{Zoso}\end{center}

干杯,

2 个答案:

答案 0 :(得分:1)

经过大量测试后,我发现问题在于安装了dblatex版本,或者更具体地说是安装了它的dbtexmf版本。安装dblatex版本 0.3 (而不是最新版本,当前 0.3.4 )解决了这个问题。

希望能帮助有同样问题的人。

干杯,

答案 1 :(得分:0)

是;大多数TeX实现(我在Windows上都知道)将glady句柄“/”作为路径分隔符;但“\”始终被视为反斜杠,因此启动TeX命令。