我根据 Linux 机器上的文档安装了 ConTeXt,并将二进制文件添加到我的路径中,这样我就可以context
从任何地方运行它。如果我这样做,我会收到以下错误:
mtxrun | forcing cache reload
resolvers | resolving | looking for regular 'texmfcnf.lua' on given path '/home/domma/texmf/web2c' from specification 'home:texmf/web2c'
resolvers | resolving | looking for regular 'texmfcnf.lua' on given path '/etc/texmf/web2c' from specification '/etc/texmf/web2c'
resolvers | resolving | looking for regular 'texmfcnf.lua' on given path '/usr/local/share/texmf/web2c' from specification '/usr/local/share/texmf/web2c'
resolvers | resolving | looking for regular 'texmfcnf.lua' on given path '/usr/share/texmf/web2c' from specification '/usr/share/texmf/web2c'
resolvers | resolving | looking for regular 'texmfcnf.lua' on given path '/usr/share/texlive/texmf-dist/web2c' from specification '/usr/share/texlive/texmf-dist/web2c'
resolvers | resolving | looking for regular 'texmfcnf.lua' on given path './share/texmf/web2c' from specification 'selfautoparent:/share/texmf/web2c'
resolvers | resolving | looking for fallback 'contextcnf.lua' on given path '/home/domma/texmf/web2c' from specification 'home:texmf/web2c'
resolvers | resolving | looking for fallback 'contextcnf.lua' on given path '/etc/texmf/web2c' from specification '/etc/texmf/web2c'
resolvers | resolving | looking for fallback 'contextcnf.lua' on given path '/usr/local/share/texmf/web2c' from specification '/usr/local/share/texmf/web2c'
resolvers | resolving | looking for fallback 'contextcnf.lua' on given path '/usr/share/texmf/web2c' from specification '/usr/share/texmf/web2c'
resolvers | resolving | looking for fallback 'contextcnf.lua' on given path '/usr/share/texlive/texmf-dist/web2c' from specification '/usr/share/texlive/texmf-dist/web2c'
resolvers | resolving | looking for fallback 'contextcnf.lua' on given path './share/texmf/web2c' from specification 'selfautoparent:/share/texmf/web2c'
resolvers | resolving |
resolvers | resolving | warning: no lua configuration files found
resolvers | resolving | no texmf paths are defined (using TEXMF)
resolvers | resolving |
mtxrun | the resolver databases are not present or outdated
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-context.lua' using hash 'lua::mtx-context.lua'
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-contexts.lua' using hash 'lua::mtx-contexts.lua'
resolvers | resolving | remembered file 'mtx-context.lua'
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-t-context.lua' using hash 'lua::mtx-t-context.lua'
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-t-contexts.lua' using hash 'lua::mtx-t-contexts.lua'
resolvers | resolving | remembered file 'mtx-t-context.lua'
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'context.lua' using hash 'lua::context.lua'
mtxrun | unknown script 'context.lua' or 'mtx-context.lua'
这可能是因为我没有调用setuptex
。如果我在 bash shell 中调用 ,之后一切都会正常工作。我的问题是:我使用的是 Fish shell,但没有setuptex
Fish。文档提到了一些环境变量,但我不清楚哪些是真正需要的,我不想根据 来猜测setuptex
。
有人能告诉我必须设置哪些最小环境变量才能开始context
工作吗?
答案1
根据 Aditya 的回答,将此路径添加到PATH
fish 的正确方法是运行:
fish_add_path /opt/context/tex/texmf-linux-64/bin
对于大多数 shell 来说,您需要export
在配置文件中放入一个命令,但对于 fish 来说,您只需运行一次该命令。
答案2
您需要设置的唯一变量是$PATH
,它应该是(更改/opt/context/tex/...
为您安装上下文的目录)
PATH=/opt/context/tex/texmf-linux-64/bin:$PATH
我还更喜欢设置 TEXMFCACHE:
TEXMFCACHE=$HOME/.cache/context
它可以是任何用户可写的目录。