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.
makeor shell question (perhaps TeXstudio uses/bin/shwhich may or may not be the same as/bin/bash). Have you triedTEXMFHOME=./texmf/ pdflatex $(MAIN).texall on one line? Alternatively, three lines ofTEXMFHOME=./texmf/,export TEXMFHOME,pdflatex $(MAIN).tex? – Mike Renfro Aug 13 '17 at 13:01TEXMFHOME=./texmf/ pdflatex $(MAIN).texseems 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. – Heinrich Ody Aug 13 '17 at 14:45/bin/shis a link todashinstead ofbash, then the problem is thatexport NAME=valueis a bash-ism, and can't be expected to work in other Bourne-type shells. The three-line version is universal. – Mike Renfro Aug 13 '17 at 14:51makeit uses/bin/shand from command line/bin/bash. Also, the three line version did not work from withintexstudio... – Heinrich Ody Aug 13 '17 at 14:52export NAME=valueinside the Makefile. You should be able to chain as many of those variables together as needed, though:NAME1=value1 NAME2=value2 pdflatex $(MAIN).tex. – Mike Renfro Aug 13 '17 at 14:55export), but not from withintexstudio. – Heinrich Ody Aug 14 '17 at 09:35/bin/shas the default shell. If/bin/shis 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=vwon't work, any more than\newcommandwould work with regular TeX. – Mike Renfro Aug 15 '17 at 00:51export LC_ALL="en_US"; lualatex -synctex=1 -interaction=nonstopmode %.texbut it won't work. I need to setLC_ALL="en_US"in TeXStudio environment before running LuaLaTeX. – Royi May 27 '18 at 04:16maketo build, these answers probably aren’t relevant. None of this is influenced by the editor. I suggest posting a separate question for better chances of getting an answer. – Mike Renfro May 27 '18 at 08:32