[OS X TeX] Microtype Fix (from: Microtype mystery)

Ross Moore ross.moore at mq.edu.au
Mon Aug 30 22:33:04 CEST 2010


Hi Vijay,

On 30/08/2010, at 10:37 PM, R. Vijay Krishna wrote:

> Hi Ross,
> 
> Thanks for the reply, and the explanation.  Unfortunately, I still get the same error, and the code (snippet) below doesn't seem to fix it.  
> 
>> Here's one way to fix the problem.
>> 
>>> 
>> \usepackage{ifxetex}
>> \makeatletter
>> \let\MT at inlist@fi\fi
>> \makeatother
>> \ifxetex
> 
> and the error again
> ----
> ! Too many }'s.
> l.31 ...MT at font@list{\MT at font@list\font at name,}\fi}
>                                                   \makeatother


You only implemented part of my suggestion.
The "Fix for Microtype" has to end as follows:

>>> \else\xdef\MT at font@list{\MT at font@list\font at name,}\MT at inlist@fi}


so that there is no explicit  \fi  at the end.

> ? 
> ! Extra \fi.
> l.35 \fi


>> For any other engine, that coding is potentially
>> unbalanced. Certainly it cannot go inside another
>> conditional, without taking care to keep it properly
>> balanced within that setting.
> 
> I think I understand what the problem is.  But if I am using XeLaTeX, why is it that the "fix" for microtype is read, but the line loading the package microtype is not read?  More generally, if the conditional is not true,

\ifMT at inlist@   is *not* automatically a conditional.

It only becomes one when the {microtype} package declares
it to be one. But this doesn't happen when using XeTeX,
since the package just exits upon detecting that the engine
is not pdfTeX.

Instead, the \fi in the macro expansion is seen to be 
the end of the surrounding:
  \ifxetex ... 
conditional block.

That is why I changed the cs-name to \MT at inlist@fi .
Now the scanning doesn't read this as a \fi ,
but it *is* treated as such when it is encountered
while expanding macros.

> ie the "if" part is not true, why is the "then" part read at all?  (Or at least compiled?  I suppose reading it is inevitable, if only to determine the end of the "then" part.)

Morten's suggestion of rebinding via

   \let\ifMT at inlist@\iftrue

does not fix the error that you are reporting.

Of course you could just move the "Fix" outside
of the \ifxetex test:

>>> \ifxetex
>>>  ....
>>> \else
>>>  ...
>>> \fi
>>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>> %%%%%%%%%  Fix for Microtype %%  
>>> \makeatletter
>>> \def\MT at register@subst at font{\MT at exp@one at n\MT at in@clist\font at name \MT at font@list
>>> \ifMT at inlist@\else\xdef\MT at font@list{\MT at font@list\font at name,}\fi} 
>>> \makeatother
>>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>> 

This is fine, since without {microtype} you can never
actually call the internal \MT at register@subst at font ;
so it cannot do any harm to have this definition.

> 
> 
>> Hope this helps,
>> 
>> 	Ross
> 
> I think I am fine, at least for the moment, but still a little perplexed.

That's because you are thinking like a person, not like
a machine that interprets TeX coding.   :-)

> 
> Thanks,
> Vijay.


Does this clarify it now?

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross.moore at mq.edu.au 
Mathematics Department                           office: E7A-419      
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------






More information about the macostex-archives mailing list