2

I find myself copying the same export TEXINPUTS=fubar:$TEXINPUTS lines for different applications that don't all read the same environment configurations files, e.g. xterm vs. Emacs's compilation-mode.

It would be easier to have these exports in just one place where I am sure any TeX distribution will look, e.g. in my ~/.texrc or ~/.latex.config or whatever. The man page does not mention any such place. Is there one? If not, is there a neat configuration trick I need to learn?

phs
  • 203
  • Have you tried to put those variables into /etc/profile or at least ~/.profile? – Jan Jan 19 '17 at 06:40
  • 2
    TeX variables are set in texmf.cnf. You can find these files using kpsewhich -a texmf.cnf – Nicola Talbot Jan 19 '17 at 08:29
  • 1
    the advantage of setting the variables in texmf.cnf is that they are web2c specific variables not in the environment so the syntax does not depend on your operating system or shell, or even have a requirement that your operating system has environment variables. – David Carlisle Jan 19 '17 at 09:41
  • @Jan. Thanks for the suggestion. I've thought about '~/.profile' but this is never read on my OSX 12. Re: '/etc/profile' I'd rather keep it for system-wide settings which is not what I want to do now with TEXINPUTS="$HOME/mytexadds:$TEXINPUTS" – phs Jan 19 '17 at 17:25

1 Answers1

1

It is possible, if you use the tool latexmk for this purpose.

Then, there is, for each user a configuration file in $HOME/.latexmkrc (this does not exist by default, just create it if you don't have it).

So just do vi -r ~/.latexmkrc

and for example:

# This is a comment
# Séquence de commandes pour latexmk

# Générer des pdf par défaut
$pdf_mode = 1 ;

#Des index en français 
$makeindex = ’texindy -L french -M texindy -M %.xdy -o %D %S’ ;

Have a look on the manpage by typing in your terminal: man latekmk

Deun
  • 21
  • By the way have a look here : https://tex.stackexchange.com/questions/175511/how-to-create-the-latexmkrc-file – Deun Aug 06 '17 at 09:13
  • 6
    That only affects latexmk, not all LaTeX compilation processes + bibtex etc. It does not really answer the question. – TeXnician Aug 06 '17 at 09:23
  • In the exemple I gave, you can see that orders regarding makeindex and texindy... so, of course you can manage the whole process of compilation including bibtex etc... The language uses within latexmkrc is perl. So it can handle much complex processes than you thought. Once again have a look on the man pages and examples of .latexmkrc files on Internet. – Deun Aug 06 '17 at 11:11
  • 2
    But it is only read by latexmk. As you might not know latexmk is a tool to automate several TeX related processes. This configuration file influences how it handles calls to the respective programs. But try to call one of the tools yourself and you'll notice it won't obey the config. – TeXnician Aug 06 '17 at 12:24
  • Ha yes you are right, I was reading the question in the sole point of view of Latex which is not the question (that I just re-read now). – Deun Aug 09 '17 at 10:32
  • And even from the sole point of LaTeX it is incorrect (=does not fully answer the question) as your solution only respects latexmk and not a direct call of latex, pdflatex etc. – TeXnician Aug 09 '17 at 10:38
  • May be I am wrong, but I thought that the aim of latexmk is to set up automation of the different parts of a compilation, and, within this frame, .latexmk to be used whatever the text editor to make sure the compiling proceses would be the same. ¿No? – Deun Aug 10 '17 at 10:05
  • Well yes, but latexmk is not universally used. Many people prefer the traditional compilations and some use other tools. If you'd update your answer so that it says it's only relevant to latexmk users, it would be all fine. – TeXnician Aug 10 '17 at 14:13
  • True that sometimes we think that the only possible way is the one we take (specially when we do not have strong knowledge of what we do). So I had changed my answer, with the hope it might be helpful for the nuby ones using latexmk. – Deun Aug 11 '17 at 16:02
  • @Deun please feel free to undo my edit if you don't like it – samcarter_is_at_topanswers.xyz Aug 11 '17 at 16:12
  • @sancarter look better than my pseudo English. Thanks. – Deun Aug 11 '17 at 18:22