lamme2024-scientific-project/sty/floatlefttextright.sty

70 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

% https://www.developpez.net/forums/d910711/autres-langages/autres-langages/latex/mise-forme/texte-recto-figures-verso/
2024-04-10 13:24:58 +02:00
% Solution by Martigan on Developpez.net, adapted
\RequirePackage{afterpage}
\RequirePackage{caption}
2024-04-10 13:24:58 +02:00
\RequirePackage{etoolbox}
\RequirePackage{environ}
\RequirePackage{float}
2024-04-10 13:24:58 +02:00
\newbool{flcontinue}
\newcommand{\flstart}{
\booltrue{flcontinue}
\afterpage{\flblankpage}
2024-04-10 13:24:58 +02:00
}
\newcommand{\flstop}{
\boolfalse{flcontinue}
2024-04-10 13:24:58 +02:00
}
\newcommand\@fladdfloat{\relax}
\newcommand\fladdfloat[1]{\global\long\def\@fladdfloat{#1}}
\newcommand\@flputfloat{\@fladdfloat\fladdfloat{\relax}}
2024-03-21 19:36:09 +01:00
\newcommand\flblankpage{%
\null
\vfill
\@flputfloat%
\vfill
2024-04-10 13:24:58 +02:00
%\thispagestyle{empty}%
\clearpage%
2024-04-10 13:24:58 +02:00
% \addtocounter{page}{-1}
\ifbool{flcontinue}{
\afterpage{\flblankpage}
}
}
2024-03-21 19:36:09 +01:00
\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
2024-03-21 19:36:09 +01:00
% 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