1

While using the syntax package together with microtype, I stumbled on a strange error:

Missing font identifier.<to be read again>\chardef <TEST> ::= `

Missing number, treated as zero.<to be read again>\chardef <TEST> ::= `

With the following minimal example, I was able to reproduce the error:

\documentclass{article}

\usepackage{syntax}
\usepackage{microtype}

\begin{document}

\begin{grammar}
<TEST> ::= `test'
\end{grammar}

\end{document}

When I remove microtype, this works fine. By coincidence, I also found a hack that seems to solve the problem by adding a \lit*{} command before the grammar definition, e.g.

\documentclass{article}

\usepackage{syntax}
\usepackage{microtype}

\begin{document}

\lit*{}
\begin{grammar}
<TEST> ::= `test'
\end{grammar}

\end{document}

Is there a way to resolve this error cleanly? What is causing it?

1 Answer 1

3

EDIT This has been fixed in microtype v3.0.


That's a bug in microtype, triggered by some of the more adventurous code of syntax. The following should fix it:

\usepackage{microtype}
\makeatletter
\def\MT@is@opt@char#1\iffontchar#2\char#3\else#4\fi\relax{%
  \MT@ifempty{#1}{%
    \iffontchar#2%
      \expandafter\chardef
        \csname\MT@encoding\MT@detokenize@c\@tempa\endcsname=#3\relax
    \fi
  }\relax
}
\makeatother

You must log in to answer this question.

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