我在 Fedora 25 上使用 Texlive 2015,自从更新后,使用 Luatex 编译就不起作用了。我确实使用了 TexStudio,但我在 TexMaker 和 CLI 中复制了错误。
基本上,Lualatex 似乎无法加载包微类型。我在这里发布了日志文件中看似相关的部分:
! Undefined control sequence.
<recently read> \RequireLuaModule
l.56 \RequireLuaModule
{microtype}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.56 \RequireLuaModule{m
icrotype}
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
这可能是发行版特有的问题,但它不起作用。
当我点击 TexStudio 中的日志文件时,它引导我microtype-luatex.def文件,它指向以下行:
\RequireLuaModule{microtype}
该错误后面跟着一串与此类似的错误
Package microtype Warning: Could not parse font size `12'
(microtype) in font set `basicmath' on input line 74.
[\directlua]:1: attempt to index global 'microtype' (a nil value)
stack traceback:
[\directlua]:1: in main chunk.
\MT@ifdimen ...MT@lua {microtype.if_dimen([[#1]])}
\endcsname
l.74 }
The lua interpreter ran into a problem, so the
remainder of this lua chunk will be ignored.
我可以添加我的最小工作示例和我的序言。
这是我的测试文件:
% classe de document
\documentclass[a4paper,12pt,onecolumn,oneside]{scrartcl}
% appel au préambule
\input{preambule.tex}
% en-têtes et pieds de pages
%
% réglages hyperref
\hypersetup{
breaklinks=true, %permet le retour à la ligne dans les liens trop longs
pdfpagemode = UseOutlines,% afficher le pdf en plein écran
unicode=true, % non-Latin characters in Acrobat’s bookmarks
pdftoolbar=true, % show Acrobat’s toolbar?
pdfmenubar=true, % show Acrobat’s menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
pdftitle={Test}, % title
pdfauthor={NT}, % author
pdfsubject={test}, % subject of the document
pdfcreator={Moi}, % creator of the document
pdfkeywords={test}, % list of keywords
pdfnewwindow=true, % links in new window
}
%
%appel au titre et à l'auteur
\title{Test}
\author{Moi}
%
%document
\begin{document}
% appel au titre
\maketitle
%
yyy
\end{document}
我的序言如下:
% préambule commun
%
% encodage caractères
\usepackage{luatex} % Compiler avec LuaLaTeX
%
% choix de la police
\usepackage{libertine}
%
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX} % To support LaTeX quoting style
% \setmainfont{libertine}
\usepackage{pdftexcmds}
\makeatletter
\let\pdfstrcmp\pdf@strcmp
\let\pdffilemoddate\pdf@filemoddate
\makeatother
% langue
\usepackage[german,english,latin,french]{babel}
\usepackage[autolanguage]{numprint}
% microtypographie
\usepackage{microtype}
\microtypecontext{kerning=french} % réglage pour le français
%\usepackage[a4paper,landscape]{geometry}
\usepackage[official]{eurosym} % symbole monnaie euro
% bibliographie
\usepackage{natbib}
% maths
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{framed}
\usepackage[amsmath,framed,thmmarks,hyperref]{ntheorem}
% unités SI
\usepackage{siunitx}
\sisetup{locale = FR,
detect-all = true,
separate-uncertainty, % écriture des incertitudes
list-final-separator = { \translate{and} },
range-phrase = { \translate{to (numerical range)} },
inter-unit-separator={}\cdot{}
}
% espaces réguliers
\usepackage{xspace}
% En-têtes et pieds de page
\usepackage{scrlayer-scrpage}
% multicolonnes
\usepackage{multirow}
% centrage
\usepackage{array}
% tableaux soignés
\usepackage{booktabs}
\usepackage{tabularx}
% tableaux longs
%\usepackage{longtable}
\usepackage{xtab}
% import de données externes pour créer un tableau
\usepackage{pgfplotstable}
\usepackage{colortbl}
% graphiques et images
\usepackage[section]{placeins}
\usepackage{graphicx}
\usepackage{wrapfig}
%\usepackage{subcaption}
\usepackage{varioref}
\usepackage{tikz}
\usepackage{float}
\usetikzlibrary{shapes,decorations.pathmorphing}
% Define box and box title style
\tikzstyle{mybox} = [draw=red, fill=black!10, very thick,
rectangle, rounded corners, inner sep=10pt, inner ysep=20pt]
\tikzstyle{fancytitle} =[fill=red, text=white]
%
\usepackage{svg}
% usage de la couleur
\usepackage[usenames,dvipsnames,svgnames,x11names,table]{xcolor}
% Creative Commons licenses
\usepackage{ccicons}
% usage de la couleur
\usepackage[usenames,dvipsnames,svgnames,x11names,table]{xcolor}
%\usepackage{asymptote}
% Dessin de circuits électriques
\usepackage[european,siunitx,smartlabels]{circuitikz}
% import et exécution de code python
\usepackage{python}
% chimie
\usepackage[version=3,arrows=pgf]{mhchem}
\usepackage{etex}
\usepackage{m-pictex,m-ch-en}
\usepackage{chemfig}
% numérotation des pages
\usepackage{lastpage}
% cadres avec logo
\usepackage[tikz]{bclogo}
% QCM
\usepackage{alterqcm}
% insérer url
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}
% insérer faux texte
\usepackage{lipsum}
答案1
所有 amsmath 包都应该被加载前 fontspec
。所有与旧字体相关的东西也都以前有过。但是,对于 TL2016,以下内容对我有用:
\documentclass[a4paper,12pt,onecolumn,oneside]{scrartcl}
\usepackage[official]{eurosym} % symbole monnaie euro
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{fontspec}
\usepackage{libertine}
\usepackage{microtype}
\microtypecontext{kerning=french} % réglage pour le français
\usepackage{natbib}
\usepackage{pdftexcmds}
\makeatletter
\let\pdfstrcmp\pdf@strcmp
\let\pdffilemoddate\pdf@filemoddate
\makeatother
% langue
\usepackage[german,english,latin,french]{babel}
\usepackage[autolanguage]{numprint}
% microtypographie
%\usepackage[a4paper,landscape]{geometry}
\usepackage{framed}
\usepackage[amsmath,framed,thmmarks,hyperref]{ntheorem}
% unités SI
\usepackage{siunitx}
\sisetup{locale = FR,
detect-all = true,
separate-uncertainty, % écriture des incertitudes
list-final-separator = { \translate{and} },
range-phrase = { \translate{to (numerical range)} },
inter-unit-separator={}\cdot{}
}
% espaces réguliers
\usepackage{xspace}
% En-têtes et pieds de page
\usepackage{scrlayer-scrpage}
% multicolonnes
\usepackage{multirow}
% centrage
\usepackage{array}
% tableaux soignés
\usepackage{booktabs}
\usepackage{tabularx}
% tableaux longs
%\usepackage{longtable}
\usepackage{xtab}
% import de données externes pour créer un tableau
\PassOptionsToPackage{xcolor}{usenames,dvipsnames,svgnames,x11names,table}
\usepackage{pgfplotstable}
\usepackage[section]{placeins}
\usepackage{graphicx}
\usepackage{wrapfig}
%\usepackage{subcaption}
\usepackage{varioref}
\usepackage{tikz}
\usepackage{float}
\usetikzlibrary{shapes,decorations.pathmorphing}
% Define box and box title style
\tikzstyle{mybox} = [draw=red, fill=black!10, very thick,
rectangle, rounded corners, inner sep=10pt, inner ysep=20pt]
\tikzstyle{fancytitle} =[fill=red, text=white]
%
\usepackage{svg}
% usage de la couleur
\usepackage{ccicons}
\usepackage[european,siunitx,smartlabels]{circuitikz}
\usepackage{python}
\usepackage[version=3,arrows=pgf]{mhchem}
\usepackage{etex}
\usepackage{m-pictex,m-ch-en}
\usepackage{chemfig}
% numérotation des pages
\usepackage{lastpage}
% cadres avec logo
\usepackage[tikz]{bclogo}
% QCM
\usepackage{alterqcm}
% insérer url
\PassOptionsToPackage{hyphens}{url}
\usepackage{hyperref}
% insérer faux texte
\usepackage{lipsum}
% réglages hyperref
\hypersetup{
breaklinks=true, %permet le retour à la ligne dans les liens trop longs
pdfpagemode = UseOutlines,% afficher le pdf en plein écran
unicode=true, % non-Latin characters in Acrobat’s bookmarks
pdftoolbar=true, % show Acrobat’s toolbar?
pdfmenubar=true, % show Acrobat’s menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
pdftitle={Test}, % title
pdfauthor={NT}, % author
pdfsubject={test}, % subject of the document
pdfcreator={Moi}, % creator of the document
pdfkeywords={test}, % list of keywords
pdfnewwindow=true, % links in new window
}
%
%appel au titre et à l'auteur
\title{Test}
\author{Moi}
%
%document
\begin{document}
% appel au titre
\maketitle
%
yyy
\end{document}