更新 1

更新 1

这本身不是 MWE,但它是我将问题归结为的代码。注意:它不会产生错误。

问题是,一旦我以某种方式设法获取任何 TikZ 或 pgfplots 图形的错误(由于任何类型的失误:缺少括号、分号或任何其他东西,我猜),--shell-escape -halt- on-error -interaction=batchmode -jobname就会出现错误消息“ ”(等等......)。然而,据我所知,所有图形和对它们的编辑都得到了正确的生成。但消息不会消失。

我现在对这一切一无所知。与外部化的 TikZ/pgfplots-graphics 相关的漏洞是什么?如能得到任何帮助或提示,我们将不胜感激。:)

笔记

仅当我删除/注释掉时,错误消息才会消失

  • 每个命令后面都有一个footnotetext- 和- 命令,或者\addtocounterfiguretikzpicture

  • \tikzexternalize

编辑器(TeXstudio)有什么不同吗?

  • F1不,无论我是在 TeXstudio 中运行还是从命令行运行 pdflatex,问题都以相同的方式出现。

从 Windows cmd 运行 pdflatex 的日志

http://pastebin.com/vHqE5isd

从 Windows cmd 运行 pdflatex --shell-escape 的日志

http://pastebin.com/0JZCij4T

平均能量损失

\documentclass[
a4paper
]{scrartcl}

\usepackage{
    newtxtext,
    amsmath,
    subcaption,
    biblatex
}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{tikz}
\usetikzlibrary{
    external,
}
\tikzexternalize

\listfiles

\begin{document}
\begin{figure}[tp]
    \begin{minipage}[b]{0.48\linewidth}
        \centering
        a\\
        \begin{tikzpicture}
        \draw (0,0) rectangle (1,1);
        \end{tikzpicture}
        \subcaption[Something short.]{Something longer. So there is some text.\footnotemark\footnotemark}
    \end{minipage}
    \hfill
    \begin{minipage}[b]{0.48\linewidth}
        \centering
        b\\
        \begin{tikzpicture}
        \draw (0,0) rectangle (1,1);
        \end{tikzpicture}
        \subcaption[Text.]{Some longer text and a few words}
    \end{minipage}
\end{figure}
\addtocounter{footnote}{-2}
\footnotetext{\cite[Cp.][12]{Smith}}
\addtocounter{footnote}{1}
\footnotetext{\cite[Cp.][23]{Jones}}



\end{document}

与 TikZ 和 pgfplots 相关的前言及样式定义

%% TikZ

\usetikzlibrary{
    external,
    plotmarks,
    math,
    calc,trees,shadows,positioning,arrows,chains,
    decorations.pathreplacing,
    decorations.pathmorphing,
    decorations.shapes,
    decorations.text,
    shapes,
    shapes.geometric,
    shapes.symbols,
    matrix,
    patterns,
    intersections,
    fit
}
\tikzexternalize

\pgfdeclarelayer{background layer}
\pgfdeclarelayer{foreground layer}
\pgfsetlayers{background layer,main,foreground layer}

%% pgfplots

\usepgfplotslibrary{
    groupplots,
    external
    }

\pgfplotsset{
every axis/.append style={
%%
%tick label style = {font=\sffamily\small\sansmath},
%every axis label = {font=\sffamily\small\sansmath},
%legend style = {font=\sffamily\small\sansmath},
%label style = {font=\sffamily\small\sansmath},
%
xmajorgrids={true},
ymajorgrids={true},
xminorgrids={true},
yminorgrids={true},
%
%line width=1pt,
%thick,
%
minor tick num=1,
%axis lines=middle,
%tick align=center,
compat=1.10,
},
every tick/.append style={
black,
thick
},
/pgf/number format/.cd,
use comma,
1000 sep={\,},
}

\tikzexternalize

文件列表

*File List*
scrartcl.cls    2013/12/19 v3.12 KOMA-Script document class (article)
scrkbase.sty    2013/12/19 v3.12 KOMA-Script package (KOMA-Script-dependent bas
ics and keyval usage)
 scrbase.sty    2013/12/19 v3.12 KOMA-Script package (KOMA-Script-independent b
asics and keyval usage)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
scrlfile.sty    2013/12/19 v3.12 KOMA-Script package (loading files)
tocbasic.sty    2013/12/19 v3.12 KOMA-Script package (handling toc-files)
scrsize11pt.clo    2013/12/19 v3.12 KOMA-Script font size class option (11pt)
typearea.sty    2013/12/19 v3.12 KOMA-Script package (type area)
newtxtext.sty    2014/04/07 v1.25
fontaxes.sty    2014/03/23 v1.0d Font selection axes
 xkeyval.sty    2012/10/14 v2.6b package option processing (HA)
 xkeyval.tex    2012/10/14 v2.6b key=value parser (HA)
etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
textcomp.sty    2005/09/27 v1.99g Standard LaTeX package
  ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
 amsmath.sty    2013/01/14 v2.14 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
subcaption.sty    2013/02/03 v1.1-62 Sub-captions (AR)
 caption.sty    2013/05/02 v3.3-89 Customizing captions (AR)
caption3.sty    2013/05/02 v1.6-88 caption3 kernel (AR)
biblatex.sty    2013/11/25 v2.8a programmable bibliographies (PK/JW/AB)
biblatex2.sty    2013/11/25 v2.8a programmable bibliographies (biber) (PK/JW/AB
)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
  logreq.sty    2010/08/04 v1.0 xml request logger
  logreq.def    2010/08/04 v1.0 logreq spec v1.0
  ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
  blx-dm.def
