MartinScharrer / standalone

A LaTeX class and package is provided which allows LaTeX diagrams or other LaTeX code to be compiled standalone or as part of a main document. Special support for pictures with beamer overlays is also provided.
LaTeX Project Public License v1.3c
9 stars 2 forks source link

incompatible with lualatex and or xcolor? #8

Open Axolord opened 10 months ago

Axolord commented 10 months ago

Hi, I have a problem using the standalone package with lualatex. given the following test.tex:

\documentclass{article}
\usepackage[subpreambles=true]{standalone}

\begin{document}
\input{fig}
\end{document}

and the following fig.tex:

\documentclass{standalone}
%\PassOptionsToPackage{dvipsnames}{xcolor}

\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning,calc,patterns}

\begin{document}
\begin{tikzpicture}
  \node[fill=YellowGreen, circle] {test};
\end{tikzpicture}
\end{document}

running lualatex I always get the error ! Package xcolor Error: Undefined colorYellowGreen'.`

running via pdflatex works fine.

Am I missing something here? Thanks in advance.

u-fischer commented 7 months ago

Well basically it is a bug in the adjustbox package: the included trimclip.sty tries to load a backend driver tc-luatex.def for luatex but this is missing and so it falls back to pgf (https://github.com/MartinScharrer/adjustbox/issues/1)

File: tc-pgf.def 2019/01/04 v2.2 trimclip fall-back clipping driver using PGF

As pgf already loads xcolor you got an option class error and the color definition is missing.

The good news that it works ok in a current texlive as we changed xcolor and it can now be loaded more than once with different options (but it would still be better if adjustbox got corrected and wouldn't load all of pgf.)