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

<record version="8" id="1017">
 <title>test table formatting</title>
 <name>TestTableFormatting</name>
 <created>2025-06-03 05:24:11</created>
 <modified>2026-09-06 19:14:57</modified>
 <type>Definition</type>
 <creator id="1" name="bloftin"/>
 <modifier id="1" name="bloftin"/>
 <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
\usepackage{hyperref}
\usepackage{xcolor}
% define commands here</preamble>
 <content>\section*{LaTeX Table Rendering Test Suite}

This entry tests LaTeX table rendering in the Physics Library
make4ht pipeline.

For these examples, table rows are terminated with
\texttt{\textbackslash tabularnewline} rather than the traditional
double-backslash notation. This avoids ambiguity introduced by text
processing or editor escaping of repeated backslash characters.

The tests are intentionally introduced in stages. Each stage adds only
a small number of new LaTeX features so that rendering failures can be
isolated.

\subsection*{Test 1: Minimal Table}

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

\subsection*{Test 2: Horizontal Rules}

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

\subsection*{Test 3: Full Grid}

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

\subsection*{Test 4: Alignment}

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

\subsection*{Test 5: Mathematics}

\begin{center}
\begin{tabular}{|l|c|c|}
\hline
\textbf{Quantity} &amp; \textbf{Equation} &amp; \textbf{SI Unit}
\tabularnewline
\hline
Velocity &amp;
$v=\dfrac{dx}{dt}$ &amp;
$\mathrm{m,s^{-1}}$
\tabularnewline
\hline
Acceleration &amp;
$a=\dfrac{d^2x}{dt^2}$ &amp;
$\mathrm{m,s^{-2}}$
\tabularnewline
\hline
Force &amp;
$F=ma$ &amp;
$\mathrm{N}$
\tabularnewline
\hline
Energy &amp;
$E=\dfrac{1}{2}mv^2$ &amp;
$\mathrm{J}$
\tabularnewline
\hline
\end{tabular}
\end{center}

\subsection*{Test 6: Multicolumn}

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

\subsection*{Test 7: Paragraph Column}

\begin{center}
\begin{tabular}{|l|p{8cm}|}
\hline
\textbf{Feature} &amp; \textbf{Description}
\tabularnewline
\hline
Tabular &amp;
The standard LaTeX environment for arranging information into rows
and columns.
\tabularnewline
\hline
Paragraph column &amp;
A fixed-width paragraph column allows longer text to wrap inside the
table cell.
\tabularnewline
\hline
Rendering test &amp;
This tests how make4ht converts a fixed-width LaTeX table column into
HTML.
\tabularnewline
\hline
\end{tabular}
\end{center}

\subsection*{Test 8: Grouped Headings}

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

\section*{Stage 1A Result}

If all of the tables above render correctly, the basic table system is
working and the earlier failure can be attributed to corruption of the
traditional double-backslash table row terminator.

The rendering suite therefore continues using
\texttt{\textbackslash tabularnewline} so that the source remains robust
when copied through the Physics Library editing pipeline.

\section*{Stage 1B: Hyperlink Rendering}

This stage introduces the \texttt{hyperref} package.

The preamble for this stage should contain

\begin{verbatim}
\usepackage{hyperref}
\end{verbatim}

No color package is required for this stage.

Hyperlinks are first tested outside a table. A second test then places
the same type of hyperlink inside a table cell. This allows the general
hyperlink renderer and the interaction between hyperlinks and tables to
be tested separately.

\subsection*{Test 9: Hyperlink Outside a Table}

The following text should appear as a clickable external hyperlink:

