Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to properly set TEXINPUTS

3,616 views
Skip to first unread message

Gabriel

unread,
Sep 24, 2013, 10:33:12 AM9/24/13
to
I have been a long-time Latex user under Unix/Linux on the command line.
But using a Mac & Texshop now, I am baffled by the following problem.

I would like to set the search path for Latex so that it looks for graphics images always in a subdirectory called 'images' underneath the directory where the main tex file lives.
And I want it to search that subdirectory recursively.

On the command line, I used to do that with the environment variable
TEXINPUTS=:./images//
in my ~/.cshrc

However, GUI apps do not inherit environment variables.
(And I'd rather not set it in system-wide bashrc's or something like that.)

The \graphicspath{} option is not viable either, because that wouldn't make TeX search for images recursively. Adding all the subdirectories manually is not practical.

I have googled around a bit, and it seems to me that I should put my TEXINPUTS path in some texmf.cnf.
But I was unable to find out
1. which one of the texmf.cnf's I should use, and
2. what syntax to use so that any preset TEXINPUTS is kept and my paths are just added, and so that it searches recursively.

Regarding (1) I would like to note that I would like to have a "set-and-forget" solution, i.e., I don't want to have to remember the TEXINPUTS stuff when I install the next TexLive version.

Could some kind soul please help me?

Best regards,
Gabriel.

jon

unread,
Sep 24, 2013, 10:04:39 PM9/24/13
to
On Tuesday, 24 September 2013 10:33:12 UTC-4, Gabriel wrote:
> I have been a long-time Latex user under Unix/Linux on the command line.
>
> But using a Mac & Texshop now, I am baffled by the following problem.
>
>
>
> I would like to set the search path for Latex so that it looks for graphics images always in a subdirectory called 'images' underneath the directory where the main tex file lives.
>
> And I want it to search that subdirectory recursively.
>
>
>
> On the command line, I used to do that with the environment variable
>
> TEXINPUTS=:./images//
>
> in my ~/.cshrc
>
>
>
> However, GUI apps do not inherit environment variables.
>
> (And I'd rather not set it in system-wide bashrc's or something like that.)
>
>
>
> The \graphicspath{} option is not viable either, because that wouldn't make TeX search for images recursively. Adding all the subdirectories manually is not practical.
>
>
>
> I have googled around a bit, and it seems to me that I should put my TEXINPUTS path in some texmf.cnf.
>
> But I was unable to find out
>
> 1. which one of the texmf.cnf's I should use, and
>
> Regarding (1) I would like to note that I would like to have a "set-and-forget" solution, i.e., I don't want to have to remember the TEXINPUTS stuff when I install the next TexLive version.
>

well, you should be able to find texmf.cnf with:

kpsewhich texmf.cnf

(with texlive 2013 on linux, i get: /usr/local/texlive/2013/texmf.cnf)

the one you want to edit usually tells you it is the right one at the top
of the file. (the one you don't want to edit probably has .../web2c/...
in the path, but that is the one you'll want to look at for 'inspiration'.
but i say this as a non-mac user.)

for what it's worth: why not stick all your images in a place searched
already ... say the mac equivalent of:

~/texmf/tex/latex/images/

which, i think, has a 'Library' somewhere in the path....

cheers,
jon.

Gabriel

unread,
Sep 25, 2013, 7:05:50 AM9/25/13
to
Thanks a lot for your response.

> well, you should be able to find texmf.cnf with:
> kpsewhich texmf.cnf

Yes, I did.
On my system it is
/usr/local/texlive/2012/texmf.cnf

But, when I will install a new TexLive, I will have to make those changes again in the new installation, won't I?
What's even wose is that I will have to *remember* that I will have to do those changes.

> for what it's worth: why not stick all your images in a place searched
> already ... say the mac equivalent of:
> ~/texmf/tex/latex/images/
> which, i think, has a 'Library' somewhere in the path....

Thanks for the tip.
In my case, this will not work, because the document is being edited by tens of different writers, using a multitude of TeX distros, distributed all over the campus.

Best regards,
Gabriel.

Herbert Schulz

unread,
Sep 25, 2013, 8:13:15 AM9/25/13
to
In article <9442695d-48e1-428f...@googlegroups.com>,
Howdy,

On the Mac it's at ~/Library/texmf/tex/latex/images.