biblatex-dm.cfg
blx-compat.def    2013/11/25 v2.8a biblatex compatibility (PK/JW/AB)
biblatex.def    
standard.bbx    2013/11/25 v2.8a biblatex bibliography style (PK/JW/AB)
 numeric.bbx    2013/11/25 v2.8a biblatex bibliography style (PK/JW/AB)
 numeric.cbx    2013/11/25 v2.8a biblatex citation style (PK/JW/AB)
biblatex.cfg    
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
inputenc.sty    2008/03/30 v1.1d Input encoding file
    utf8.def    2008/04/05 v1.1m UTF-8 support for inputenc
   t1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  ot1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  omsenc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  ts1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
    tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)
     pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)
  pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
  pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
 english.lbx    2013/11/25 v2.8a biblatex localization (PK/JW/AB)
  ts1cmr.fd    1999/05/25 v2.5h Standard LaTeX font definitions
 t1ntxrx.fd    2012/12/25 v1.0
supp-pdf.mkii
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 ***********

答案1

您发现了不兼容性:external库和biblatex\cite[][]语法不兼容。


该错误已修复;将成为下一个稳定的 PGF 的一部分。


根据 K04_4.log 中提供的附加信息,TeX$在处理时需要一个符号\cite[Vgl.][421]{PuenteLeon_2012_Messtechnik}。我猜这可能与下划线有关:它是数学模式下的保留标记,并且$如果它存在于普通文本中则需要。显然,你的不是普通文本 - 但如果它在外部化过程中变成普通文本怎么办?

\cite[Cp.][23]{Jones_a}无论如何,如果您写下\cite[Cp.][23]{Jones}(我引入了下划线),则可以将您的示例转变为“真正的”最小(非)工作示例。

该错误是外部库重新定义\cite以捕获所有未定义的符号并将它们作为警告传达到原始 .tex 文件的日志文件中。这个收集警告的功能最多需要一组方括号,\cite但无法处理您的警告。这需要修复;我会处理它(无需提交额外的错误报告)。

目前的一个解决方法是禁用此功能,该功能用于传达未解析的\cite命令。此解决方法的风险:您可能没有意识到外部化图像包含\cite无法解析的。在您的最小示例中,没有 tikzpicture 环境甚至包含\cite,因此它完全无害。

以下是解决方法的示例:

\documentclass[
a4paper
]{scrartcl}

\usepackage{
    amsmath,
    subcaption,
    biblatex
}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{tikz}
\usetikzlibrary{
    external,
}
\tikzexternalize[
    failed ref warnings for={%
        \ref,%
        %\cite,% DISABLE THIS
        \pageref},
]

\listfiles

\begin{document}
\begin{figure}[tp]
    \begin{minipage}[b]{0.48\linewidth}
        \centering
        a\\
        \begin{tikzpicture}
        \draw (0,0) rectangle (1,1);
        \end{tikzpicture}
        \subcaption[Something short.]{Something longer. So there is some text.\footnotemark\footnotemark}
    \end{minipage}
    \hfill
    \begin{minipage}[b]{0.48\linewidth}
        \centering
        b\\
        \begin{tikzpicture}
        \draw (0,0) rectangle (1,1);
        \end{tikzpicture}
        \subcaption[Text.]{Some longer text and a few words}
    \end{minipage}
\end{figure}
\addtocounter{footnote}{-2}
\footnotetext{\cite[Cp.][12]{Smith}}
\addtocounter{footnote}{1}
\footnotetext{\cite[Cp.][23]{Jones_a}}



\end{document}

答案2

抱歉,但我没有足够的评论。我正在使用 TeXlipse 和 MikTeX,从上面复制并粘贴您的代码后出现以下错误:

Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interaction=batchmode -jobname "document-figure0" "\def\tikzexternalrealjob{document}\input{document}"' did NOT result in a usable output file 'document-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in 'document-figure0.log'. If you continue now, I'll try to typeset the picture. \end{tikzpicture} (followed by: )

它说document-figure0无法创建,所以我自己手动创建了一个document-figure0.pdf(错误消息中还给出了其他扩展名)之后两个tikzpicture地区的两个错误都消失了,因为无法创建 pdf 文件

document-figure0.pdf: xpdf: reading PDF image failed
pdflatex.exe>  ==> Fatal error occurred, no output PDF file produced!

希望这有助于向前迈进一步。

更新 1

我将用几张图片来详细阐述我的答案!但简而言之,添加--shell-escape命令行开关就pdflatex.exe可以了。

错误

在此处输入图片描述

编辑命令行

在此处输入图片描述

解决了

我实际上将第二个矩形的高度改为 2,以强制两个不同的 MD5 总和,但这当然也适用于您的初始示例 在此处输入图片描述

tex.se 上还有其他帖子,我想链接到它们。所以请参阅1234

更新 2

我忘了说什么亨利称为与 TikZ 和 pgfplots 相关的前言及样式定义在 external.tex 文件中,他的平均能量损失部分位于 document.tex 文件中。我在序言中使用它(如果有其他意图,请纠正我)。

\usepackage{pgfplots}
\input{external.tex}

我必须意识到亨利甚至知道这一切:5

相关内容