To implement the approach discussed here: Automatic detection of Overleaf for fallback images I wanted to give my tikz-files their own names, such that I can either include the tikz-file when compiling locally or the pdf-file when working on overleaf (which is significantly easier when knowing the file name of the PDF beforehand). Therefore, I included tikzsetnextfilename in my tikzfiles. Unfortunately, that seems to disable the scaling possibility given by includegraphics and tikzscale. As example, with two files main.tex and sub.tikz:


    x y
    0 0
    1 1
    2 2
    3 3
    4 4
    5 5
\tikzset{external/force remake}

\pgfplotsset{every axis/.append style={
        label style={font=\footnotesize\bfseries},
        tick label style={font=\footnotesize},
        legend style={font=\footnotesize}
    y axis/.append style={align=center}}
\tikzset{Line Label/.style={font=\footnotesize,scale=2}}

        \caption{Image I}


        ymin=0, ymax=30,
        xmin=0, xmax=5,
        legend entries={\(y_1\),\(y_2\),\(y_1+y_2\)},
        legend pos = north west
        % Select appropriate columns
        \addplot [blue, mark=*] table [x=x,y=y] {\tablea};

When disabling tikzsetnextfilename, scaling works, and the graph is scaled appropriately. Enabling it leads to a fixed scaling factor of 1, though, without any log errors or warnings. Is there a solution or an explanation (or possibly both)?

1 Answer 1


For me, moving \tikzsetnextfilename{extname} out and before the \includegraphics[opts]{filename.tikz}, rather than having it inside filename.tikz solved the problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .