Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tables] Various cleanups. #2852

Merged
merged 3 commits into from
May 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 34 additions & 56 deletions source/tables.tex
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,41 @@
{
}

% floattablebase without TableBase, used for lib2dtab2base
\newenvironment{floattablebasex}[4]
{
\begin{table}[#4]
\caption{\label{#2}#1}
\begin{center}
\begin{tabular}{|#3|}
}
{
\bottomline
\end{tabular}
\end{center}
\end{table}
}


% General Usage: TITLE is the title of the table, XREF is the
% cross-reference for the table. LAYOUT is a sequence of column
% type specifiers (e.g. cp{1.0}c), without '|' for the left edge
% or right edge.

% usage: \begin{floattablebase}{TITLE}{XREF}{COLUMNS}{PLACEMENT}
% usage: \begin{floattablebase}{TITLE}{XREF}{LAYOUT}{PLACEMENT}
% produces floating table, location determined within limits
% by LaTeX.
\newenvironment{floattablebase}[4]
{
\begin{TableBase}
\begin{table}[#4]
\caption{\label{#2}#1}
\begin{center}
\begin{tabular}{|#3|}
\begin{floattablebasex}{#1}{#2}{#3}{#4}
}
{
\bottomline
\end{tabular}
\end{center}
\end{table}
\end{floattablebasex}
\end{TableBase}
}

% usage: \begin{floattable}{TITLE}{XREF}{COLUMNS}
% usage: \begin{floattable}{TITLE}{XREF}{LAYOUT}
% produces floating table, location determined within limits
% by LaTeX.
\newenvironment{floattable}[3]
Expand All @@ -94,7 +104,7 @@
\end{tabular}
}

% usage: \begin{multicolfloattable}{TITLE}{XREF}{COLUMNS}
% usage: \begin{multicolfloattable}{TITLE}{XREF}{LAYOUT}
% produces floating table, location determined within limits
% by LaTeX.
\newenvironment{multicolfloattable}[3]
Expand Down Expand Up @@ -150,40 +160,24 @@
\end{libsumtabbase}
}

% usage: \begin{concepttable}{TITLE}{TAG}{LAYOUT}
% usage: \begin{concepttable}{TITLE}{XREF}{LAYOUT}
% produces table at current location
\newenvironment{concepttable}[3]
{
\begin{TableBase}
\begin{table}[!htb]
\caption[#1]{\label{tab:#2}#1}
\begin{center}
\begin{tabular}{|#3|}
\begin{floattablebase}{#1}{tab:#2}{#3}{!htb}
}
{
\bottomline
\end{tabular}
\end{center}
\end{table}
\end{TableBase}
\end{floattablebase}
}

% usage: \begin{simpletypetable}{TITLE}{TAG}{LAYOUT}
% usage: \begin{simpletypetable}{TITLE}{XREF}{LAYOUT}
% produces table at current location
\newenvironment{simpletypetable}[3]
{
\begin{TableBase}
\begin{table}[!htb]
\caption{#1}\label{#2}
\begin{center}
\begin{tabular}{|#3|}
\begin{floattablebase}{#1}{#2}{#3}{!htb}
}
{
\bottomline
\end{tabular}
\end{center}
\end{table}
\end{TableBase}
\end{floattablebase}
}

% usage: \begin{LongTable}{TITLE}{XREF}{LAYOUT}
Expand All @@ -192,8 +186,8 @@
{
\newcommand{\continuedcaption}{\caption[]{#1 (continued)}}
\begin{TableBase}
\begin{longtable}
{|#3|}\caption{#1}\label{#2}
\begin{longtable}{|#3|}
\caption{#1}\label{#2}
}
{
\bottomline
Expand Down Expand Up @@ -423,18 +417,6 @@
\end{LibEffTab}
}

% usage: \begin{libefftabvaluenarrow}{TITLE}{XREF}
% produces a two-column effects table with right column
% header "Value", width 1.5 in. Used in basic_string_view effects
% tables in standard.
\newenvironment{libefftabvaluenarrow}[2]
{
\begin{LibEffTab}{#1}{#2}{Value}{1.5in}
}
{
\end{LibEffTab}
}

% Same as libefftabvalue except that it uses a long table and a
% slightly wider column.
\newenvironment{longlibefftabvalue}[2]
Expand Down Expand Up @@ -487,21 +469,17 @@
\newcommand{\hdstyle}[1]{\textbf{##1}}
\newcommand{\rowhdr}[1]{\hdstyle{##1}&}
\newcommand{\colhdr}[1]{\multicolumn{1}{|>{\centering}m{#6}|}{\hdstyle{##1}}}
%% FIXME: figure out a way to reuse floattable here
jensmaurer marked this conversation as resolved.
Show resolved Hide resolved
\begin{table}[htbp]
\caption{\label{#2}#1}
\begin{center}
\begin{tabular}{|>{\centering}m{#5}|@{}p{0.2\normalbaselineskip}@{}|m{#6}|m{#7}|}
\begin{floattablebasex}
{#1}{#2}
{>{\centering}m{#5}|@{}p{0.2\normalbaselineskip}@{}|m{#6}|m{#7} }
{htbp}
%% table header
\topline
\multicolumn{1}{c}{}&&\colhdr{#3}&\colhdr{#4}\\
\capsep
}
{
\bottomline
\end{tabular}
\end{center}
\end{table}
\end{floattablebasex}
}

\newenvironment{lib2dtab2}[4]{
Expand Down