where do i have to place the texmf.cnf because i don't have a directory named /tex/2016 but four directory : texmf-config, texmf-dist, texmf-var, texmf-local, in my ubuntu 16.LTS thanks for the answer
The answer depends on several issues:
One should not just use
locateblindly and arbitrarily change a file. For example, Ubuntu stores its system-wide config in
/etc/texmf/web2c/texmf.cnfbut manages that through scripts with some of its own TeX framework (tex-common) that will appear if one installs the texinfo package or lilypond or frescobaldi, even if one has a vanilla TeXLive 2016 install (or install-tl-ubuntu, which puts symlinks in /opt but does not change the locations below).
/etc/texmf/web2c/texmf.cnfwill not necessarily be found by
kpsewhich -var-value TEXMFCNFusing a vanilla TL or equivalent (as you see below) but it should be found when using the Ubuntu packaged version. Yet I have not run
sudo dpkg --configure tex-common.
So if you have the Ubuntu package version of TeX Live, or if texinfo, lilypond, or frescobaldi are installed, even if you have vanilla TL or equivalents on Ubuntu,
locatewill show at least the following:
$ locate texmf.cnf /etc/texmf/web2c/texmf.cnf
If you do have vanilla TL or equivalents, you may get this:
$ locate texmf.cnf /usr/local/texlive/2016/texmf.cnf /usr/local/texlive/2016/texmf-dist/web2c/texmf.cnf
$ locate texmf.cnf /etc/texmf/web2c/texmf.cnf /usr/local/texlive/2016/texmf.cnf /usr/local/texlive/2016/texmf-dist/web2c/texmf.cnf
The file in
/etc/texmf/web2cis managed by Ubuntu and should not be changed because it will be overwritten. It says so in the file.
There may be different ways to add or change the config in the Ubuntu packaged framework, but using a local change in your home dir allows deja-dup to back it up (see 3 below) and allows you to keep personal changes persistent over system upgrades, distro changes, and so on.
The file in
/usr/local/texlive/2016/texmf-dist/web2c/texmf.cnfis the master file if you have a flavor of TL2016 or equivalent and should not be changed. It also says so in the file.
One could modify site-wide options in
/usr/local/texlive/2016/texmf.cnfif you have vanilla TL or equivalent. An extensive answer to that is the question here.
If you want a local texmf.cnf file under
$HOME, do the following:
a. Get the value of TEXMFCONFIG via
kpsewhich -var-value TEXMFCONFIG.
b. Create a child
web2cdirectory under that parent directory if the child does not exist. For example, if the parent is something like
mkdir -p $HOME/.texlive2016/texmf-config/web2c
c. Put your local texmf.cnf in the child
d. In your
.profiledo something like the snippet below. The variable substitution with the dollar sign and parens gets the result of the command inside the parens as an rvalue and assigns it to the the variable name. (Edit) The snippet below was modified to prevent errors, e.g., after changing distros or reinstalling, when kpsewhich is not found:
## Find local config file, if needed testpg=kpsewhich if which "$testpg" 2> /dev/null; then temp=$(kpsewhich -var-value TEXMFCONFIG) if [ -e "$temp/web2c/texmf.cnf" ] ; then export TEXMFCNF=$temp/web2c: fi else echo "kpsewhich not found" fi
kpsewhich -a texmf.cnfshould find your local file, e.g.:
$ kpsewhich -a texmf.cnf /home/username/.texlive2016/texmf-config/web2c/texmf.cnf /usr/local/texlive/2016/texmf.cnf /usr/local/texlive/2016/texmf-dist/web2c/texmf.cnf
This is an expansion of the answer by Norbert Preining.