web2c: Runtime options

 
 4.1 Runtime options
 ===================
 
 Besides the configure- and compile-time options described in the
 installation section (⇒Installation), you can control a number of
 parameters in the 'texmf.cnf' runtime file read by Kpathsea (⇒
 (kpathsea)Config files).
 
    The main purpose of 'texmf.cnf' is to specify search paths, but array
 sizes and other options are also set there.  Most are rather obscure.
 Here are a few of the more interesting values:
 
 'main_memory'
      Total words of memory available, for TeX, Metafont, and MetaPost.
      Must remake the format file after changing.
 
 'extra_mem_bot'
      Extra space for "large" TeX data structures (default 0): boxes,
      glue, breakpoints, et al.  If you use PiCTeX, you may well want to
      set this.
 
 'expand_depth'
      Limit on recursive expansion calls before TeX aborts (default
      10000).  If a TeX program does an unterminated recursive expansion,
      TeX will dutifully expand macros until the system's runtime stack
      overflows, typically with a segmentation fault (SIGSEGV). This
      parameter was introduced to minimize the chance of that unpleasant
      (though not dangerous) crash, instead allowing TeX to quit with a
      more informative message.
 
      The crash can still happen, though, if the system has an
      exceptionally small memory allocation for its stack.  There is no
      quantitative way to determine the limit, and it does not seem worth
      implementing system-dependent heuristics to guess at the number,
      since it's highly improbable that any real TeX code will ever need
      more than 10000 recursive expansions (it has never happened).  For
      the same reason, using the libsigsegv library
      (<https://gnu.org/s/libsigsegv>) does not seem worth the effort.
 
 'texmf_casefold_search'
      ⇒(kpathsea)Casefolding search.
 
    Ideally all arrays would be dynamically expanded as necessary, so the
 only limiting factor would be the amount of swap space available, or
 some configurable limit much larger than can currently be supported.
 
    Unfortunately, implementing this is extremely difficult, as the fixed
 size of arrays is assumed in many places throughout the source code.
 These runtime limits are a practical compromise between the compile-time
 limits in previous versions, and truly dynamic arrays.  (On the other
 hand, the Web2c BibTeX implementation does do true dynamic reallocation
 of some arrays.)
 
    Nowadays there is rarely a reason to modify the values.  But if you
 do wish to modify 'texmf.cnf', in TeX Live the best approach is to put
 your changes, and only your changes at the top of the TL installation
 tree.  That is, if the system 'texmf.cnf' is installed in
 '/some/path/to/texlive/YYYY/texmf-dist/web2c/texmf.cnf' is put your
 custom settings in '/some/path/to/texlive/YYY/texmf.cnf', where YYYY is
 the year of installation (if you use that subdirectory; it's the
 default).  That way, unrelated changes to the system 'texmf.cnf' can
 happen with normal updates, without affecting your local values.