Graphics, Figures & TablesDefault directory for figures TexShop on Mac

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
roltex
Posts: 1
Joined: Mon Nov 15, 2010 2:27 pm

Default directory for figures TexShop on Mac

Post by roltex »

Hi

Can you tell me where I have to put figures with
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{draughtsman}
\caption{Perspectief}
\label{persp}
\end{figure}
in order for TexShop to find them? It must be easy :) but I can't figure it out...

Regards
Roland

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Default directory for figures TexShop on Mac

Post by localghost »

Please always provide a full example. Code snippets are almost useless to comprehend a problem. For the short code snippet you provided the image file needs to placed in same directory as the source file (*.tex).


Best regards and welcome to the board
Thorsten
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Default directory for figures TexShop on Mac

Post by frabjous »

localghost wrote: For the short code snippet you provided the image file needs to placed in same directory as the source file (*.tex).
That's not completely true, is it? (Though it would definitely be the simplest place to put it.)

I've never used LaTeX on a mac, but since MacTeX is based on TeXlive, I think this should work. Open a terminal and type in:

kpsepath pict

It should provide a list of folders. These are where LaTeX searches for image files. You can put images in any one of those. However, if you're not going to put them in the same folder as the TeX file, and you're not going to use the \graphicspath command (see page 10 of the graphics/graphicx package manual), then you'd probably need to run

sudo texhash

or perhaps just

texhash

whenever you add a file to one of these folders to have it "registered".

It's probably best to keep things in a folder under your home directory (most likely there will be some listed) rather than messing around with the folders belonging to the core of your TeX installation.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Default directory for figures TexShop on Mac

Post by localghost »

frabjous wrote:[…] That's not completely true, is it? (Though it would definitely be the simplest place to put it.) […]
That's correct. And I wasn't aware of the capabilities of the »kpse« tools. That's and old relic of my MiKTeX times because your suggestion doesn't work there.
frabjous wrote:[…] It should provide a list of folders. These are where LaTeX searches for image files. You can put images in any one of those. […]
As far as I can see, these folders except for those in the »home« directory are completely located within the TeX installation tree. I'm not sure if it is very comfortable to place image files in these locations. Nevertheless you are absolutely right. There are definitely default directories for placing image files. And I think I will use those in my »home« directory for often used images.
Post Reply