Microtype 与系统调用 LuaLaTeX 结合导致错误

Microtype 与系统调用 LuaLaTeX 结合导致错误

我正在尝试使用 tikz 根据测量结果绘制一些图形,因为数据点的数量对于 LaTeX 来说太大,所以我使用“系统调用”来使用 LuaLaTeX 来绘制它们。

只要我不加载 microtype,一切都会运行良好,但由于某种原因,microtype 似乎会导致错误。有什么想法吗?

TeX capacity exceeded, sorry [main memory size=3000000]. \end{axis}
\documentclass[fontsize=12pt]{scrreprt}

\usepackage[english,ngerman]{babel}% neue deutsche Rechtschreibung verwenden
\usepackage[T1]{fontenc}            % Wahl des Fonts, bzw.
\usepackage[utf8]{inputenc} % Zeichkodierung , Umlaute \usepackage{}


%\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}

\usepackage[activate={true,nocompatibility},
            final,
            tracking=true,
            kerning=true,
            spacing=true,
            factor=1200,
            stretch=50,
            shrink=0]{microtype}

      \usepackage{tikz,pgfplots}
      \pgfplotsset{compat=newest}
      \pgfplotsset{plot coordinates/math parser=false}
      \pgfplotsset{every axis/.append style={
            /pgf/number format/.cd,
            use comma,
            1000 sep={},
            set decimal separator={,},
            clip marker paths=true,
            grid style={densely dotted, draw=black},
            x tick style={color=black},
            y tick style={color=black},
        }}
        \usetikzlibrary{plotmarks}
        \usetikzlibrary{patterns}      

        \newlength\figureheight
        \newlength\figurewidth

        \usetikzlibrary{external}
        \tikzexternalize[prefix=tikztmp/,figure name=tikztmp_sec\thesubsection_no,]
        \tikzset{external/system call={lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}}
        \tikzexternalize[shell escape=-enable-write18]


\begin{document}

\begin{figure}
\microtypesetup{kerning=false}
\microtypesetup{spacing=false}
\microtypesetup{expansion=false}
\microtypesetup{protrusion=false}
\microtypesetup{activate=false}
\microtypesetup{disable}    
\begin{tikzpicture}
\begin{axis}[%
width=5cm,
height=10cm,
at={(0.790898in,0.967508in)},
scale only axis,
xlabel={$x~\rightarrow$},
ylabel={$y~\rightarrow$},
legend style={legend cell align=left,align=left,draw=black}
]
\addplot [color=gray,line width=.45pt,mark size=.45pt,only marks,mark=*,mark options={solid}]
table [ x expr=\thisrow{tmess}*1e6, y=uoutmess, col sep=comma] {tmessuoutmess.csv};
\addlegendentry{Messung};

\addplot [color=black,solid,line width=1.5pt]
table [x expr=\thisrow{tapprox}*1e6, y=uoutapprox, col sep=comma] {tapproxuoutapprox.csv};
\addlegendentry{Approximation};

\addplot [color=black,loosely dotted,line width=1.5pt]
table [x expr=\thisrow{tsim}*1e6,y=uoutsim, col sep=comma] {tsimuoutsim.csv};
\addlegendentry{Simulation};
\end{axis}
\end{tikzpicture}
\microtypesetup{enable}
\microtypesetup{activate=true}
\microtypesetup{protrusion=true}
\microtypesetup{expansion=true}
\microtypesetup{spacing=true}
\microtypesetup{kerning=true}
\end{figure}

\end{document}  

值:在此处输入链接描述

此外,我正在使用:

MiKTeX 2.9 64-bit
pdfTeX, Version 3.14159265-2.6-1.40.15
LuaTeX, Version beta-0.76.0-2013062821

编辑:因为 LuaLateX 不支持间距和字距调整,我试图在 tikzpicture 环境中禁用此功能,但似乎不起作用,有什么想法吗?

\microtypesetup{kerning=false}
\microtypesetup{spacing=false}
\begin{tikzpicture}
...
\end{tikzpicture}
\microtypesetup{spacing=true}
\microtypesetup{kerning=true}

答案1

加载 ifluatex-package 并使用它来停用 lualatex 不允许或有用的设置:

\usepackage{ifluatex}
\usepackage[activate={true,nocompatibility},
            final,
            tracking=true,
            %kerning=true,
            %spacing=true,
            factor=1200,
            stretch=50,
            shrink=0, 
            ]{microtype}
\ifluatex \else \microtypesetup{kerning=true,spacing=true}\fi 

答案2

microtype 手册说字距和间距只适用于 pdfTeX。所以尝试使用

...,kerning=false,spacing=false,...

我已经确认

pdflatex --shell-escape filename.tex

作品。

相关内容