# [OS X TeX] Change in beamer ?

Herbert Schulz herbs at wideopenwest.com
Thu Jun 5 09:07:01 EDT 2014

On Jun 5, 2014, at 4:48 AM, Josep Maria Font <jmfont at ub.edu> wrote:

> On 5 Jun 2014, at 04:19, Herbert Schulz <herbs at wideopenwest.com> wrote:
>
>> On Jun 4, 2014, at 5:57 PM, Ross Moore <ross.moore at mq.edu.au> wrote:
>>
>>> Hello Maria, and others,
>>>
>>> On 05/06/2014, at 8:15 AM, Josep Maria Font wrote:
>>>
>>>> As to Victor Ivrii's suggestion
>>>>
>>>>> \usepackage{etex}
>>>>
>>>> yes, this solves the problem, and further puzzles me, because, like Herb, I thought the present versions of TeX were actually etex... but now I recall a similar memory problem (not with beamer) a colleague had when editing a book, and which was solved also by loading etex...
>>>>
>>>> Any ideas on this last issue ?
>>>
>>>
>>> Certainly we are using  etex  already, but the LaTeX macros
>>> that allocate the extra \count  and \dimen  registers
>>> need to be adapted to the increased number available,
>>> and required to be used by Xy-pic.
>>> Beamer also uses a lot, so you certainly need access to
>>> the extra registers when both are loaded.
>>>
>>>
>>> Here is what  etex.sty  actually does, redefining \alloc@ .
>>>
>>> viz.
>>>
>>>>>> %% We don't change the LaTeX definitions of \newcount, etc., but the
>>>>>> %% \alloc@ macro doing the actual work is redefined.
>>>>>>
>>>>>> %% When the normal register pool for \count, \dimen, \skip, \muskip,
>>>>>> %% \box, or \toks registers is exhausted, we switch to the extended pool.
>>>>>>
>>>>>> \def\alloc@#1#2#3#4#5%
>>>>>> {\ifnum\count1#1<#4% make sure there's still room
>>>>>>  \allocationnumber\count1#1
>>>>>>  \global\advance\count1#1\@ne
>>>>>>  \global#3#5\allocationnumber
>>>>>>  \wlog{\string#5=\string#2\the\allocationnumber}%
>>>>>> \else\ifnum#1<6
>>>>>>  \begingroup \escapechar\m at ne
>>>>>>  \expandafter\alloc@@\expandafter{\string#2}#5%
>>>>>> \else\errmessage{No room for a new #2}\fi\fi
>>>>>> }
>>>>>>
>>>>>> %% The \expandafter construction used here allows the generation of
>>>>>> %% \newcount and \globcount from #1=count.
>>>>>>
>>>>>> \def\alloc@@#1#2%
>>>>>> {\endgroup % restore \escapechar
>>>>>> \wlog{Normal \csname#1\endcsname register pool exhausted,
>>>>>>  switching to extended pool.}%
>>>>>> \global\expandafter\let
>>>>>>  \csname new#1\expandafter\endcsname
>>>>>>  \csname glob#1\endcsname
>>>>>> \csname new#1\endcsname#2%
>>>>>> }
>>>
>>>
>>> It is that fallback to  \alloc@@  that gives access
>>> to more registers.
>>>
>>> Here is the original \def\alloc@{...} in  latex.ltx :
>>>
>>>>>> \def\alloc@#1#2#3#4#5{\global\advance\count1#1\@ne
>>>>>> \ch at ck#1#4#2% make sure there's still room
>>>>>> \allocationnumber\count1#1%
>>>>>> \global#3#5\allocationnumber
>>>>>> \wlog{\string#5=\string#2\the\allocationnumber}}
>>>>>>
>>>>>> \gdef\ch at ck#1#2#3{%
>>>>>> \ifnum\count1#1<#2\else
>>>>>> \errmessage{No room for a new #3}%
>>>>>> \fi}
>>>
>>>
>>>>
>>>> Best,
>>>>
>>>>
>>>> JMaF
>>>
>>>
>>> Hope this helps,
>>>
>>>     Ross
>>
>> Howdy,
>>
>> I just added the xy package to a beamer test file I use (for testing the TeXShop latexmk engines) and I still don't have to explicitly load the etex package to avoid \dimen allocation errors. I need an example where that needs to be done.
>
> Here is one, using three of my most used packages
> %%%%%%%%%%%%%%%%%%%%%%%%%%%
> \documentclass{beamer}
> %\usepackage{etex}
> \usepackage[catalan]{babel}
> \usepackage{mathtools}
> \usepackage[all]{xy}
> \begin{document}
> \begin{frame}
> Hola, m\'on\,!
> \end{frame}
> \end{document}
> %%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> After experimenting, it is clear this is simply an issue of not enough room for \dimen s, because the problem disappears in the following cases:
> - just deleting *any one* of the three packages;
> - just deleting the [all] optional argument to xy; and
> - just uncommenting the etex package.
> Moreover, by changing the order in which the packages are loaded, the problem appears when loading the last of the three. Hence, this is not xy-specific either.
>
> Since with beamer 3.32 this does not happen, I assume that a significant number of \dimen s were added in 3.33.
>
> Finally, on the e-tex issue: Ross' explanation is clear, but still I don't understand that etex has to be added to modern TeX runs; I probably misunderstood what they say that etex is already incorporated. Actually, on the UK TeX FAQ <http://www.tex.ac.uk/cgi-bin/texfaq2html?label=etex> it says:
>
>> current TeX distributions are delivered with most formats built with an e-TeX-based system
>
> and
>
>> The extensions range from the seemingly simple (increasing the number of available registers from 256 to 32768) ...
>
> but it seems this is not enough, and to access some of the e-TeX functionalities in LaTeX one has to use the e-tex *package* ?
>
> Best,
>
>
> JMaF

Howdy,

Ok, now I'm seeing the problem. I'm guessing that by default the etex extensions internal to pdftex are turned off and the etex package activates them.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)



More information about the MacOSX-TeX mailing list