我在我的文档中使用独立功能来节省处理pgfplots
图表时的一些编译时间。
现在有一个图,它显示了非常奇怪的行为includestandalone
。它已经工作了很长时间,但自上周以来,在\includestandalone
包含主文件时,这 25 个图中只有这个图停止工作。没有出现错误消息,只是图没有显示。将 包含到tikzpicture
主文件中将不会出现任何问题,并且单独编译独立文件也将不会出现错误。
日志文件显示:
独立包警告:文件“Image.tex”的子序言已更改。内容将被忽略。请重新运行 LaTeX!
在输入行 11 上。
第六次重新运行后,什么都没有改变。这是错误还是功能?还是我做错了什么?我正在使用MikTex 2.9_6618更新并使用 lualatex 进行编译
我找到了这个独立包及其 subpreambles 选项会忽略独立输入文件的内容(如果其词汇表条目中包含重音符号)但由于我没有使用glossaries
或inputenc
解决方案对我没有帮助。
以下是图片:
\documentclass{standalone}
\onlyifstandalone{%
\usepackage{luatex85}
\usepackage[ngerman]{babel}
\usepackage{standalone}}
\usepackage{pgfplots}
\usepackage{siunitx}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{units}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
grid=major,
xlabel= Spannung $U$,
x unit=\si{\volt},
unit markings=slash space,
ylabel= Strom $O$,
y unit=\si{\milli\ampere},
minor x tick num={4},
xmin=0,
ymin=0,
xmax=3.0,
ymax=0.9,
xtick={0,0.50,...,3.0},
legend cell align=left,
legend plot pos =none,
legend pos=outer north east,
width=0.60\textwidth
]
\addplot[smooth,very thick] table[x=X, y=Y, col sep=semicolon] {Images/Vektorgrafik/StromSpannung/series_c.csv};
\addlegendentry{a) GaAs $E_g\approx1.4$ \si{\electronvolt} }
\node at(axis cs:1.17,0.65){$(a)$};
\end{axis}
\end{tikzpicture}
\end{document}
以下是拒绝显示图片的文档的 MWE:
\RequirePackage{luatex85,shellesc} % Alias für luatex Kommandos an altes PDFlatex und Modul für altes shell escape
\documentclass[
english,
ngerman, %Spracheinstellung, wird an Pakete weitergegeben (Hauptsprache Dok)
paper=a5, %Seitenformat a5
twoside=on, %Zweiseitiges Dokument
DIV=calc, %Seitenteilung, Ränder
BCOR=4mm, %Bindekorrektur 12mm für Buchbindung
fontsize=10pt, %Schriftgröße eigentlich 9
toc=listof, %Verzeichnisse ins Inhaltsverzeichnis
toc=bibliography, %Literaturverzeichnis ins Inhaltverzeichnis
toc=flat, %Literaturverzeichnis wird linksbündig gesetzt und tabellarisch (flat),
listof=flat, %Macht aus dem Abbildungsverzeichnis eine Tabelle, die automatisch den Raum für Nummern ermittelt
% draft, %Entwurfsmodus
numbers=auto, %kein abschnließender Punkt hinter Nummerierungen
headings=small, %kleinere Überschriften
titlepage=true, %mit Titelseite
headinclude=true, %Kopfzeile in die Seitenberechnung aufnehmen
footinclude=false, %Fußzeile nicht in die Seitenberechnung aufnehmen
captions=tableheading, %Abstand der Tabellenüberschrift angepasst
pagesize=auto, %Automatische Seitenkorrektur für Ausgabetreiber
appendixprefix, %Nummerierung für den Anhang
open=any %Kapitel auf jeder neuen Seite beginnen
]{scrbook}
\usepackage[subpreambles=true,sort=true,print=false,mode=tex]{standalone}
\usepackage{ifluatex}
\ifluatex
\usepackage{fontspec}
\usepackage{babel}
\addto\extrasenglish{\useshorthands{"}\languageshorthands{ngerman}}
%\setmainfont{Latin Modern Roman}
%\setsansfont{Latin Modern Sans}
%\setmonofont{Latin Modern Mono}
%\setmainfont{Linux Libertine O}
%\setsansfont{Linux Biolinum O}
%\setmonofont{Droid Sans Mono}
\usepackage{selnolig}
\else
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{babel}
\addto\extrasenglish{\useshorthands{"}\languageshorthands{ngerman}}
\fi
\usepackage{import}
\usepackage{standalone}
\usepackage{siunitx}
\begin{document}
\begin{figure}[htb]
\includestandalone[mode=tex]{Images/Vektorgrafik/StromSpannung/StromSpannung}
\caption{Image \label{fig:Image}}
\end{figure}
\end{document}
以下是series_c.csv
X;Y
1.055046e+00 ; 0.000000e+00
1.220183e+00 ; 4.854369e-03
1.311927e+00 ; 4.368932e-02
1.330275e+00 ; 1.456311e-01
1.348624e+00 ; 3.543689e-01
1.366972e+00 ; 6.165049e-01
1.385321e+00 ; 8.300971e-01
1.394495e+00 ; 9.951456e-01
这是文件列表
*File List*
luatex85.sty 2016/06/15 v1.4 pdftex aliases for luatex
shellesc.sty 2016/06/07 v0.02a unified shell escape interface for LaTeX
scrbook.cls 2017/09/07 v3.24 KOMA-Script document class (book)
scrkbase.sty 2017/09/07 v3.24 KOMA-Script package (KOMA-Script-dependent basi
cs and keyval usage)
scrbase.sty 2017/09/07 v3.24 KOMA-Script package (KOMA-Script-independent ba
sics and keyval usage)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
scrlfile.sty 2017/09/07 v3.24 KOMA-Script package (loading files)
tocbasic.sty 2017/09/07 v3.24 KOMA-Script package (handling toc-files)
scrsize10pt.clo 2017/09/07 v3.24 KOMA-Script font size class option (10pt)
typearea.sty 2017/09/07 v3.24 KOMA-Script package (type area)
standalone.sty 2099/01/01 develop Package to include TeX sub-files with pream
bles
ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
ifpdf.sty 2017/03/15 v3.2 Provides the ifpdf switch
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
xkeyval.sty 2014/12/03 v2.7a package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
currfile.sty 2015/04/23 v0.7c Provides the file path elements of the current
input file
kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO)
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO)
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
filehook.sty 2011/10/12 v0.5d Hooks for input files
filehook-scrlfile.sty 2011/01/03 v0.1 filehook patch for scrlfile package
Testfile.sta
gincltex.sty 2011/09/04 v0.3 Include external LaTeX files like graphics
svn-prov.sty 2010/04/24 v3.1862 Package Date/Version from SVN Keywords
adjustbox.sty 2012/05/21 v1.0 Adjusting TeX boxes (trim, clip, ...)
adjcalc.sty 2012/05/16 v1.1 Provides advanced setlength with multiple back-e
nds (calc, etex, pgfmath)
trimclip.sty 2012/05/16 v1.0 Trim and clip general TeX material
graphicx.sty 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg 2016/06/04 v1.11 sample graphics configuration
luatex.def 2018/01/08 v1.0l Graphics/color driver for luatex
collectbox.sty 2012/05/17 v0.4b Collect macro arguments as boxes
tc-pgf.def 2012/05/13 v1.0 trimclip fall-back clipping driver using PGF
pgf.sty 2015/08/07 v3.0.1a (rcs-revision 1.15)
pgfrcs.sty 2015/08/07 v3.0.1a (rcs-revision 1.31)
everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS)
pgfrcs.code.tex
pgfcore.sty 2010/04/11 v3.0.1a (rcs-revision 1.7)
pgfsys.sty 2014/07/09 v3.0.1a (rcs-revision 1.48)
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 2016/05/11 v2.12 LaTeX color extensions (UK)
color.cfg 2016/01/02 v1.6 sample color configuration
pgfcore.code.tex
pgfcomp-version-0-65.sty 2007/07/03 v3.0.1a (rcs-revision 1.7)
pgfcomp-version-1-18.sty 2007/07/23 v3.0.1a (rcs-revision 1.1)
ifoddpage.sty 2016/04/23 v1.1 Conditionals for odd/even page detection
varwidth.sty 2009/03/30 ver 0.92; Variable-width minipages
filemod-expmin.sty 2011/09/19 v1.2 Get and compare file modification times (e
xpandable; minimal)
pdftexcmds.sty 2018/01/21 v0.26 Utility functions of pdfTeX for LuaTeX (HO)
fontspec.sty 2017/11/09 v2.6g Font selection for XeLaTeX and LuaLaTeX
xparse.sty 2017/12/16 L3 Experimental document command parser
expl3.sty 2017/12/16 L3 programming layer (loader)
expl3-code.tex 2017/12/16 L3 programming layer
l3pdfmode.def 2017/03/18 v L3 Experimental driver: PDF mode
fontspec-luatex.sty 2017/11/09 v2.6g Font selection for XeLaTeX and LuaLaTeX
fontenc.sty
tuenc.def 2017/04/05 v2.0i Standard LaTeX file
fontspec.cfg
babel.sty 2018/01/24 3.17 The Babel package
bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of ba
bel
english.ldf 2017/06/06 v3.3r English support from the babel system
ngerman.ldf 2016/11/02 v2.9 German support for babel (new orthography)
selnolig.sty 2015/10/26
luatexbase.sty 2015/10/04 v1.3 luatexbase interface to LuaTeX
ctablestack.sty 2015/10/01 v1.0 Catcode table stable support
selnolig-english-patterns.sty 2015/10/26
selnolig-english-hyphex.sty 2015/10/26
selnolig-german-patterns.sty 2015/10/26
selnolig-german-hyphex.sty 2015/10/26
import.sty 2009/03/23 v 5.1
siunitx.sty 2017/11/26 v2.7k A comprehensive (SI) units package
amstext.sty 2000/06/29 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
array.sty 2016/10/06 v2.4d Tabular extension package (FMi)
l3keys2e.sty 2017/12/16 LaTeX2e option processing using LaTeX3 keys
translator.sty 2018/01/04 v1.12 Easy translation of strings in LaTeX
Testfile.sta
pgfplots.sty 2017/06/05 v1.15 Data Visualization (1.15)
tikz.sty 2015/08/07 v3.0.1a (rcs-revision 1.151)
pgffor.sty 2013/12/13 v3.0.1a (rcs-revision 1.25)
pgfkeys.sty
pgfkeys.code.tex
pgfmath.sty
pgfmath.code.tex
pgffor.code.tex
tikz.code.tex
supp-pdf.mkii
epstopdf-base.sty 2016/05/15 v2.6 Base part for package epstopdf
grfext.sty 2016/05/16 v1.2 Manage graphics extensions (HO)
kvdefinekeys.sty 2016/05/16 v1.4 Define keys (HO)
translator-basic-dictionary-English.dict
translator-basic-dictionary-German.dict
siunitx-abbreviations.cfg 2017/11/26 v2.7k siunitx: Abbreviated units
我从这里获得的独立包https://bitbucket.org/martin_scharrer/standalone
我也用 CTAN 上的版本检查过,没有什么区别。
standalone.sty 2015/07/15 v1.2 Package to include TeX sub-files with preambles
这是.sta文件:
\standalonepreambles
\subpreamble{Images/Vektorgrafik/StromSpannung/StromSpannung.tex}
\onlyifstandalone {\usepackage {luatex85}\usepackage [ngerman]{babel}}\usepackage {pgfplots}\usepackage {siunitx}\usepgfplotslibrary {units}
\endsubpreamble
\endstandalonepreambles
答案1
问题是最后一个后面有一个制表符 (ASCII 0D) \usepgfplotslibrary {units}
。使用 luatex 1.07 (miktex 使用) 会导致.sta
文件中出现额外的空格,然后测试失败。
这是由于影响所有引擎的变化(已经是 miktex,下一版本是 texlive):制表符不再从行尾删除 - 这是对 Knuth 原始规范的更严格解释(仅说从行尾删除空格)