2

I am using standalone in my document to save some compilation time while working on pgfplots plots.

Now there is one plot, that shows a very strange behavior with includestandalone. It has worked for a long time but since last week this and only this plot out of 25 other plots stopped to work with \includestandalone when included in the main file. There is no error message coming up, the plot just does not show up. Including the tikzpicture into the main file will work without any problem and compiling the standalone file on its own will also work with no error.

The log-file says:

Package standalone Warning: Sub-preamble of file 'Image.tex' has changed. Content will be ignored. Please rerun LaTeX!

on input line 11.

After the sixth rerun nothing changed. Is this a bug or a feature? Or am I doing something wrong? I am using MikTex 2.9_6618 up to date and compiling with lualatex

I found this standalone package, with its subpreambles option, ignores content of a standalone input file if it contains accents in glossary entry but since I am not using glossaries or inputenc the solution did not help me.

Here is the picture:

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

And here is a MWE of a document that will refuse to show the picture:

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

enter image description here

And here is the data for 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

Here is the file list

*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

The standalone package I got from here https://bitbucket.org/martin_scharrer/standalone

I checked it with the version on CTAN as well and it makes no difference.

standalone.sty    2015/07/15 v1.2 Package to include TeX sub-files with preambles

Here is the .sta file:

\standalonepreambles
\subpreamble{Images/Vektorgrafik/StromSpannung/StromSpannung.tex}
\onlyifstandalone {\usepackage {luatex85}\usepackage [ngerman]{babel}}\usepackage {pgfplots}\usepackage {siunitx}\usepgfplotslibrary {units} 
\endsubpreamble
\endstandalonepreambles
  • Can you complete your code so we can reproduce the problem? Complete minimal documents are much more useful than fragments - then we have to try to guess what else might be in your file. Creating this will also check whether the issue occurs when this is the only file included in this way, or if it depends on being one of many. cfigure is not standard and most people probably don't have a Images/Vektorgrafik/StromSpannung/StromSpannung.tex file. We also don't know what's in the picture, because only you have series_c.csv. – cfr Feb 14 '18 at 23:20
  • @cfr Now everything should be in the question. I checked it and this reduced version shows the same behavior. cfigure is just a floating figure with included \centering. I will delete the c – DMZ Feb 14 '18 at 23:46
  • It works for me when I add the missing \end{document}. The picture I get is not very interesting, but it is clearly a picture and not, say, nothing. It gets more interesting if I delete the blank lines in the .csv file. Not much, but a bit more. Still there, though. Works with either pdflatex or lualatex as compiler. – cfr Feb 15 '18 at 0:14
  • Which TeX distribution? Which version of standalone? You can add \listfiles to get a list of files and versions to post for comparison purposes. – cfr Feb 15 '18 at 0:20
  • 1
    Then pack the failing MWE along with all auxiliary files in a zip-file and put it somewhere on the net. Be sure to first test it in some empty folder to avoid that some other files interfere. – Ulrike Fischer Feb 15 '18 at 13:08
6

The problem is that there is tab character (ASCII 0D) behind the last \usepgfplotslibrary {units}. With luatex 1.07 (used by miktex) this leads to an additional space in the .sta file and then the tests fails.

This is due to a change that affects all engines (miktex already, texlive in the next version): tabs are no longer stripped from ends of lines -- a stricter interpretation of Knuth's original specification (which only says spaces are removed from ends of line)

  • Thanks for pointing this out. I would have never thought about that. Is there a changelog or discussion page for this change? – Martin Scharrer Mar 31 '18 at 15:54
  • @MartinScharrer there was a discussion on the texlive list but it somehow got lost in the archives. You could ask David, perhaps he still has it offline. – Ulrike Fischer Mar 31 '18 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.