Skip to content

Instantly share code, notes, and snippets.

@TobiasBouma
Created July 10, 2015 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TobiasBouma/de4fa02c4e7fa12141ca to your computer and use it in GitHub Desktop.
Save TobiasBouma/de4fa02c4e7fa12141ca to your computer and use it in GitHub Desktop.
test x.tex
\documentclass{classnofonts}
\usepackage{blindtext}
\usepackage[demo]{graphicx}
\graphicspath{{pictures/}}
\makeatletter
\let\oldcaption\caption
\newcount\realfig
\def\caption{%
\protected@write\@auxout{}{\string\real@fig{\the\value{figure}}}%
\expandafter\csname real@@fig@\the\value{figure}\endcsname
\oldcaption}
\def\real@fig#1{%
\global\advance\realfig\@ne
\expandafter\xdef\csname real@@fig@#1\endcsname{%
\def\noexpand\thefigure{\the\realfig}%
}}
\makeatother
\begin{document}
\begin{figure*}[b]
\includegraphics[width=.99\linewidth]{example-image-a}
\caption{fafqfaf}
\end{figure*}
\blindtext
\begin{marginfigure}%
\includegraphics[width=\linewidth]{example-image-a}
\caption{a4a4a4a4a4}
\end{marginfigure}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment