[texhax] controlling table locations

Uwe Lueck uwe.lueck at web.de
Wed May 14 08:24:00 CEST 2014


% Thomas Schneider 14. Mai 2014 um 05:35:
> \newcommand{\tablelocation}{p}
> \begin{table}[\tablelocation] % the table goes to the top of the current page!
> ...
> \end[table}
> % Switching to
> \newcommand{\tablelocation}{h}
> % LaTeX still put the table at the top of the current page.

% Probably
\let\endswpostable\endtable
\newcommand*\swpostable{%
    \expandafter\table\expandafter[\tablelocation]}
% instead of your code above:
\begin{swpostable}
...
\end{swpostable}
% should place the float according to \tablelocation.
% If you later get an idea like
\newcommand*\tablelocation{\truetablelocation}
...
\newcommand*\truetablelocation{h}
% use
\newcommand*\swpostable{%
    \edef\TempMacro{\noexpand\table\[\tablelocation]}%
    \TempMacro}
% instead of definition above.

% Cheers,
%
%    Uwe.



More information about the texhax mailing list