Difference between revisions of "Texmf.cnf"

From Wiki
Jump to navigation Jump to search
m (Removed spam)
 
(9 intermediate revisions by 7 users not shown)
Line 3: Line 3:
 
Most options in <tt>texmf.cnf</tt> of modern TeX distributions are ok for ConTeXt (in former times you had to care for ConTeXt's huge memory needs yourself and occasionally set some additional paths). The one thing left:
 
Most options in <tt>texmf.cnf</tt> of modern TeX distributions are ok for ConTeXt (in former times you had to care for ConTeXt's huge memory needs yourself and occasionally set some additional paths). The one thing left:
  
ConTeXt likes TeX's "write18" function enabled to run [[Metapost]] and some other tools in the background.
+
ConTeXt likes TeX's "write18" function enabled to run [[MetaPost]] and some other tools in the background.
 
That's a potential security risk (malicious TeX code could run any program with your user rights), so it's off (false) by default.
 
That's a potential security risk (malicious TeX code could run any program with your user rights), so it's off (false) by default.
  
Line 10: Line 10:
 
</pre>
 
</pre>
  
If you don't want to take this security risk with all TeX code on your system, you might like to consider the following change to the appropriate line in [[texexec.ini]]:
+
'''Hint for MikTeX users:''' The counterpart to <tt>texmf.cnf</tt> was <tt>miktex.ini</tt>, now the config is  [http://docs.miktex.org/2.9/manual/runtimeparams.html stored separately for each program]
  
<pre>
+
== Location and priority of texmf.cnf files ==
for tetex set  TeXPassString    to  -progname=context -shell-escape
+
 
</pre>
+
Assuming that you have your distribution in /usr/local/texlive/2008, the following texmf.cnf files are read (in this order) if they exist:
 +
 
 +
#  /usr/local/texlive/2008/bin/x86_64-linux/texmf.cnf
 +
#  /usr/local/texlive/2008/bin/texmf.cnf
 +
# /usr/local/texlive/2008/texmf.cnf
 +
# /usr/local/texlive/2008/texmf/web2c/texmf.cnf
 +
 
 +
Variables you set in a particular file are *not* overwritten by files
 +
which are read later.
 +
 
 +
The default is (4). If you have to customize texmf.cnf, the best thing
 +
you can do is to put only the variables you want to change into (3).
 +
 
 +
(1) is quite useful for system dependent configuration. On
 +
multi-platform installations you could create a file
 +
/usr/local/texlive/2008/bin/win32/texmf.cnf on the server which
 +
contains the single line
 +
 
 +
OSFONTDIR = $SystemRoot/Fonts
 +
 
 +
and this only affects Windows clients, even if (3) contains the line
  
(If yours is a non-tetex system, choose the appropriate line. If there are other options present, like <tt>--default-translate-file=cp8bit</tt>, then don't delete them!)
+
OSFONTDIR = /usr/share/fonts.
  
This will enable <tt>\write18</tt> support per <tt>texexec</tt> job, and not system-wide. An administrator would therefore only have to worry about malicious ConTeXt code, and not about other TeX systems running. With the second modification, you can leave the <tt>shell_escape</tt> line in <tt>texmf.cnf</tt> commented out/false.
+
[[Category:Installation]]

Latest revision as of 14:06, 28 August 2019

< Installation hints

Most options in texmf.cnf of modern TeX distributions are ok for ConTeXt (in former times you had to care for ConTeXt's huge memory needs yourself and occasionally set some additional paths). The one thing left:

ConTeXt likes TeX's "write18" function enabled to run MetaPost and some other tools in the background. That's a potential security risk (malicious TeX code could run any program with your user rights), so it's off (false) by default.

shell_escape = t

Hint for MikTeX users: The counterpart to texmf.cnf was miktex.ini, now the config is stored separately for each program

Location and priority of texmf.cnf files

Assuming that you have your distribution in /usr/local/texlive/2008, the following texmf.cnf files are read (in this order) if they exist:

  1. /usr/local/texlive/2008/bin/x86_64-linux/texmf.cnf
  2. /usr/local/texlive/2008/bin/texmf.cnf
  3. /usr/local/texlive/2008/texmf.cnf
  4. /usr/local/texlive/2008/texmf/web2c/texmf.cnf

Variables you set in a particular file are *not* overwritten by files which are read later.

The default is (4). If you have to customize texmf.cnf, the best thing you can do is to put only the variables you want to change into (3).

(1) is quite useful for system dependent configuration. On multi-platform installations you could create a file /usr/local/texlive/2008/bin/win32/texmf.cnf on the server which contains the single line

OSFONTDIR = $SystemRoot/Fonts

and this only affects Windows clients, even if (3) contains the line

OSFONTDIR = /usr/share/fonts.