contextcnf.lua /size: 12 Kb    last modification: 2024-01-16 09:03
1-- todo: come up with an auto-texlive identification (texmf-dist)
2
3---- hiddentexlivepath = ".texlive2023"
4
5return {
6
7    type    = "configuration",
8    version = "1.1.3",
9    date    = "2023-03-10", -- 2021-05-12 2011-06-02
10    time    = "14:59:00",
11    comment = "ConTeXt MkIV and LMTX configuration file",
12    author  = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
13    target  = "standalone",
14
15    content = {
16
17        -- Originally there was support for engines and progname but I don't expect other engines to
18        -- use this file, so first engines were removed. After that if made sense also to get rid of
19        -- progname. In principle we could support multiple formats here (using subtables) but time
20        -- has demonstrated that we only have one format (the original ideas was to make a base layer
21        -- but I don't see it being used to it would be  waste of time). So, after a decade it was
22        -- time to prune and update this file, also because LMTX has a few more features.
23
24        variables = {
25
26            -- The following variable is predefined (but can be overloaded) and in most cases you can
27            -- leave this one untouched. The built-in definition permits relocation of the tree.
28            --
29            --  if this_is_texlive then
30            --      resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c'
31            --  else
32            --      resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c'
33            --  end
34            --
35            -- more readable is:
36            --
37            -- TEXMFCNF     = {
38            --     "home:texmf/web2c,
39            --     "selfautoparent:texmf-local/web2c",
40            --     "selfautoparent:texmf-context/web2c",
41            --     "selfautoparent:texmf/web2c",
42            -- }
43
44            -- We have only one cache path but there can be more. The first writable one will be taken
45            -- but there can be more readable paths.
46
47            -- standalone:
48
49            TEXMFCACHE      = "$SELFAUTOPARENT/texmf-cache",
50
51            -- texlive
52
53         -- TEXMFVAR        = "home:" .. hiddentexlivepath .. "/texmf-var",
54         -- TEXMFCONFIG     = "home:" .. hiddentexlivepath .. "/texmf-config",
55         -- TEXMFSYSVAR     = "selfautoparent:texmf-var",
56         -- TEXMFCACHE      = "$TEXMFSYSVAR;$TEXMFVAR",
57
58            -- I don't like this texmf under home and texmf-home would make more sense. One never knows
59            -- what installers put under texmf anywhere and sorting out problems will be a pain. But on
60            -- the other hand ... home mess is normally the users own responsibility.
61            --
62            -- By using prefixes we don't get expanded paths in the cache __path__ entry. This makes the
63            -- tex root relocatable.
64
65            TEXMFOS         = "selfautodir:",
66
67            -- standalone:
68
69            TEXMFSYSTEM     = "selfautoparent:texmf-$SELFAUTOSYSTEM",
70            TEXMFMAIN       = "selfautoparent:texmf",
71            TEXMFCONTEXT    = "selfautoparent:texmf-context",
72            TEXMFMODULES    = "selfautoparent:texmf-modules",
73
74            -- texlive:
75
76         -- TEXMFDIST       = "selfautoparent:texmf-dist",
77         -- TEXMFSYSCONFIG  = "selfautoparent:texmf-config",
78
79            -- The texmf-local path is only used for (maybe) some additional configuration file.
80
81            TEXMFLOCAL      = "selfautoparent:texmf-local",
82            TEXMFFONTS      = "selfautoparent:texmf-fonts",
83            TEXMFPROJECT    = "selfautoparent:texmf-project",
84
85            TEXMFHOME       = "home:texmf",
86         -- TEXMFHOME       = os.name == "macosx" and "home:Library/texmf" or "home:texmf",
87
88            -- We need texmfos for a few rare files but as I have a few more bin trees a hack is needed.
89            -- Maybe other users also have texmf-platform-new trees, but so far I've never heard of it.
90
91            -- standalone:
92
93            TEXMF           = "{$TEXMFHOME,!!$TEXMFPROJECT,!!$TEXMFFONTS,!!$TEXMFLOCAL,!!$TEXMFMODULES,!!$TEXMFCONTEXT,!!$TEXMFSYSTEM,!!$TEXMFMAIN}",
94
95            -- texlive:
96
97         -- TEXMF           = "{$TEXMFCONFIG,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFPROJECT,!!$TEXMFFONTS,!!$TEXMFLOCAL,!!$TEXMFDIST}",
98
99            TEXFONTMAPS     = ".;$TEXMF/fonts/data//;$TEXMF/fonts/map/{pdftex,dvips}//",
100            ENCFONTS        = ".;$TEXMF/fonts/data//;$TEXMF/fonts/enc/{dvips,pdftex}//",
101            VFFONTS         = ".;$TEXMF/fonts/{data,vf}//",
102            TFMFONTS        = ".;$TEXMF/fonts/{data,tfm}//",
103            PKFONTS         = ".;$TEXMF/fonts/{data,pk}//",
104            T1FONTS         = ".;$TEXMF/fonts/{data,type1}//;$OSFONTDIR",
105            AFMFONTS        = ".;$TEXMF/fonts/{data,afm}//;$OSFONTDIR",
106            TTFONTS         = ".;$TEXMF/fonts/{data,truetype}//;$OSFONTDIR",
107            OPENTYPEFONTS   = ".;$TEXMF/fonts/{data,opentype}//;$OSFONTDIR",
108            FONTFEATURES    = ".;$TEXMF/fonts/{data,fea}//;$OPENTYPEFONTS;$TTFONTS;$T1FONTS;$AFMFONTS",
109            FONTCIDMAPS     = ".;$TEXMF/fonts/{data,cid}//",
110            OFMFONTS        = ".;$TEXMF/fonts/{data,ofm,tfm}//",
111            OVFFONTS        = ".;$TEXMF/fonts/{data,ovf,vf}//",
112
113            TEXINPUTS       = ".;$TEXMF/tex/{context,plain/base,generic}//",
114            MPINPUTS        = ".;$TEXMF/metapost/{context,base,}//",
115
116            -- In the next variable the inputs path will go away.
117
118            TEXMFSCRIPTS    = ".;$TEXMF/scripts/context/{lua,ruby,python,perl}//;$TEXINPUTS",
119            PERLINPUTS      = ".;$TEXMF/scripts/context/perl",
120            PYTHONINPUTS    = ".;$TEXMF/scripts/context/python",
121            RUBYINPUTS      = ".;$TEXMF/scripts/context/ruby",
122            LUAINPUTS       = ".;$TEXINPUTS;$TEXMF/scripts/context/lua//",
123            CLUAINPUTS      = ".;$SELFAUTOLOC/lib/$engine//",
124
125            -- Not really used by MkIV so they might go away.
126
127            BIBINPUTS       = ".;$TEXMF/bibtex/bib//;$TEXMF/tex/context//",
128            BSTINPUTS       = ".;$TEXMF/bibtex/bst//;$TEXMF/tex/context//",
129
130            -- standalone
131
132            ICCPROFILES     = ".;$TEXMF/colors/icc/{context,profiles}//;$OSCOLORDIR",
133
134            -- texlive
135
136         -- ICCPROFILES     = ".;$TEXMF/tex/context/colors/{icc,profiles}//;$OSCOLORDIR",
137
138            -- A few special ones that will change some day.
139
140            FONTCONFIG_FILE = "fonts.conf",
141
142            -- standalone
143
144            FONTCONFIG_PATH = "$TEXMFSYSTEM/fonts/conf",
145
146            --texlive
147
148         -- FONTCONFIG_PATH = "$TEXMFSYSVAR/fonts/conf",
149
150        },
151
152        -- We have a few reserved subtables. These control runtime behaviour. Some are frozen at
153        -- at startup time, others can be changed any time.
154
155        directives = {
156
157            -- The default settings are actually set at startup so the values below overload
158            -- them. You can also specify a plus field which will bump a value and in LMTX a
159            -- step field that sets the incremental allocation of memory (because there we don't
160            -- allocate all at once).
161
162            -- texconfig.max_print_line  =   100000
163            -- texconfig.function_size   =    32768
164            -- texconfig.properties_size =    10000
165
166            -- These are for luametatex:
167
168            ["luametatex.errorlinesize"]     = { size =      250                 }, -- max =       255
169            ["luametatex.halferrorlinesize"] = { size =      250                 }, -- max =       255
170            ["luametatex.expandsize"]        = { size =    10000                 }, -- max =   1000000
171            ["luametatex.stringsize"]        = { size =   500000, step =  100000 }, -- max =   2097151 -- number of strings
172            ["luametatex.poolsize"]          = { size = 10000000, step = 1000000 }, -- max = 100000000 -- chars in string
173            ["luametatex.hashsize"]          = { size =   250000, step =  100000 }, -- max =   2097151
174            ["luametatex.nodesize"]          = { size = 50000000, step =  500000 }, -- max =  50000000
175            ["luametatex.tokensize"]         = { size = 10000000, step =  250000 }, -- max =  10000000
176            ["luametatex.buffersize"]        = { size = 10000000, step = 1000000 }, -- max = 100000000
177            ["luametatex.inputsize"]         = { size =   100000, step =   10000 }, -- max =    100000 -- aka stack
178            ["luametatex.filesize"]          = { size =     2000, step =     200 }, -- max =      2000
179            ["luametatex.nestsize"]          = { size =    10000, step =    1000 }, -- max =     10000
180            ["luametatex.parametersize"]     = { size =   100000, step =   10000 }, -- max =    100000
181            ["luametatex.savesize"]          = { size =   500000, step =   10000 }, -- max =    500000
182            ["luametatex.fontsize"]          = { size =   100000, step =     250 }, -- max =    100000
183            ["luametatex.languagesize"]      = { size =      250, step =     250 }, -- max =     10000
184            ["luametatex.marksize"]          = { size =      250, step =      50 }, -- max =     10000
185            ["luametatex.insertsize"]        = { size =      250, step =      25 }, -- max =       250
186
187            -- These are for luatex:
188
189            ["luatex.errorline"]         =    250,
190            ["luatex.halferrorline"]     =    125,
191            ["luatex.expanddepth"]       =  10000,
192            ["luatex.hashextra"]         = 100000,
193            ["luatex.nestsize"]          =   1000,
194            ["luatex.maxinopen"]         =    500,
195            ["luatex.maxprintline"]      =  10000,
196            ["luatex.maxstrings"]        = 500000,
197            ["luatex.paramsize"]         =  25000,
198            ["luatex.savesize"]          = 100000,
199            ["luatex.stacksize"]         = 100000,
200
201            -- A few process related variables come next.
202
203         -- ["system.checkglobals"]      = "10",
204         -- ["system.nostatistics"]      = "yes",
205            ["system.errorcontext"]      = "10",
206            ["system.compile.cleanup"]   = "no",    -- remove tma files
207            ["system.compile.strip"]     = "yes",   -- strip tmc files
208
209            -- The io modes are similar to the traditional ones. Possible values are all, paranoid
210            -- and restricted.
211
212            ["system.outputmode"]        = "restricted",
213            ["system.inputmode"]         = "any",
214
215            -- The following variable is under consideration. We do have protection mechanims but
216            -- it's not enabled by default.
217
218            ["system.commandmode"]       = "any", -- any none list
219            ["system.commandlist"]       = "mtxrun, convert, inkscape, gs, imagemagick, curl, bibtex, pstoedit",
220
221            -- The mplib library support mechanisms have their own configuration. Normally these
222            -- variables can be left as they are.
223
224            ["mplib.texerrors"]          = "yes",
225
226            -- Normally you can leave the font related directives untouched as they only make sense
227            -- when testing.
228
229         -- ["fonts.autoreload"]         = "no",
230         -- ["fonts.otf.loader.cleanup"] = "0",     -- 0 1 2 3
231
232            -- In an edit cycle it can be handy to launch an editor. The
233            -- preferred one can be set here.
234
235         -- ["pdfview.method"]           = "sumatra",
236
237         -- ["system.engine"]            = "luajittex",
238         -- ["fonts.usesystemfonts"]     = false,
239         -- ["modules.permitunprefixed"] = false,
240         -- ["resolvers.otherwise"]      = false,
241
242         -- Sandboxing has been available for a while but is probably never used to maybe that mechanism
243         -- should be removed some day. Normally you will configure this in a local configuration file. By
244         -- default we are rather permissive. The next list comes from my machine:
245
246         -- ["system.rootlist"]      = { "/data" }, -- { { "/data", "read" }, ... }
247
248      --    ["system.executionmode"] = "list", -- none | list | all
249      --    ["system.executionlist"] = {
250      --        "context",
251      --        "bibtex", "mlbibcontext",
252      --        "curl",
253      --        "gswin64c", "gswin32c", "gs",
254      --        "gm", "graphicmagick",
255      --        "pdftops",
256      --        "pstoedit",
257      --        "inkscape",
258      --        "woff2_decompress",
259      --        "hb-shape",
260      --    },
261      --
262      --    ["system.librarymode"]   = "list", -- none | list | all
263      --    ["system.librarylist"]   = {
264      --        "mysql",
265      --        "sqlite3",
266      --        "libharfbuzz", "libharfbuzz-0",
267      --    },
268      --    ["system.librarynames"]  = {
269      --     -- ["libcurl"] = { "libcurl", "libcurl-4" },
270      --        ["libmysql"] = { "libmysql", "libmysqlclient" },
271      --    },
272
273        },
274
275        experiments = {
276            ["fonts.autorscale"] = "yes",
277        },
278
279        trackers = {
280        },
281
282    },
283
284}
285