0

Here is my MWE:

\newcommand{\munepsfig}[4][scale=1.0]{%
    \begin{figure}[h]
        \centering

        \includegraphics[#1]{Pictures/#2.jpg}
        \caption[#4]{#3}
        \label{#1}
    \end{figure}
}

and I am using it like:

\munepsfig[scale=0.66]{mm3}{Effect of variation of $\alpha$ on path of node movement \mycite{r22}}{Effect of variation of $\alpha$ on path of node movement}{f3.6}

Here f3.6 is my label, but in text it is not appearing. There is ?? in text.

  • 2
    I guess you want \label{#4} instead – siracusa Apr 27 at 3:16
  • 1
    To be a working example, one must be able to run it as is. What you have is a code fragment. – John Kormylo Apr 27 at 3:39
1

You have a number of problems showing and to address the final outcome you will generally get ?? until a successful prior run has updated the aux files see https://tex.stackexchange.com/a/111281/170109 However you first need a successful 1st run and since your code is based on multiple cut and paste we have no idea what you have pre-set to untangle such a miss-match I would tidy up the command to at least be commented I have taken your word that the label is "f3.6" thus the #5th option

enter image description hereenter image description here

\documentclass{book}
\usepackage{mwe}
\begin{document}
\newcommand{\mycite}[1]{#1}
%above added to mwe to provide minimum working

\newcommand{\munepsfig}[5][scale=1.0]{% <--this has been increased to include the 5th option
    \begin{figure}[h]
        \centering
% #1 = [scale] x scale=1.0 e.g. 0.66 x 1.0
% #2 = baseimage name (AVOID spaces / accents / punctuation) also not a good idea to use subfolders NOR specify one format especially jpg
        \includegraphics[#1]{Pictures/#2.jpg}
% #4 = [VERY LONG INVISIBLE DESCRIPTION]
% #3 = short visible snappy caption with included \cite?
        \caption[#4]{#3}
% #5 = set to ?? before compilation only replaced on 2nd run once doc is scanned
        \label{#5}
    \end{figure}
}  
\munepsfig[scale=0.66]{example-image-A}{Effect of variation of $\alpha$ on path of node movement \mycite{r22}}{Visible Effect of variation of $\alpha$ on path of node movement}{f3.6}   

see Figure~\ref{f3.6}

Above will be

1st pass = see Figure ??

2nd pass= see Figure 1
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.