Skip to content

Better error message for unsupported engines (fail fast and noisily)

I wanted to run your MWE from https://github.com/plk/biblatex/pull/1060 with pdfLaTeX, but only got a cryptic error message. A short look at the CTAN page suggests the package only supports LuaLaTeX and XeLaTeX.

It would be helpful if the package were to throw a clearer error if used with an unsupported engine.

\documentclass{article}
\usepackage{marathi}

\begin{document}
  चाचणी
\end{document}

Currently I get

! Undefined control sequence.
\GenericError  ...                                
                                                    #4  \errhelp \@err@     ...
l.54 }
      
? 

which isn't too illuminating.

I see that the package is already loading iftex, so something like

\RequirePackage{iftex}
\iftutex
\else
  \PackageError{marathi}{Unsupported engine}{Only LuaLaTeX and XeLaTeX are supported}%
  \expandafter\endinput
\fi

very early on in marathi.sty might work.