1

This question already has an answer here:

how can I define a command so that in the preamble of my document I can have something like

\FigureFolder{name}

So that the following two commands will work

\newcommand{\FigureCaption}[3]{\begin{figure}[h!]\centering\includegraphics[scale=#1]{FIGURES/\FigureFolder/#2}\caption{#3}\label{#2}\end{figure}}

\newcommand{\FigureNoCaption}[2]{\begin{figure}[h!]\centering\includegraphics[scale=#1]{FIGURES/\FigureFolder/#2}\label{#2}\end{figure}}

Basically I want to associate with every of my LaTeX files a separate figure folder (to keep things a bit organised), and specify the name of that folder at the beginning of the document. Of course, I know I could just copy the \newcommand codes in the preamble but I prefer to put those commands in a .sty file and not have too many things at the top of my document.

marked as duplicate by Johannes_B, user13907, Benedikt Bauer, Mico, Svend Tveskæg Dec 14 '15 at 13:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 6
    Typically that is called \graphicspath{{name}} and then you can drop \FigureFolder from the file path in \includegraphics. – Werner Apr 28 '14 at 14:44
  • 7
    See Automatically locate included images. – Werner Apr 28 '14 at 14:46
  • Or you can have in the directory that contains your project's files a Figures subdirectory that contains only symbolic links to the real graphic files — which you store where you please. – Bernard Apr 28 '14 at 14:58
  • Welcome to the site! Please let us know if @Werner's link resolves the issue; if your question is a follow-up, that's ok :) Let us know either way! – cmhughes Apr 28 '14 at 16:35

Browse other questions tagged or ask your own question.