I have a question which would make writing in LaTeX easier for me. The short version of the question is: "Is it possible to create a custom label (as a reference to a figure, table, e.g. in the preamble), which can be later in the document referenced using the \ref command?"
Now the longer version: I use LaTeX for writing scientific articles. They are often composed of two separate documents (main text and supplementary info), which are designed as separate files (pdfs). (I tried using a single .tex file for both documents, but then there are other problems with formatting and using templates, so it does not simplify the original problem.) This means that I need to make references to figures which are included in a different file. If the figures in the main text are numbered as 1, 2, 3,... and in the supplementary info as S1, S2, S3,... the obvious solution, and the one I use, is to create a new command for referencing Figure S1 in the main text:
Code: Select all
\newcommand{\fGraph}{Fig.~S1}
The problem with this solution is that during the revision process a lot of figures might need to be moved between the main text and the supplementary info; so if I need to move original Fig.~2 (say it was labeled \label{fResults}) from main text to supplementary info and rename it to Fig.~S3, I have to "manually" find all references to Fig.~2 using the \ref{fResults} command and replace them with a command \fResults (defined as \newcommand{\fResults}{Fig.~S3}). When I move more figures and also have to consider subfigures, there are always some mistakes.
So, is it possible to use something like:
Code: Select all
\mylabel{fResults}{S3}
and later in the document reference to this label using:
Code: Select all
Fig.~\ref{fResults}
Thanks a lot!
Katka