Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I normally use Unix system, but I am forced for a while on a Windows7 setup. I installed MikTex and texmaker 4.0.4. All is working except it seems that texmaker is not respecting the TEXINPUTS variable.

MWE: go in one dir and create directories TeXinputs and subdir. In subdir, file testinput.tex:

\documentclass[10pt]{article}
\usepackage{null}
\begin{document}
Nothing
\end{document}

in directory TeXinputs create the file null.sty:

\NeedsTeXFormat{LaTeX2e}[1996/06/01]
\ProvidesPackage{null}[2013/11/12 null package.]
\def\called{\relax}
\endinput

then add the environment variable as user TEXINPUTS with value .:../TeXinputs//.

To add it in Windows, open the "Start" menu, and start typing "environment" in the search box (I suppose it will be different with a non-English installation --- in Spanish should be "variables de entorno"). Then choose "set environment variables for your account"and, in the windows that opens, you can add all the variables you want. This is my example:

Setting user environment variables

I have it defined and checked it (this is from a bash shell installed by git):

$echo $TEXINPUTS
./:../TeXinpus//

The idea is that I can use a structure like this in my work directory:

$ls 
TeXinputs subdir1 subdir2 

This works great for MikTeX, to have common files in the same place. I can compile my files correctly from bash:

$ pdflatex testinput
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit)
entering extended mode
("z:\adit\My Documents\test\subdir\testinput.tex"
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
 lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
("z:\adit\My Documents\test\subdir\..\TeXinputs\\null.sty")
("z:\adit\My Documents\test\subdir\testinput.aux") [1{C:/ProgramData/MiKTeX/2.9
/pdftex/config/pdftex.map}] ("z:\adit\My Documents\test\subdir\testinput.aux")
)<C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on testinput.pdf (1 page, 12304 bytes).
Transcript written on testinput.log.

As you can see, the file z:\adit\My Documents\test\subdir\..\TeXinputs\\null.sty is found and all is ok.

The problem and question: opening the file in texmaker and trying to compile gives error --- it can't find the ../TeXinputs/null.sty file.

I checked too:

  • setting TEXINPUTS as a "system" environment variable (don't work)

  • using absolute path instead of relative one (with or without spces in the path, don't work)

Any hint on why relative TEXINPUTS paths are not working in texmaker?

share|improve this question
2  
This has nothing to do with Texmaker. Remember it just calls latex. AFAIR miktex does not support the texinputs variable. Instead you have to use the miktex setting manager to add an extra root –  daleif Dec 12 '13 at 19:46
    
@daleif -- no, pdflatex works perfectly from (windows) command line, as stated in the question --- see the example where ../null.sty is found. My problem is exactly that pdflatex works but called from texmaker it doesn't. –  Rmano Dec 12 '13 at 22:41
    
I don't suppose TeXmaker reads your environment configuration files. So when you run it in TeXmaker, you have a default environment and the variable is not defined. –  cfr Dec 12 '13 at 23:46
    
@cfr --- tomorrow I will try to put it on the system variables. Could be that. Thanks. (although every program running as an user should have all the same variables, methinks, but well). –  Rmano Dec 13 '13 at 0:44
1  
Yes, I know. I was just citing that as evidence that programmes do not, in fact, use all the same variables as in the shell solely because they are running as the relevant user. Thanks, though. –  cfr Dec 13 '13 at 21:16

1 Answer 1

up vote 2 down vote accepted

I found the solution!.

The problem is the colon : in the TEXINPUTS path, used in Unix to separate the various paths, and that utterly confuses Windows. Instead of the colon, to separate elements in the path you should use a semicolon ;.

So setting:

TEXINPUTS=../TeXinputs

as in this image:

setting texinputs

it then does works in texmaker. If you need more than one path, you can use

TEXINPUTS=../TeXinputs;C:/Users/MYUSER/Desktop/TeXinputsGlobal

...and it works ok.

The confusion was that the bash shell understands the notation /c/ instead of C:\ but CMD.exe doesn't.

share|improve this answer
    
In TeXmaker, Did you try adding TEXINPUTS info at Options-->Configure Texmaker-->Add to PATH ? –  texenthusiast Dec 13 '13 at 16:18
    
Yes. It didn't work; I think it adds literally to PATH variables (which is where the executable are found). –  Rmano Dec 13 '13 at 16:21
    
Found it --- now I'll edit the answer. –  Rmano Dec 13 '13 at 16:24
    
Here it is explained why colons cannot be used as path separator in Windows environment variables. –  giordano Dec 13 '13 at 17:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.