Figure numbering without the figure

You can use the comment package to enclose the \includegraphics commands, and the tikzpicture environments inside a comment environment (using/commenting out \includecomment{comment} you can show/hide the figures at any time):

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{tikz}
\usepackage{comment}
\usepackage{lipsum}
%\includecomment{comment} % to actually include the figures

\begin{document}

\lipsum[1]
\begin{figure}[!ht]
\centering
\begin{comment}
  \includegraphics[height=1cm]{name1}
\end{comment}
\caption{a test caption}
 \label{fig:test1}
\end{figure}
\lipsum[1]
\begin{figure}[!hb]
\centering
\begin{comment}
   \begin{tikzpicture}[auto]
      \draw (0,0) --(1,2);.
    \end{tikzpicture}
\end{comment}
\caption{another test caption}
 \label{fig:test2}
\end{figure}

In Figures ~\ref{fig:test1} and~\ref{fig:test2}...

\end{document}

enter image description here

The demo option for graphicx was used to make the example compilable for everyone; do not use the option in your actual document.


As far as I can tell, from the specifications under 8. Uploading Figures to the PLoS Manuscript Submission System a special package for flushing images to end of the document does not seem necessary:

Figure guidelines for PLoS Journal

Moreover, figures need not be numbered by section. They should be sequential, as stated under 3. Titles and Legends:

Titles and legends (captions) for main figures (i.e., not Supporting Figures) should be included in the main article file, not as part of the figure files themselves. Figure legends do not need to be uploaded to the online system. Do not include author names or the article title within the figure files. Instead, list the following information for each figure at the end of the article file, after the references, but before any tables:

  • Figure number (in sequence, using Arabic numerals: Figure 1, Figure 2, Figure 3, etc.)
  • Short title using a maximum of 15 words. The figure title should be bold type, using sentence case ending with a period (.). For example: Figure 1. Adaptation and its potential costs.
  • A detailed legend of 300 words maximum can follow the figure title. Each panel should be described in the legend.

With this in mind, I would create a macro/command that would do exactly the what is stated above and merely place them at the end of the document. Here's an example:

\documentclass{article}

\newcommand{\newfig}{% A new figure
  \bigskip% Big skip between figure legends
  \refstepcounter{figure}% Increment counter for correct referencing
  \item \bfseries Figure~\arabic{figure}.\ \ignorespaces%
}%
\newcommand{\figlegend}{% An accompanying figure legend
  \item[] \mdseries% Typeset in regular/medium font
}

\begin{document}

\section{First section}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer lacinia nisl ac augue
vehicula blandit. Donec quis nulla at massa blandit aliquet sit amet id mauris. 
Figure~\ref{fig:first} is here. Ut et pharetra risus. Morbi hendrerit rutrum magna, eu 
porta magna imperdiet in. Proin blandit placerat justo, non blandit nisi dapibus vitae. 
Nunc sollicitudin volutpat ante, ac mollis neque ultricies eget. Fusce eu dolor vitae 
tortor feugiat sagittis et et neque. Figure~\ref{fig:second} is here. Pellentesque odio 
enim, imperdiet egestas suscipit in, accumsan eu nisl. Nunc iaculis semper viverra. 
Aliquam erat volutpat. Aliquam augue massa, gravida sed placerat ut, facilisis a ante. 
Suspendisse consectetur porta convallis. Fusce auctor lacinia lobortis.

\section{Second section}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer lacinia nisl ac augue 
vehicula blandit. Donec quis nulla at massa blandit aliquet sit amet id mauris. 
Figure~\ref{fig:third} is here. Ut et pharetra risus. Morbi hendrerit rutrum magna, eu 
porta magna imperdiet in. Proin blandit placerat justo, non blandit nisi dapibus vitae. 
Nunc sollicitudin volutpat ante, ac mollis neque ultricies eget. 
Figure~\ref{fig:fourth} is here. Fusce eu dolor vitae tortor feugiat sagittis et et 
neque. Pellentesque odio enim, imperdiet egestas suscipit in, accumsan eu nisl. Nunc 
iaculis semper viverra. Aliquam erat volutpat. Aliquam augue massa, gravida sed 
placerat ut, facilisis a ante. Suspendisse consectetur porta convallis. Fusce auctor 
lacinia lobortis.

\section{Last section}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer lacinia nisl ac augue 
vehicula blandit. Donec quis nulla at massa blandit aliquet sit amet id mauris. Ut et 
pharetra risus. Morbi hendrerit rutrum magna, eu porta magna imperdiet in. Proin 
blandit placerat justo, non blandit nisi dapibus vitae. Figure~\ref{fig:fifth} is here. 
Nunc sollicitudin volutpat ante, ac mollis neque ultricies eget. Fusce eu dolor vitae 
tortor feugiat sagittis et et neque. Pellentesque odio enim, imperdiet egestas suscipit 
in, accumsan eu nisl. Figure~\ref{fig:sixth} is here. Nunc iaculis semper viverra. 
Aliquam erat volutpat. Aliquam augue massa, gravida sed placerat ut, facilisis a ante. 
Suspendisse consectetur porta convallis. Fusce auctor lacinia lobortis. 
Figure~\ref{fig:seventh} is here.

\clearpage
% Figure legends

\begin{itemize}
  \newfig First figure caption.\label{fig:first}
  \figlegend Legend for the first figure.
  
  \newfig Second figure caption.\label{fig:second}
  \figlegend Legend for the second figure.

  \newfig Third figure caption.\label{fig:third}
  \figlegend Legend for the third figure.

  \newfig Fourth figure caption.\label{fig:fourth}
  \figlegend Legend for the fourth figure.

  \newfig Fifth figure caption.\label{fig:fifth}
  \figlegend Legend for the fifth figure.

  \newfig Sixth figure caption.\label{fig:sixth}
  \figlegend Legend for the sixth figure.

  \newfig Seventh figure caption.\label{fig:seventh}
  \figlegend Legend for the seventh figure.

\end{itemize}

\end{document}

The above example has references to figures interspersed with all the figure legends at the end of the document (after \clearpage). No additional packages are loaded. Two new commands have been created: \newfig and \figlegend each of which are used in succession at the document end to produce and typeset the list (in the form of an itemize environment) of figures and legends.

Example article submission for PLoS

I am assuming, to echo your original comment, that the journal lays this out themselves in order to make sure submissions comply to their standards. Moreover, then they have control over allowing image views in an online version of the article.


Hey I am currently formatting an article for PlosOne as well and was quite annoyed with their requirement for figures in LaTeX: combining subfigures in one figure and removing the figures from PDF file.

My way of doing it is quite simple: I created floating environment for my figures, then included, wrote a caption and and gave a label within the environment. Finally I force the position of my float using [H] option of float package as it is now mentioned that Figure legend should appear right after they are first mentioned in the text. Before submission I simply comment all line where I actually included the figures. This seemed to work without messing with numbering and/or referencing in the text.

Here an example:

\documentclass{article}
%
\usepackage{float}
\usepackage{cleveref}
\usepackage{lipsum}
\usepackage{caption}
%
\begin{document}
%
lipsum[1]\cref{fig1}   
\begin{figure}[H]
%\includegraphics{fig1}
\caption{Figure title}
\caption*{Legend} % I chose this solution to meet PlosOne requirement about second line legend particularly useful for table where title needs to be on top of the object and legend at the bottom
\label{fig1}
\end{figure}
%
\end{document}