<?xml version="1.0" encoding="UTF-8"?>

<record version="4" id="1017">
 <title>test table formatting</title>
 <name>TestTableFormatting</name>
 <created>2025-06-03 05:24:11</created>
 <modified>2026-09-06 16:51:47</modified>
 <type>Definition</type>
 <creator id="1" name="bloftin"/>
 <modifier id="1" name="bloftin"/>
 <comment>It is semantically the same table-row operation, but it uses one backslash, so whatever copy/editor path converted \\ into \ cannot damage it.</comment>
 <author id="1" name="bloftin"/>
 <classification>
	<category scheme="pacs" code="00."/>
 </classification>
 <preamble>% this is the default PhysicsLibrary preamble.  as your knowledge
% of TeX increases, you will probably want to edit this, but
% it should be fine as is for beginners.

% almost certainly you want these
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}

% used for TeXing text within eps files
%\usepackage{psfrag}
% need this for including graphics (\includegraphics)
%\usepackage{graphicx}
% for neatly defining theorems and propositions
%\usepackage{amsthm}
% making logically defined graphics
%\usepackage{xypic}

% there are many more packages, add them here as you need them

% define commands here</preamble>
 <content>% ============================================================
% PhysicsLibrary Table Rendering Test Suite
% Stage 1: Standard LaTeX Tables
%
% IMPORTANT:
% Do NOT add any packages to the existing PhysicsLibrary preamble
% for this stage.
%
% This stage uses only standard tabular functionality plus the
% AMS packages already present in the normal PhysicsLibrary preamble.
%
% The purpose is to establish a known-good rendering baseline
% before adding color, hyperlinks, or specialized table packages.
% ============================================================

\section*{LaTeX Table Rendering Test Suite}

This entry provides progressively more complicated examples of LaTeX
tables for Physics Library authors.

It also serves as a regression test for the Physics Library rendering
pipeline.

The examples are intentionally introduced in stages.  Stage 1 uses only
ordinary LaTeX table functionality.  Later stages will independently
introduce colors, hyperlinks, specialized table packages, and other
features.

If a rendering problem occurs, the first failing example can help
identify the feature responsible for the problem.

\subsection*{Stage 1 Test Matrix}

\begin{center}
\begin{tabular}{|c|l|l|}
\hline
\textbf{Test} &amp; \textbf{Feature} &amp; \textbf{Purpose} \
\hline
1 &amp; Simple table &amp; Basic row and column conversion \
\hline
2 &amp; Column alignment &amp; Left, center, and right alignment \
\hline
3 &amp; Horizontal rules &amp; Standard \texttt{hline} rendering \
\hline
4 &amp; Vertical rules &amp; Vertical column separators \
\hline
5 &amp; Full grid &amp; Horizontal and vertical rules together \
\hline
6 &amp; Mathematics &amp; Mathematical expressions in cells \
\hline
7 &amp; Units &amp; Superscripts and mathematical text \
\hline
8 &amp; Multicolumn &amp; Horizontally merged cells \
\hline
9 &amp; Grouped headings &amp; Multiple merged column groups \
\hline
10 &amp; Paragraph column &amp; Wrapped text in a fixed-width cell \
\hline
11 &amp; Table spacing &amp; Row and column spacing adjustments \
\hline
12 &amp; Empty cells &amp; Incomplete table entries \
\hline
13 &amp; Mixed content &amp; Text, math, and numbers together \
\hline
14 &amp; Combined table &amp; Several standard features together \
\hline
\end{tabular}
\end{center}

\subsection*{Test 1: Simplest Possible Table}

This is close to the smallest useful \texttt{tabular} example.

\begin{center}
\begin{tabular}{ccc}
A &amp; B &amp; C \
1 &amp; 2 &amp; 3 \
4 &amp; 5 &amp; 6
\end{tabular}
\end{center}

This test contains no table rules and no special formatting.

\subsection*{Test 2: Column Alignment}

The letters \texttt{l}, \texttt{c}, and \texttt{r} specify left,
center, and right alignment.

\begin{center}
\begin{tabular}{lcr}
\textbf{Left} &amp; \textbf{Center} &amp; \textbf{Right} \
Apple &amp; 10 &amp; 1.25 \
Orange &amp; 125 &amp; 12.50 \
Banana &amp; 3 &amp; 0.75
\end{tabular}
\end{center}

The different lengths of the entries make the alignment easier to see.

\subsection*{Test 3: Horizontal Rules}

The standard \texttt{hline} command creates horizontal table rules.

\begin{center}
\begin{tabular}{lcc}
\hline
\textbf{Object} &amp; \textbf{Mass} &amp; \textbf{Velocity} \
\hline
A &amp; 2.0 &amp; 5.0 \
B &amp; 4.0 &amp; 3.0 \
C &amp; 8.0 &amp; 1.5 \
\hline
\end{tabular}
\end{center}

\subsection*{Test 4: Vertical Rules}

Vertical bars in the column specification create vertical separators.

