I have a project directory and within the project directory a package in a local texmf
-tree. As the project resides in a repository and is compiled on different computers, I would like to have a compile command that first sets the TEXMFHOME
variable and then executes pdflatex
. Last, I use texstudio v2.10.8
. How could I get this working?
In my real scenario I want the packages also to be found in multiple tex-files located in subfolders. Hence, the use of TEXMFHOME
.
MWE
I have a file main.tex
\documentclass{article}
\usepackage{foo}
\begin{document}
\foo
\end{document}
and foo.sty
in texmf/tex/latex/
\newcommand{\foo}{c}
Also, a file Makefile
with content
MAIN=main
compile:
export TEXMFHOME=./texmf/
pdflatex $(MAIN).tex
.PHONY: clean force once all
From command line it works as expected. If I execute /usr/bin/make
from texstudio
it does not find foo.sty
.
make
or shell question (perhaps TeXstudio uses/bin/sh
which may or may not be the same as/bin/bash
). Have you triedTEXMFHOME=./texmf/ pdflatex $(MAIN).tex
all on one line? Alternatively, three lines ofTEXMFHOME=./texmf/
,export TEXMFHOME
,pdflatex $(MAIN).tex
?TEXMFHOME=./texmf/ pdflatex $(MAIN).tex
seems to work. Do you have any ideas why that would work? I mean, usually I would use;
to sequentialize commands. But then it does not work when calling fromtexstudio
.make
it uses/bin/sh
and from command line/bin/bash
. Also, the three line version did not work from withintexstudio
.../bin/sh
as the default shell. If/bin/sh
is a symlink to bash, it'll behave like this. If it's a symlink to dash as I suspect, then bash-specific commands likeexport N=v
won't work, any more than\newcommand
would work with regular TeX.export LC_ALL="en_US"; lualatex -synctex=1 -interaction=nonstopmode %.tex
but it won't work. I need to setLC_ALL="en_US"
in TeXStudio environment before running LuaLaTeX.