Note: ~/Library is the Library folder in your HOME folder. Under OS X
10.7 and 10.8 (and I'll bet 10.9) ~/Library is hidden in Finder. To go
there hold the Opt key down and click on the Go menu in Finder and a new
menu item appears for that folder. Once there you can drag the proxy
icon (the one next to the name of the folder at the top of the window)
into the sidebar and you'll be able to ge there easily.

Good Luck,
Herb Schulz

Herbert Schulz

unread,
Sep 25, 2013, 8:16:42 AM9/25/13
to
In article <2e3ade30-eaac-4c76...@googlegroups.com>,
Howdy,

You can try to create a texmf.cnf file with only the change you wish and
place it in texmf-local/web2c. Assuming that works you will not have to
recreate it each time. (I believe this is true for TL2012 and later.)

Good Luck,
Herb Schulz

Gabriel

unread,
Sep 25, 2013, 2:04:35 PM9/25/13
to
> You can try to create a texmf.cnf file with only the change you wish and
> place it in texmf-local/web2c. Assuming that works you will not have to
> recreate it each time. (I believe this is true for TL2012 and later.)

Thanks for the response.

I've looked at /usr/local/texlive/2012/texmf/web2c/texmf.cnf.
I am a bit confused now as to how to *expand* the TEXINPUTS variable as defined there.
The "official" texmf.cnf file contains this line
% Earlier entries override later ones, so put this generic one last.
TEXINPUTS = .;$TEXMF/tex/{$progname,generic,}//
plus many TEXINPUTS.progname variables.
Should I copy the TEXINPUTS definition over to my texmf-local/web2c/texmf.cnf ?
Or copy the def of TEXINPUTS.pdflatex ?

Best regards,
Gabriel.

Leon van Dommelen

unread,
Oct 5, 2013, 7:21:35 AM10/5/13
to
On Tue, 24 Sep 2013 07:33:12 -0700, Gabriel wrote:

> However, GUI apps do not inherit environment variables.

Run them from a script maybe?

Leon

Peter Flynn

unread,
Oct 7, 2013, 4:43:17 PM10/7/13
to
On 09/24/2013 03:33 PM, Gabriel wrote:
> I have been a long-time Latex user under Unix/Linux on the command line.
> But using a Mac & Texshop now, I am baffled by the following problem.
>
> I would like to set the search path for Latex so that it looks for graphics images always in a subdirectory called 'images' underneath the directory where the main tex file lives.
> And I want it to search that subdirectory recursively.

Which IMHO ought to be the default.

But I have never managed to make any version of LaTeX find any graphics
file, ever, except with \graphicspath, which is non-portable. I have no
idea where my LaTeX looks, nor why it fails.

Could the TL team consider adding a recursive ./images at the end of
watever the current default is?

///Peter

Axel Berger

unread,
Oct 7, 2013, 5:40:45 PM10/7/13
to
Peter Flynn wrote:
> except with \graphicspath, which is non-portable.

Why not, if you use relative paths? As far as I'm aware all systems
accept the forward slash with the single exception of Apple Mac, which
is their problem to solve,not LaTeX's.

Axel

Herbert Schulz

unread,
Oct 7, 2013, 6:15:55 PM10/7/13
to
In article <52532A5D...@Gmx.De>, Axel Berger <Axel....@Gmx.De>
wrote:
Howdy,

I don't know anyone who is using pre-OS X versions of the Mac OS. Of
course there are still folks with files using applemac input encoding
but that's another thing.

Good Luck,
Herb Schulz

Andy Sinclair

unread,
Oct 9, 2013, 4:22:37 AM10/9/13
to
On 24/09/13 15:33, Gabriel wrote:
> I have been a long-time Latex user under Unix/Linux on the command line.
> But using a Mac & Texshop now, I am baffled by the following problem.
>
> I would like to set the search path for Latex so that it looks for graphics images always in a subdirectory called 'images' underneath the directory where the main tex file lives.
> And I want it to search that subdirectory recursively.
>
> On the command line, I used to do that with the environment variable
> TEXINPUTS=:./images//
> in my ~/.cshrc
>
> However, GUI apps do not inherit environment variables.
> (And I'd rather not set it in system-wide bashrc's or something like that.)
>

Can you configure the command called by TexShop?

If so you can modify the command to something like this:

Windows:
set TEXINPUTS=$(TEXINCDIR)//; && pdflatex

Linux:
env TEXINPUTS=$(TEXINCDIR)//: && pdflatex


Andy

Herbert Schulz

unread,
Oct 9, 2013, 8:47:10 AM10/9/13
to
In article <l333od$df4$1...@dont-email.me>,
Howdy,

If you use different names for images you use in the different documents
you can simply create a ~/Library/texmf/tex/latex/images directory
(i.e., in your personal texmf tree on the Mac) and move the image files
into sub-directories of that directory.

I believe that you can create symbolic links to those image directories
there but give them different names.

Please note that ~/Library is the Library directory in your HOME
directory; NOT the one at the root of your HD. In OS X 10.7 and later
Finder hides that directory by default. To Open it hold the Opt key down
while clicking in Finder's Go Menu and an new item will appear to open
that directory.

Good Luck,
herbs2
0 new messages