lamme2024-scientific-project/sty/floatlefttextright.sty

53 lines
1.2 KiB
TeX

% https://www.developpez.net/forums/d910711/autres-langages/autres-langages/latex/mise-forme/texte-recto-figures-verso/
% Solution by Martigan on Developpez.net, adapted
\RequirePackage{afterpage}
\RequirePackage{caption}
\RequirePackage{etoolbox}
\RequirePackage{environ}
\RequirePackage{float}
\newbool{flcontinue}
\newcommand{\flstart}{
\booltrue{flcontinue}
\afterpage{\flblankpage}
}
\newcommand{\flstop}{
\boolfalse{flcontinue}
}
\newcommand\@fladdfig{\relax}
\newcommand\fladdfig[1]{\global\long\def\@fladdfig{#1}}
\newcommand\@flputfig{\@fladdfig\fladdfig{\relax}}
\newcommand\flblankpage{%
\null
\vfill
\begin{figure}[H]
\centering
\@flputfig%
\end{figure}
\vfill
%\thispagestyle{empty}%
\clearpage%
% \addtocounter{page}{-1}
\ifbool{flcontinue}{
\afterpage{\flblankpage}
}
}
\iffalse
% Example
% Add this at the beggining of the document (typically after the titlepage)
\flstart
% Then for each new figure you want to add, add the following
\fladdfig{%
\includegraphics[scale=1]{Image1}
\caption{Test}
\label{Ima1}
}
% At the end of the document, to avoid a unwanted late terminated loop of empty page creation, add the following
flstop
\fi