\begin{center}
\begin{tabular}{l|c|r}
Item &amp; Quantity &amp; Price \
Apple &amp; 10 &amp; $0.50 \
Banana &amp; 15 &amp; $0.30 \
Orange &amp; 8 &amp; $0.60
\end{tabular}
\end{center}

\subsection*{Test 5: Full Grid}

This is the conventional fully bordered table.

\begin{center}
\begin{tabular}{|c|c|c|}
\hline
\textbf{ID} &amp; \textbf{Name} &amp; \textbf{Score} \
\hline
1 &amp; Alice &amp; 85 \
\hline
2 &amp; Bob &amp; 92 \
\hline
3 &amp; Carol &amp; 78 \
\hline
\end{tabular}
\end{center}

This test is intentionally similar to the original Physics Library
table-rendering example.

\subsection*{Test 6: Mathematics Inside Cells}

Physics Library tables frequently contain mathematical expressions.

\begin{center}
\begin{tabular}{|l|c|}
\hline
\textbf{Quantity} &amp; \textbf{Equation} \
\hline
Velocity &amp; $v=\dfrac{dx}{dt}$ \
\hline
Acceleration &amp; $a=\dfrac{d^2x}{dt^2}$ \
\hline
Force &amp; $F=ma$ \
\hline
Momentum &amp; $p=mv$ \
\hline
Kinetic energy &amp; $T=\dfrac{1}{2}mv^2$ \
\hline
\end{tabular}
\end{center}

This checks fractions, derivatives, superscripts, subscripts, and
ordinary mathematical symbols.

\subsection*{Test 7: Physical Units}

This table tests mathematical notation combined with SI units.

\begin{center}
\begin{tabular}{|l|c|c|}
\hline
\textbf{Quantity} &amp; \textbf{Symbol} &amp; \textbf{SI Unit} \
\hline
Distance &amp; $x$ &amp; $\mathrm{m}$ \
\hline
Time &amp; $t$ &amp; $\mathrm{s}$ \
\hline
Velocity &amp; $v$ &amp; $\mathrm{m,s^{-1}}$ \
\hline
Acceleration &amp; $a$ &amp; $\mathrm{m,s^{-2}}$ \
\hline
Force &amp; $F$ &amp; $\mathrm{kg,m,s^{-2}}$ \
\hline
Energy &amp; $E$ &amp; $\mathrm{kg,m^2,s^{-2}}$ \
\hline
\end{tabular}
\end{center}

\subsection*{Test 8: A Merged Heading}

The standard \texttt{multicolumn} command can merge adjacent columns.

\begin{center}
\begin{tabular}{|l|c|c|}
\hline
\multicolumn{3}{|c|}{\textbf{Student Grades}} \
\hline
\textbf{Student} &amp; \textbf{Physics} &amp; \textbf{Mathematics} \
\hline
David &amp; A &amp; A- \
\hline
Emma &amp; B+ &amp; A \
\hline
Maria &amp; A- &amp; B+ \
\hline
\end{tabular}
\end{center}

\subsection*{Test 9: Grouped Column Headings}

Multiple \texttt{multicolumn} commands can be used within the same row.

\begin{center}
\begin{tabular}{|c|cc|cc|}
\hline
&amp;
\multicolumn{2}{c|}{\textbf{Position}} &amp;
\multicolumn{2}{c|}{\textbf{Velocity}} \
\hline
\textbf{Time} &amp;
$x$ &amp;
$y$ &amp;
$v_x$ &amp;
$v_y$ \
\hline
0 &amp; 0 &amp; 0 &amp; 10 &amp; 20 \
\hline
1 &amp; 10 &amp; 15.1 &amp; 10 &amp; 10.2 \
\hline
2 &amp; 20 &amp; 20.4 &amp; 10 &amp; 0.4 \
\hline
\end{tabular}
\end{center}

\subsection*{Test 10: Wrapped Paragraph Column}

The standard \texttt{p} column type creates a fixed-width paragraph
column.

\begin{center}
\begin{tabular}{|l|p{8cm}|}
\hline
\textbf{Feature} &amp; \textbf{Description} \
\hline
Tabular &amp;
The standard LaTeX environment used to arrange information into rows
and columns. \
\hline
Paragraph column &amp;
A column with a specified width allows longer text to wrap rather than
forcing the table to continually expand horizontally. \
\hline
Physics use &amp;
This is useful for definitions, experimental observations, assumptions,
and explanations associated with equations or numerical results. \
\hline
\end{tabular}
\end{center}

This is particularly useful as a make4ht test because PDF and HTML
renderers may interpret fixed physical widths differently.

\subsection*{Test 11: Table Spacing}

Spacing can be modified locally without loading another package.

