summaryrefslogtreecommitdiff
path: root/web2c/contextcnf.lua
blob: 6bb6acf4442034cbf8df1413d27bda423524aaea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
-- winmerge e:\tex-context\tex\texmf-mine\web2c\contextcnf.lua e:\tex-context\tex\texmf-context\web2c\contextcnf.lua e:\tex-context\tex\texmf\web2c\texmfcnf.lua

return {

    type    = "configuration",
    version = "1.1.2",      -- "1.1.1",
    date    = "2021-05-12", -- "2011-06-02"
    time    = "14:59:00",
    comment = "ConTeXt MkIV and LMTX configuration file",
    author  = "Hans Hagen, PRAGMA-ADE, Hasselt NL",

    content = {

        -- Originally there was support for engines and progname but I don't expect other engines to
        -- use this file, so first engines were removed. After that if made sense also to get rid of
        -- progname. In principle we could support multiple formats here (using subtables) but time
        -- has demonstrated that we only have one format (the original ideas was to make a base layer
        -- but I don't see it being used to it would be  waste of time). So, after a decade it was
        -- time to prune and update this file, also because LMTX has a few more features.

        variables = {

            -- The following variable is predefined (but can be overloaded) and in most cases you can
            -- leave this one untouched. The built-in definition permits relocation of the tree.
            --
            --  if this_is_texlive then
            --      resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c'
            --  else
            --      resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c'
            --  end
            --
            -- more readable is:
            --
            -- TEXMFCNF     = {
            --     "home:texmf/web2c,
            --     "selfautoparent:texmf-local/web2c",
            --     "selfautoparent:texmf-context/web2c",
            --     "selfautoparent:texmf/web2c",
            -- }

            -- We have only one cache path but there can be more. The first writable one will be taken
            -- but there can be more readable paths.

            TEXMFCACHE      = "$SELFAUTOPARENT/texmf-cache",

            -- I don't like this texmf under home and texmf-home would make more sense. One never knows
            -- what installers put under texmf anywhere and sorting out problems will be a pain. But on
            -- the other hand ... home mess is normally the users own responsibility.
            --
            -- By using prefixes we don't get expanded paths in the cache __path__ entry. This makes the
            -- tex root relocatable.

            TEXMFOS         = "selfautodir:",
            TEXMFSYSTEM     = "selfautoparent:texmf-$SELFAUTOSYSTEM",
            TEXMFMAIN       = "selfautoparent:texmf",
            TEXMFCONTEXT    = "selfautoparent:texmf-context",
            TEXMFMODULES    = "selfautoparent:texmf-modules",
            TEXMFLOCAL      = "selfautoparent:texmf-local",
            TEXMFFONTS      = "selfautoparent:texmf-fonts",
            TEXMFPROJECT    = "selfautoparent:texmf-project",

            TEXMFHOME       = "home:texmf",
         -- TEXMFHOME       = os.name == "macosx" and "home:Library/texmf" or "home:texmf",

            -- We need texmfos for a few rare files but as I have a few more bin trees a hack is needed.
            -- Maybe other users also have texmf-platform-new trees, but so far I've never heard of it.

            TEXMF           = "{$TEXMFHOME,!!$TEXMFPROJECT,!!$TEXMFFONTS,!!$TEXMFLOCAL,!!$TEXMFMODULES,!!$TEXMFCONTEXT,!!$TEXMFSYSTEM,!!$TEXMFMAIN}",

            TEXFONTMAPS     = ".;$TEXMF/fonts/data//;$TEXMF/fonts/map/{pdftex,dvips}//",
            ENCFONTS        = ".;$TEXMF/fonts/data//;$TEXMF/fonts/enc/{dvips,pdftex}//",
            VFFONTS         = ".;$TEXMF/fonts/{data,vf}//",
            TFMFONTS        = ".;$TEXMF/fonts/{data,tfm}//",
            PKFONTS         = ".;$TEXMF/fonts/{data,pk}//",
            T1FONTS         = ".;$TEXMF/fonts/{data,type1}//;$OSFONTDIR",
            AFMFONTS        = ".;$TEXMF/fonts/{data,afm}//;$OSFONTDIR",
            TTFONTS         = ".;$TEXMF/fonts/{data,truetype}//;$OSFONTDIR",
            OPENTYPEFONTS   = ".;$TEXMF/fonts/{data,opentype}//;$OSFONTDIR",
            FONTFEATURES    = ".;$TEXMF/fonts/{data,fea}//;$OPENTYPEFONTS;$TTFONTS;$T1FONTS;$AFMFONTS",
            FONTCIDMAPS     = ".;$TEXMF/fonts/{data,cid}//",
            OFMFONTS        = ".;$TEXMF/fonts/{data,ofm,tfm}//",
            OVFFONTS        = ".;$TEXMF/fonts/{data,ovf,vf}//",

            TEXINPUTS       = ".;$TEXMF/tex/{context,plain/base,generic}//",
            MPINPUTS        = ".;$TEXMF/metapost/{context,base,}//",

            -- In the next variable the inputs path will go away.

            TEXMFSCRIPTS    = ".;$TEXMF/scripts/context/{lua,ruby,python,perl}//;$TEXINPUTS",
            PERLINPUTS      = ".;$TEXMF/scripts/context/perl",
            PYTHONINPUTS    = ".;$TEXMF/scripts/context/python",
            RUBYINPUTS      = ".;$TEXMF/scripts/context/ruby",
            LUAINPUTS       = ".;$TEXINPUTS;$TEXMF/scripts/context/lua//",
            CLUAINPUTS      = ".;$SELFAUTOLOC/lib/$engine//",

            -- Not really used by MkIV so they might go away.

            BIBINPUTS       = ".;$TEXMF/bibtex/bib//;$TEXMF/tex/context//",
            BSTINPUTS       = ".;$TEXMF/bibtex/bst//;$TEXMF/tex/context//",

            -- Experimental

            ICCPROFILES     = ".;$TEXMF/colors/icc/{context,profiles}//;$OSCOLORDIR",

            -- A few special ones that will change some day.

            FONTCONFIG_FILE = "fonts.conf",
            FONTCONFIG_PATH = "$TEXMFSYSTEM/fonts/conf",

        },

        -- We have a few reserved subtables. These control runtime behaviour. Some are frozen at
        -- at startup time, others can be changed any time.

        directives = {

            -- The default settings are actually set at startup so the values below overload
            -- them. You can also specify a plus field which will bump a value and in LMTX a
            -- step field that sets the incremental allocation of memory (because there we don't
            -- allocate all at once).

            -- texconfig.max_print_line  =   100000
            -- texconfig.function_size   =    32768
            -- texconfig.properties_size =    10000

            -- These are for luametatex:

            ["luametatex.errorlinesize"]     = { size =      250                 }, -- max =       255
            ["luametatex.halferrorlinesize"] = { size =      250                 }, -- max =       255
            ["luametatex.expandsize"]        = { size =    10000                 }, -- max =   1000000
            ["luametatex.stringsize"]        = { size =   500000, step =  100000 }, -- max =   2097151 -- number of strings
            ["luametatex.poolsize"]          = { size = 10000000, step = 1000000 }, -- max = 100000000 -- chars in string
            ["luametatex.hashsize"]          = { size =   250000, step =  100000 }, -- max =   2097151
            ["luametatex.nodesize"]          = { size = 50000000, step =  500000 }, -- max =  50000000
            ["luametatex.tokensize"]         = { size = 10000000, step =  250000 }, -- max =  10000000
            ["luametatex.buffersize"]        = { size = 10000000, step = 1000000 }, -- max = 100000000
            ["luametatex.inputsize"]         = { size =   100000, step =   10000 }, -- max =    100000 -- aka stack
            ["luametatex.filesize"]          = { size =     2000, step =     200 }, -- max =      2000
            ["luametatex.nestsize"]          = { size =    10000, step =    1000 }, -- max =     10000
            ["luametatex.parametersize"]     = { size =   100000, step =   10000 }, -- max =    100000
            ["luametatex.savesize"]          = { size =   500000, step =   10000 }, -- max =    500000
            ["luametatex.fontsize"]          = { size =   100000, step =     250 }, -- max =    100000
            ["luametatex.languagesize"]      = { size =      250, step =     250 }, -- max =     10000
            ["luametatex.marksize"]          = { size =      250, step =      50 }, -- max =     10000
            ["luametatex.insertsize"]        = { size =      250, step =      25 }, -- max =       250

            -- These are for luatex:

            ["luatex.errorline"]         =    250,
            ["luatex.halferrorline"]     =    125,
            ["luatex.expanddepth"]       =  10000,
            ["luatex.hashextra"]         = 100000,
            ["luatex.nestsize"]          =   1000,
            ["luatex.maxinopen"]         =    500,
            ["luatex.maxprintline"]      =  10000,
            ["luatex.maxstrings"]        = 500000,
            ["luatex.paramsize"]         =  25000,
            ["luatex.savesize"]          = 100000,
            ["luatex.stacksize"]         = 100000,

            -- A few process related variables come next.

         -- ["system.checkglobals"]      = "10",
         -- ["system.nostatistics"]      = "yes",
            ["system.errorcontext"]      = "10",
            ["system.compile.cleanup"]   = "no",    -- remove tma files
            ["system.compile.strip"]     = "yes",   -- strip tmc files

            -- The io modes are similar to the traditional ones. Possible values are all, paranoid
            -- and restricted.

            ["system.outputmode"]        = "restricted",
            ["system.inputmode"]         = "any",

            -- The following variable is under consideration. We do have protection mechanims but
            -- it's not enabled by default.

            ["system.commandmode"]       = "any", -- any none list
            ["system.commandlist"]       = "mtxrun, convert, inkscape, gs, imagemagick, curl, bibtex, pstoedit",

            -- The mplib library support mechanisms have their own configuration. Normally these
            -- variables can be left as they are.

            ["mplib.texerrors"]          = "yes",

            -- Normally you can leave the font related directives untouched as they only make sense
            -- when testing.

         -- ["fonts.autoreload"]         = "no",
         -- ["fonts.otf.loader.cleanup"] = "0",     -- 0 1 2 3

            -- In an edit cycle it can be handy to launch an editor. The
            -- preferred one can be set here.

         -- ["pdfview.method"]           = "sumatra",

         -- ["system.engine"]            = "luajittex",
         -- ["fonts.usesystemfonts"]     = false,
         -- ["modules.permitunprefixed"] = false,
         -- ["resolvers.otherwise"]      = false,

         -- Sandboxing has been available for a while but is probably never used to maybe that mechanism
         -- should be removed some day. Normally you will configure this in a local configuration file. By
         -- default we are rather permissive. The next list comes from my machine:

         -- ["system.rootlist"]      = { "/data" }, -- { { "/data", "read" }, ... }

      --    ["system.executionmode"] = "list", -- none | list | all
      --    ["system.executionlist"] = {
      --        "context",
      --        "bibtex", "mlbibcontext",
      --        "curl",
      --        "gswin64c", "gswin32c", "gs",
      --        "gm", "graphicmagick",
      --        "pdftops",
      --        "pstoedit",
      --        "inkscape",
      --        "woff2_decompress",
      --        "hb-shape",
      --    },
      --
      --    ["system.librarymode"]   = "list", -- none | list | all
      --    ["system.librarylist"]   = {
      --        "mysql",
      --        "sqlite3",
      --        "libharfbuzz", "libharfbuzz-0",
      --    },
      -- -- ["system.librarynames"]  = {
      -- --     ["libcurl"] = { "libcurl", "libcurl-4" },
      -- -- },

        },

        experiments = {
            ["fonts.autorscale"] = "yes",
        },

        trackers = {
        },

    },

}