I am including the LuaTeX into an Overleaf LaTeX document by
\usepackage{arxiv} \usepackage[T1]{fontenc} % use 8-bit T1 fonts \usepackage{hyperref} % hyperlinks \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan, pdftitle={Sharelatex Example}, pdfpagemode=FullScreen, } \usepackage{url} % simple URL typesetting \usepackage{booktabs} % professional-quality tables \usepackage{amsfonts} % blackboard math symbols \usepackage{nicefrac} % compact symbols for 1/2, etc. \usepackage{microtype} % microtypography \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsthm} \usepackage{multirow,tabularx} \usepackage{luacode} \usepackage{graphicx} \usepackage[colorinlistoftodos]{todonotes} but encountered the following error message:
Package luacode Error: /usr/local/texlive/2017/texmf-dist/tex/lualatex/luacode/luacode.sty, line 51 LuaTeX is required for this package. Aborting..
See the luacode package documentation for explanation. Type H for immediate help. ...
l.51 to prevent additional errors.} This package can only be used with the LuaTeX engine (command `lualatex'). Package loading has been stopped to prevent additional errors.
What is the remedy?
pdfTeXinstead ofluaTeX.babelfor example works fine with modern LuaLaTeX): Do not loadinputencandfontencwith LuaLaTeX.\usepackage[T1]{fontenc}and\usepackage[utf8]{inputenc}. No matter what compiler you use you should make sure thathyperrefis the last package you load (save for a few exceptions). There is little point in loading\usepackage{url}if you also load\usepackage{hyperref}(since the latter loads the former), especially if you do it after loadinghyperref. (These hints won't help with the error message you posted, but they are still relevant for your document.)\r A' in font encodingTU' in inheritance list `microtype.cfg/358(protrusion)'. and it lost the styles for the large and bold font for section titles.\usepackage[T1]{fontenc}. See for example tex.stackexchange.com/q/243482/35864. In any case\usepackage[T1]{fontenc}is detrimental with LuaLaTeX as explained in tex.stackexchange.com/q/470976/35864 (compile\documentclass[ngerman]{article} \usepackage[T1]{fontenc} \begin{document} Grüße \end{document}with LuaLaTeX to see a very obvious problem)