\begin{center}
{
\renewcommand{\arraystretch}{1.5}
\setlength{\tabcolsep}{12pt}

\begin{tabular}{|c|c|c|}
\hline
\textbf{Parameter} &amp; \textbf{Symbol} &amp; \textbf{Value} \
\hline
Mass &amp; $m$ &amp; $2.5\ \mathrm{kg}$ \
\hline
Velocity &amp; $v$ &amp; $12.0\ \mathrm{m/s}$ \
\hline
Acceleration &amp; $a$ &amp; $9.81\ \mathrm{m/s^2}$ \
\hline
\end{tabular}
}
\end{center}

The braces limit the spacing changes to this example.

\subsection*{Test 12: Empty Cells}

Real tables sometimes contain unavailable or intentionally blank data.

\begin{center}
\begin{tabular}{|l|c|c|}
\hline
\textbf{Sensor} &amp; \textbf{Reading 1} &amp; \textbf{Reading 2} \
\hline
Sensor A &amp; 12.4 &amp; 12.7 \
\hline
Sensor B &amp; 8.1 &amp; \
\hline
Sensor C &amp; &amp; 4.6 \
\hline
Sensor D &amp; &amp; \
\hline
\end{tabular}
\end{center}

\subsection*{Test 13: Mixed Text, Mathematics, and Numbers}

A realistic technical table often combines several different content
types.

\begin{center}
\begin{tabular}{|l|c|c|l|}
\hline
\textbf{Parameter} &amp;
\textbf{Expression} &amp;
\textbf{Value} &amp;
\textbf{Description} \
\hline
Mass &amp;
$m$ &amp;
10.0 kg &amp;
Vehicle mass \
\hline
Speed &amp;
$v$ &amp;
25.0 m/s &amp;
Forward speed \
\hline
Momentum &amp;
$p=mv$ &amp;
250 kg m/s &amp;
Linear momentum \
\hline
Energy &amp;
$T=\dfrac{1}{2}mv^2$ &amp;
3125 J &amp;
Kinetic energy \
\hline
\end{tabular}
\end{center}

\subsection*{Test 14: Combined Standard-LaTeX Table}

This final Stage 1 example combines rules, mathematics, merged headings,
units, and a paragraph column.

\begin{center}
\begin{tabular}{|l|c|c|p{6cm}|}
\hline
\multicolumn{4}{|c|}{\textbf{Projectile Motion Example}} \
\hline
\textbf{Quantity} &amp;
\textbf{Symbol} &amp;
\textbf{Value} &amp;
\textbf{Description} \
\hline
Initial speed &amp;
$v_0$ &amp;
$25\ \mathrm{m/s}$ &amp;
Magnitude of the projectile velocity at launch. \
\hline
Launch angle &amp;
$\theta$ &amp;
$45^\circ$ &amp;
Angle of the initial velocity above the local horizontal. \
\hline
Gravity &amp;
$g$ &amp;
$9.81\ \mathrm{m/s^2}$ &amp;
Constant gravitational acceleration used in the simple model. \
\hline
Horizontal speed &amp;
$v_0\cos\theta$ &amp;
$17.68\ \mathrm{m/s}$ &amp;
The horizontal component remains constant when aerodynamic drag is
neglected. \
\hline
Vertical speed &amp;
$v_0\sin\theta$ &amp;
$17.68\ \mathrm{m/s}$ &amp;
The initial vertical component changes because of gravity. \
\hline
\end{tabular}
\end{center}

\section*{Stage 1 Interpretation}

If all fourteen examples render successfully, the Physics Library
make4ht pipeline has demonstrated support for:

\begin{itemize}
\item ordinary \texttt{tabular} environments,
\item left, center, and right column alignment,
\item horizontal rules,
\item vertical rules,
\item mathematical notation inside cells,
\item superscripts and subscripts,
\item SI-unit notation,
\item \texttt{multicolumn},
\item paragraph columns,
\item local table spacing changes,
\item empty cells,
\item and combinations of these standard features.
\end{itemize}

\section*{Planned Rendering Stages}

Once Stage 1 is known to render correctly, additional capabilities should
be introduced one at a time.

\begin{center}
\begin{tabular}{|c|l|l|}
\hline
\textbf{Stage} &amp; \textbf{New Capability} &amp; \textbf{Proposed Package} \
\hline
1 &amp; Standard tables &amp; None \
\hline
2 &amp; Colored text &amp; \texttt{xcolor} \
\hline
3 &amp; Hyperlinks &amp; \texttt{hyperref} \
\hline
4 &amp; Cell and row backgrounds &amp; \texttt{colortbl} \
\hline
5 &amp; Professional rules &amp; \texttt{booktabs} \
\hline
6 &amp; Vertical cell merging &amp; \texttt{multirow} \
\hline
7 &amp; Flexible-width tables &amp; \texttt{tabularx} \
\hline
8 &amp; Multi-page tables &amp; \texttt{longtable} \
\hline
9 &amp; Images inside cells &amp; \texttt{graphicx} \
\hline
10 &amp; Combined stress tests &amp; Multiple packages \
\hline
\end{tabular}
\end{center}

Each stage should first contain a minimal isolated example.  Only after
that example renders successfully should the new capability be combined
with features from earlier stages.</content>
</record>
