1

I have a document containing a lot of TikZ images with pgfplots (See MWE below). Because some of these plots deal with a lot of data, I had to switch from pdflatex to lualatex.

I use the siunitx package for units like micro-meters etc. I discovered, that everything works when using pdflatex: pdflatex

However, compiled with lualatex I get these Ts with the little tail below them (ţ) instead of a greek mu.

lualatex

If I remove \usepackage[T1]{fontenc} The error is gone and both pdflatex and lualatex work. Is there a way to get this working with lualatex?

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{siunitx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
    \begin{tikzpicture}
        \begin{axis}[%
        width=7cm,
        height=7cm,
        xmin=0, xmax=100, xtick={0,10,...,100},
        ymin=1, ymax=8, ytick={0,1,...,8},
        xlabel={Stuff},
        ylabel={Stuff},
        grid,
        ]
        \draw[thick,->, >=latex'] (axis cs: 50,6) -- (axis cs: 40, 1.5) node[pos=0, above, align=center, fill=white]{Stuff \SIrange{7}{15}{\micro\meter}\\in \SI{1}{\micro\meter} steps};

        \end{axis}
    \end{tikzpicture}
\end{document}
2
  • 5
    never use either of \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} with luatex Commented Oct 27, 2022 at 20:55
  • Thanks for the hint. I already suspected something like that.
    – GNA
    Commented Oct 28, 2022 at 7:37

1 Answer 1

2

Replace both inputenc and fontenc by fontspec for correct encoding in lualatex : \usepackage{fontspec} or \usepackage{unicode-math} :

\documentclass[tikz]{standalone}
\usepackage{unicode-math}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{siunitx}
\begin{document}
    \begin{tikzpicture}
        \begin{axis}[%
        width=7cm,
        height=7cm,
        xmin=0, xmax=100, xtick={0,10,...,100},
        ymin=1, ymax=8, ytick={0,1,...,8},
        xlabel={Stuff},
        ylabel={Stuff},
        grid,
        ]
        \draw[thick,->, >=latex'] (axis cs: 50,6) -- (axis cs: 40, 1.5) node[pos=0, above, align=center, fill=white]{Stuff \SIrange{7}{15}{\micro\meter}\\in \SI{1}{\micro\meter} steps};

        \end{axis}
    \end{tikzpicture}
\end{document}

You must log in to answer this question.

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