figure - Is there a latex command \figuremark, analogous to \footnotemark? -
i using
\footnotemark and
\footnotetext{} (as described here) footnotes, because allows me specify exact position of footnote while maintaining readability of latex code.
is there common command similar figures? like:
\figuremark{label_ref} \begin{figure} (my includegraphics, etc.) \label{label_ref} \end{figure} would give same benefits figures.
the approach of using \footnotemark implies consecutive numbering within text, regardless of \footnotetext might appear. figures different; float around, , referencing them might not coincide placed within text. moreover, quite substantial document elements , therefore deserve preferential treatment of finding place within document best fits document, not place-of-reference.
so, if you're interested in letting float decide it's numbering and location, can use regular \label-\ref system in example. renaming achieve requirements:
\documentclass{article} \usepackage{graphicx} \newcommand{\figuremark}{\ref} \newcommand{\figuretext}{\caption} \usepackage{lipsum} \begin{document} \lipsum[1] see figures~\figuremark{fig:first}, \figuremark{fig:second} and~\figuremark{fig:third}. \begin{figure}[ht] \centering\includegraphics[width=.4\linewidth]{example-image-a} \figuretext{first figure}\label{fig:first} \end{figure} \begin{figure}[ht] \centering\includegraphics[width=.4\linewidth]{example-image-c} \figuretext[toc third figure]{third figure}\label{fig:third} \end{figure} \begin{figure}[ht] \centering\includegraphics[width=.4\linewidth]{example-image-b} \figuretext{second figure}\label{fig:second} \end{figure} \lipsum[2-5] \end{document} if want floats land may (i.e. float) fix numbering match sequential referencing, can this:
\documentclass{article} \usepackage{graphicx} \newcommand{\figuremark}[1]{\refstepcounter{figure}\label{#1}\thefigure} \newcommand{\figuretext}[1]{% \renewcommand{\refstepcounter}[1]{}% make \refstepcounter no-op \renewcommand{\thefigure}{\protect\ref{#1}}% figure counter reference \caption } \usepackage{lipsum} \begin{document} \lipsum[1] see figures~\figuremark{fig:first}, \figuremark{fig:second} and~\figuremark{fig:third}. \begin{figure}[ht] \centering\includegraphics[width=.4\linewidth]{example-image-a} \figuretext{fig:first}{first figure} \end{figure} \begin{figure}[ht] \centering\includegraphics[width=.4\linewidth]{example-image-c} \figuretext{fig:third}{third figure} \end{figure} \begin{figure}[ht] \centering\includegraphics[width=.4\linewidth]{example-image-b} \figuretext{fig:second}{second figure} \end{figure} \lipsum[2-5] \end{document} \figuretext{<label>} works \caption addition have specify accompanying <label> used reference \figuremark{<label>}.
the advantage (benefit) of using regular \label-\ref approach float decides happens, , that's how should be. \pagerefs 1 expect; is, \pageref point figure, not figure referenced.


Comments
Post a Comment