【问题标题】:Issue with DocBook to PDF using dblatex under Windows 7在 Windows 7 下使用 dblatex 将 DocBook 转换为 PDF 的问题
【发布时间】:2013-07-11 11:51:49
【问题描述】:

我在 Win XP 下使用 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 的源文件)这些正斜杠现在是反斜杠。

我已尝试在下面提供尽可能多的信息,但如果我遗漏了任何重要/有用的信息,我深表歉意。有谁知道如何解决这个问题?提前致谢!

操作系统:
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 文件片段

\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}

干杯,

【问题讨论】:

    标签: docbook pdflatex dblatex


    【解决方案1】:

    经过大量测试,我发现问题出在安装的 dblatex 版本上,或者更具体地说,是与它一起安装的 dbtexmf 版本。安装 dblatex0.3 版本(而不是最新的,目前是 0.3.4)解决了这个问题。

    希望对遇到同样问题的人有所帮助。

    干杯,

    【讨论】:

      【解决方案2】:

      是的;大多数 TeX 实现(我在 Windows 上所知道的)很乐意将“/”作为路径分隔符处理;但是“\”总是被视为反斜杠,因此启动了一个 TeX 命令。

      【讨论】:

      • 谢谢。你有什么想法/为什么正斜杠被转换为反斜杠?看起来 XSLT 将 XML 转换为具有正斜杠的 .rtex 文件。但是,我不确定 .rtex 文件在链中如何/在何处转换为 .tex。
      猜你喜欢
      • 1970-01-01
      • 2016-03-22
      • 2020-09-19
      • 1970-01-01
      • 2017-01-24
      • 2023-04-04
      • 1970-01-01
      • 2021-11-17
      • 2011-02-16
      相关资源
      最近更新 更多