\href{https://physicslibrary.org/}{Visit Physics Library}

A second hyperlink points to the LaTeX Project:

\href{https://www.latex-project.org/}{Visit the LaTeX Project}

If both pieces of text appear as working hyperlinks, then basic
\texttt{hyperref} conversion is functioning.

\subsection*{Test 10: Hyperlinks Inside Table Cells}

The same hyperlink command is now placed inside ordinary table cells.

\begin{center}
\begin{tabular}{|l|p{8cm}|}
\hline
\textbf{Resource} &amp; \textbf{Hyperlink}
\tabularnewline
\hline

Physics Library &amp;
\href{https://physicslibrary.org/}{Open Physics Library}
\tabularnewline
\hline

Physics Library Encyclopedia &amp;
\href{https://physicslibrary.org/encyclopedia/}
{Open the Physics Library Encyclopedia}
\tabularnewline
\hline

LaTeX Project &amp;
\href{https://www.latex-project.org/}{Open the LaTeX Project}
\tabularnewline
\hline

\end{tabular}
\end{center}

\subsection*{Test 11: Hyperlink Mixed With Mathematics}

This test places mathematical notation and a hyperlink in the same
table without placing them in the same cell.

\begin{center}
\begin{tabular}{|l|c|p{6cm}|}
\hline
\textbf{Topic} &amp;
\textbf{Example} &amp;
\textbf{Resource}
\tabularnewline
\hline

Velocity &amp;
$v=\dfrac{dx}{dt}$ &amp;
\href{https://physicslibrary.org/encyclopedia/Velocity.html}
{Physics Library velocity entry}
\tabularnewline
\hline

Force &amp;
$F=ma$ &amp;
\href{https://physicslibrary.org/encyclopedia/Force.html}
{Physics Library force entry}
\tabularnewline
\hline

Wave number &amp;
$k=\dfrac{2\pi}{\lambda}$ &amp;
\href{https://physicslibrary.org/}
{Physics Library}
\tabularnewline
\hline

\end{tabular}
\end{center}

\section*{Stage 1B Result}

There are three useful outcomes from this stage.

\begin{enumerate}

\item If Test 9 and Tests 10--11 all work, then ordinary external
hyperlinks and hyperlinks inside tables are supported by the current
make4ht pipeline.

\item If Test 9 works but Tests 10--11 fail, then the problem is
specifically associated with hyperlinks inside the
\texttt{tabular} environment.

\item If Test 9 itself fails, then the problem should be investigated
at the \texttt{hyperref} or make4ht configuration level before table
interaction is considered.

\end{enumerate}

\section*{Next Rendering Stage}

After the hyperlink tests are verified, the next stage will introduce
color.

The first color test should use only

\begin{verbatim}
\usepackage{xcolor}
\end{verbatim}

and ordinary commands such as

\begin{verbatim}
\textcolor{red}{Critical}
\end{verbatim}

It should initially avoid

\begin{verbatim}
\usepackage[table]{xcolor}
\rowcolor
\cellcolor
\end{verbatim}

because those commands alter table-row processing and therefore require
a separate rendering test.

\subsection*{Test 12: Comparing \texttt{\textbackslash PMlinkexternal} and \texttt{\textbackslash href}}

This test compares the Physics Library native external-link command
\texttt{\textbackslash PMlinkexternal} with the standard LaTeX
\texttt{\textbackslash href} command from the \texttt{hyperref}
package.

The same URLs and visible labels are used in both columns.

\begin{center}
\begin{tabular}{|l|p{4.5cm}|p{4.5cm}|}
\hline
\textbf{Destination} &amp;
\textbf{\texttt{\textbackslash PMlinkexternal}} &amp;
\textbf{\texttt{\textbackslash href}}
\tabularnewline
\hline

Physics Library &amp;
\PMlinkexternal{Physics Library}{https://physicslibrary.org/} &amp;
\href{https://physicslibrary.org/}{Physics Library}
\tabularnewline
\hline

Physics Library Encyclopedia &amp;
\PMlinkexternal{Physics Library Encyclopedia}{https://physicslibrary.org/encyclopedia/} &amp;
\href{https://physicslibrary.org/encyclopedia/}{Physics Library Encyclopedia}
\tabularnewline
\hline

LaTeX Project &amp;
\PMlinkexternal{LaTeX Project}{https://www.latex-project.org/} &amp;
\href{https://www.latex-project.org/}{LaTeX Project}
\tabularnewline
\hline

\end{tabular}
\end{center}

\subsection*{Test 13: Colored Text Inside a Table}

This test introduces the \texttt{xcolor} package.

Only ordinary text color is tested here.  Colored cells and colored
rows are intentionally deferred to a later test because those features
modify table internals.

\begin{center}
\begin{tabular}{|l|c|l|}
\hline
\textbf{Status} &amp;
\textbf{Value} &amp;
\textbf{Meaning}
\tabularnewline
\hline

\textcolor{green}{Nominal} &amp;
1.00 &amp;
Normal operation
\tabularnewline
\hline

\textcolor{orange}{Warning} &amp;
1.25 &amp;
Check system
\tabularnewline
\hline

\textcolor{red}{Critical} &amp;
1.75 &amp;
Immediate attention
\tabularnewline
\hline

\textcolor{blue}{Information} &amp;
0.50 &amp;
Informational state
\tabularnewline
\hline

\end{tabular}
\end{center}


\subsection*{Test 14: Colored Mathematics}

This test applies color to mathematical expressions inside table cells.

\begin{center}
\begin{tabular}{|l|c|}
\hline
\textbf{Quantity} &amp;
\textbf{Expression}
\tabularnewline
\hline

Velocity &amp;
\textcolor{blue}{$v=\dfrac{dx}{dt}$}
\tabularnewline
\hline

Force &amp;
\textcolor{red}{$F=ma$}
\tabularnewline
\hline

Energy &amp;
\textcolor{green}{$E=\dfrac{1}{2}mv^2$}
\tabularnewline
\hline

Wave number &amp;
\textcolor{orange}{$k=\dfrac{2\pi}{\lambda}$}
\tabularnewline
\hline

\end{tabular}
\end{center}


\subsection*{Test 15: Colored Hyperlinks}

This test combines the hyperlink capability established in the previous
tests with ordinary text color.

\begin{center}
\begin{tabular}{|l|p{8cm}|}
\hline
\textbf{Method} &amp;
\textbf{Example}
\tabularnewline
\hline

Physics Library native &amp;
\textcolor{blue}{\PMlinkexternal{Physics Library}{https://physicslibrary.org/}}
\tabularnewline
\hline

Standard LaTeX hyperlink &amp;
\textcolor{red}{\href{https://physicslibrary.org/}{Physics Library}}
\tabularnewline
\hline

\end{tabular}
\end{center}

\subsection*{Test 16: Hyperlink Color Precedence}

This test determines whether hyperlink styling from the generated HTML
overrides an enclosing LaTeX text color.

\begin{center}
\begin{tabular}{|l|p{8cm}|}
\hline
\textbf{Method} &amp;
\textbf{Example}
\tabularnewline
\hline

Normal hyperlink &amp;
\href{https://physicslibrary.org/}{Physics Library}
\tabularnewline
\hline

Color outside hyperlink &amp;
\textcolor{red}{\href{https://physicslibrary.org/}{Physics Library}}
\tabularnewline
\hline

Color inside hyperlink label &amp;
\href{https://physicslibrary.org/}{\textcolor{red}{Physics Library}}
\tabularnewline
\hline

Normal PM link &amp;
\PMlinkexternal{Physics Library}{https://physicslibrary.org/}
\tabularnewline
\hline

Color outside PM link &amp;
\textcolor{green}{\PMlinkexternal{Physics Library}{https://physicslibrary.org/}}
\tabularnewline
\hline

Color inside PM link label &amp;
\PMlinkexternal{\textcolor{green}{Physics Library}}{https://physicslibrary.org/}
\tabularnewline
\hline

\end{tabular}
\end{center}

\subsection*{PDF Hyperlink Appearance}

When the \texttt{hyperref} package is used with its default PDF
settings, external hyperlinks may be surrounded by a colored rectangular
border.  For example, external URLs commonly receive a cyan border.

These borders are PDF hyperlink annotations rather than table borders.

They may be disabled while preserving hyperlink functionality with

\begin{verbatim}
\hypersetup{
  pdfborder={0 0 0}
}
\end{verbatim}

The corresponding HTML output is styled independently by the web
browser and Physics Library CSS.</content>
</record>
