Skip to content

Error when both width and height are specified without pgfplots package loaded #7

Description

@user202729

if tikz package is loaded without pgfplots package, and both width and height are specified in \includegraphics command, an error happens:

./a.tex:6: Undefined control sequence.
\tikzscale@preparePlot code ->\pgfplotsset
                                           {every axis/.append style={width=...

An example document:

\documentclass{article}
\usepackage{tikz}
\usepackage{tikzscale}
\begin{document}
\includegraphics[width=3cm, height=3cm]{image.tikz}
\end{document}

Where image.tikz contains:

\begin{tikzpicture}
\draw (0, 0) -- (1, 2);
\end{tikzpicture}

I think the desirable behavior here would be that the image is resized so that the width is at most 3cm and the height is at most 3cm, whichever is smaller.


Apart from that, do you have any plan to support inline tikzpicture environments?


Also, I think it's undesirable for the package to implicitly handle in addition relative import, that feels like the job of a separate package to me. The import package already handles that.STPH-FP

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions