Graphics, Figures & TablesShortening path for figure/tables/pictures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mnajem
Posts: 20
Joined: Thu Mar 18, 2010 12:23 pm

Shortening path for figure/tables/pictures

Post by mnajem »

Hi,

I wonder if I could put an alias to the path of my folder and subfolder. Say for example, given that I have to put

Code: Select all

\begin{frame}{Microsoft Windows' Segments}
 \begin{figure}
  \fbox{\includegraphics[scale=0.35]{/home/najmi/Dropbox/mythesis-UTM/utmthesis/source/fig/windows-share.png}}
\caption{Windows product lines and usage share \cite{OPSWAT2011}} 
\end{figure}
\end{frame}

is there a way to put the path in the preamble,predefined,so that I just have to issue the variable?

something like, $PATHNAME

Code: Select all

\begin{frame}{Microsoft Windows' Segments}
 \begin{figure}
  \fbox{\includegraphics[scale=0.35]{$PATHNAME/windows-share.png}}
\caption{Windows product lines and usage share \cite{OPSWAT2011}} 
\end{figure}
\end{frame}

Recommended reading 2024:

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

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

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

Shortening path for figure/tables/pictures

Post by localghost »

You could use the \graphicspath command from the graphicx package. But for several reasons it is not recommendable and therefore should be avoided (see l2tabu, Section 3.4).


Thorsten
Post Reply