0

I use PdfLatex while writing my Latex documents, however I am currently experiencing with XeLatex. While compiling some articles with several plots with XeLatex (and that compiled perfectly with PdfLatex), I noticed that the y-axis label of all pgfplots imported in the main document through either \includegrahics or \includestandalone were missing.

A minimum example is given by the code below:

\documentclass[margin=5pt]{standalone}

    \usepackage{standalone}
    \usepackage{tikz}
    \usepackage{pgfplots}
        \pgfplotsset{compat=newest}

\begin{document}

    \includegraphics{simple-plot.tex}

    \includestandalone{simple-plot}

    \begin{tikzpicture}
        \begin{axis}[%
            xlabel={x label},
            ylabel={y label},
        ]
        
            \addplot coordinates {(1,1) (2,2)};
            
        \end{axis}
    \end{tikzpicture}

\end{document}

where the contents of simple-plot.tex are:

\documentclass{standalone}

    \usepackage{tikz}
    \usepackage{pgfplots}
        \pgfplotsset{compat=newest}

\begin{document}

    \begin{tikzpicture}
        \begin{axis}[%
            xlabel={x label},
            ylabel={y label},
        ]
        
            \addplot coordinates {(1,1) (2,2)};
            
        \end{axis}
    \end{tikzpicture}
\end{document}

When compiling the first code with PdfLatex, I get the same plots for the three commands, as expected:

Compiled with pdflatex

However, when compiling with XeLatex, the first two didn't show the y-axis label, whereas the explicit inclusion of the tikzpicture (third plot) with the axis environment works fine:

Compiled with xelatex

I know I could always explicitly include the plots in an article document, however I prefer to keep the plots in separate files for better organization.

Does anybody has ever seen this behavior and know how to fix it? I am not sure whether it is a version problem and I couldn't find any solution or comment on it so far.

Thanks!

5
  • I can not reproduce your error. Compile your standalone and look at the result. Update your question with further information. Feb 1, 2022 at 18:19
  • @hpekristiansen done. I hope the plots help in understanding the problem. Feb 3, 2022 at 12:06
  • Does simple-plot.pdf have the y label when made with XeLaTeX? Exactly how do you compile? What version are you using? I can not reproduce the problem with hpek:~/Temp/tex$ xelatex -version XeTeX 3.141592653-2.6-0.999993 (TeX Live 2021) kpathsea version 6.3.3... Feb 3, 2022 at 13:02
  • @hpekristiansen first, thanks for the help! Yes, the simple-plot.tex have the y label when run with XeLaTeX. I am using VimTex, and exactly issuing the command xelatex -synctex=1 -interaction=nonstopmode -no-pdf -file-line-error -recorder -output-directory=build file.tex. I am using XeTeX 3.14159265-2.6-0.99998 (TeX Live 2017/Debian) kpathsea version 6.2.3. Feb 3, 2022 at 18:49
  • I just tested by running only `xelatex -output-directory=build file.tex', and the same behavior occurs. Feb 3, 2022 at 18:51

1 Answer 1

0

For those who eventually have the same issue, based on the comments in the question, it seems to be a problem with version XeTeX 3.14159265-2.6-0.99998 (TeX Live 2017/Debian) kpathsea version 6.2.3.

After updating to Tex Live 2019, the compilation with XeLaTeX works fine.

You must log in to answer this question.

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