From 447b03797c64fac1956d4e83bde89d079c18bf4c Mon Sep 17 00:00:00 2001 From: Samuel Ortion Date: Fri, 19 Apr 2024 05:15:33 +0200 Subject: [PATCH] feat: Support tables in floatlefttextright --- sty/floatlefttextright.sty | 43 ++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/sty/floatlefttextright.sty b/sty/floatlefttextright.sty index a570cc0..c3ac87e 100644 --- a/sty/floatlefttextright.sty +++ b/sty/floatlefttextright.sty @@ -15,16 +15,13 @@ \newcommand{\flstop}{ \boolfalse{flcontinue} } -\newcommand\@fladdfig{\relax} -\newcommand\fladdfig[1]{\global\long\def\@fladdfig{#1}} -\newcommand\@flputfig{\@fladdfig\fladdfig{\relax}} +\newcommand\@fladdfloat{\relax} +\newcommand\fladdfloat[1]{\global\long\def\@fladdfloat{#1}} +\newcommand\@flputfloat{\@fladdfloat\fladdfloat{\relax}} \newcommand\flblankpage{% \null \vfill - \begin{figure}[H] - \centering - \@flputfig% - \end{figure} + \@flputfloat% \vfill %\thispagestyle{empty}% \clearpage% @@ -34,19 +31,39 @@ } } +\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 beggining of the document (typically after the titlepage) + % 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 - \fladdfig{% - \includegraphics[scale=1]{Image1} - \caption{Test} - \label{Ima1} + \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 + \flstop \fi