[texhax] controlling table locations

Uwe Lueck uwe.lueck at web.de
Wed May 14 18:10:27 CEST 2014


My earlier suggestion

    \begin{swpostable}
    ...
    \end{swpostable}

without \let, \expandafter, \edef, pure LaTeX: instead of choosing
definition of \tablelocation from

%   \newcommand{\tablelocation}{h}
%   \newcommand{\tablelocation}{p}

choose from

%   \newenvironment{swpostable}{\table[h]}{\endtable}
%   \newenvironment{swpostable}{\table[p]}{\endtable}

(Don't use \tablelocation at all.)

Cheers,

    Uwe.
 
================================================================================
% 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.

_______________________________________________
TeX FAQ: http://www.tex.ac.uk/faq
Mailing list archives: http://tug.org/pipermail/texhax/[http://tug.org/pipermail/texhax/]
More links: http://tug.org/begin.html[http://tug.org/begin.html]

Automated subscription management: http://tug.org/mailman/listinfo/texhax[http://tug.org/mailman/listinfo/texhax]
Human mailing list managers: postmaster at tug.org




More information about the texhax mailing list