lamme2024-scientific-project/sty/floatlefttextright.sty

70 lines
1.4 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\@fladdfloat{\relax}
\newcommand\fladdfloat[1]{\global\long\def\@fladdfloat{#1}}
\newcommand\@flputfloat{\@fladdfloat\fladdfloat{\relax}}
\newcommand\flblankpage{%
\null
\vfill
\@flputfloat%
\vfill
%\thispagestyle{empty}%
\clearpage%
% \addtocounter{page}{-1}
\ifbool{flcontinue}{
\afterpage{\flblankpage}
}
}
\newcommand{\fladdfig}[1]{
\fladdfloat{
\begin{figure}[H]
\centering
#1
\end{figure}
}
}
\newcommand{\fladdtab}[1]{
\fladdfloat{
\begin{table}[H]
\centering
#1
\end{table}
}
}
\iffalse
% Example
% Add this at the beginning of the document (typically after the titlepage)
\flstart
% Then for each new figure you want to add, add the following
\fladdfloat{%
\begin{figure}[H]
\includegraphics[scale=1]{Image1}
\caption{Test}
\label{Ima1}
\end{figure}
}
% At the end of the document, to avoid a unwanted late terminated loop of empty page creation, add the following
\flstop
\fi