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

<record version="3" id="20">
 <title>Figure Guide for PhysicsLibrary</title>
 <created>2026-08-30 18:43:30</created>
 <modified>2026-08-30 20:16:39</modified>
 <creator id="1" name="bloftin"/>
 <modifier id="1" name="bloftin"/>
 <comment>got the whole article in and rendered in preview.</comment>
 <author id="1" name="bloftin"/>
 <content>% Suggested title:
%   Creating PhysicsLibrary figures with TikZ
%
% PhysicsLibrary site-documentation source.
% This guide is intended for the PhysicsLibrary documentation center.
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{geometry}
\usepackage{graphicx}
\geometry{a4paper, margin=1in}

\title{Figure Guide for PhysicsLibrary}
\author{}
\date{}

\begin{document}

\maketitle

\section{Purpose}

TikZ is the preferred source format for many PhysicsLibrary diagrams because it produces figures whose geometry, labels, arrows, colors, and mathematical notation can be edited reproducibly.  It is particularly well suited to coordinate-frame diagrams, free-body diagrams, vector geometry, rotation sequences, signal-flow diagrams, block diagrams, and other technical illustrations in which the meaning of every line and label matters.

The recommended primary editor for PhysicsLibrary TikZ work is
\PMlinkexternal{the TikZ online editor}{https://tikz.dev/editor/}.

The editor is part of the online PGF/TikZ documentation site and provides a convenient place to write, inspect, and refine TikZ source while working in a browser.  The main PGF/TikZ documentation is available at
\PMlinkexternal{tikz.dev}{https://tikz.dev/}.

\section{Important current renderer limitation}

\textbf{Raw TikZ source should not presently be placed in a PhysicsLibrary article with the expectation that the HTML renderer will draw it.}

PhysicsLibrary still uses an older l2h/LaTeX2HTML rendering path for part of the site.  At present, raw \texttt{tikzpicture} environments are not a dependable inline rendering method in that pipeline.  Direct TikZ rendering may become a future PhysicsLibrary feature, but articles should currently use a rendered PNG image for the visible figure.

The recommended policy is therefore:

\begin{enumerate}
\item create the figure in TikZ;
\item keep the TikZ source as the editable master;
\item render or export the finished figure as a PNG;
\item upload the PNG to the PhysicsLibrary article;
\item upload the corresponding TikZ \texttt{.tex} source in the article's file box as a companion source file; and
\item include only the PNG in the article body.
\end{enumerate}

This preserves immediate renderer compatibility while also preserving the exact source needed to revise the figure later.

\section{Recommended workflow}

\subsection{Step 1: define the physical content before drawing}

A technical figure should first answer a physics question, not a graphics question.  Before editing TikZ, write down what the diagram must communicate.  Examples include:

\begin{itemize}
\item which frame is the reference frame and which frame is moving;
\item whether the transformation is active or passive;
\item whether a rotation axis is fixed or belongs to an intermediate moving frame;
\item the positive rotation sense;
\item which vectors or axes are unchanged by the operation;
\item whether the drawing is geometrically exact or intentionally schematic; and
\item which labels must correspond directly to equations in the article.
\end{itemize}

This step is especially important for Euler-angle, quaternion, rigid-body, and coordinate-transformation figures.  A visually attractive diagram with the wrong rotation sense is worse than no diagram.

\subsection{Step 2: create the TikZ source in the main editor}

Open
\PMlinkexternal{https://tikz.dev/editor/}{https://tikz.dev/editor/} or edit on the web \PMlinkexternal{https://tikz.dev/editor/web/}{https://tikz.dev/editor/web/}

and create the figure as a small standalone TikZ document.  A useful starting template is:

\begin{verbatim}
\documentclass[tikz,border=8pt]{standalone}
\usepackage{amsmath,amssymb}
\usetikzlibrary{arrows.meta,calc,positioning}

\begin{document}
\begin{tikzpicture}[
  &gt;=Latex,
  line cap=round,
  line join=round
]

% Figure content here.

\end{tikzpicture}
\end{document}
\end{verbatim}

The \texttt{standalone} class is convenient because the compiled output is tightly cropped around the figure.  The \texttt{arrows.meta}, \texttt{calc}, and \texttt{positioning} libraries cover many common PhysicsLibrary diagrams without requiring an unnecessarily complicated preamble.

\subsection{Step 3: use LaTeX notation inside the figure}

Labels should normally be written as LaTeX mathematics rather than baked into an external drawing program.  For example:

\begin{verbatim}
\node at (2,1) {$x_A$};
\node at (3,2) {$+\theta$ about $y_1$};
\end{verbatim}

This keeps mathematical notation consistent with the surrounding article and makes later symbol changes straightforward.

For a PhysicsLibrary article that uses frame notation such as
\begin{equation}
{}^B\mathbf v = {}^B C_A\,{}^A\mathbf v,
\end{equation}
use the same superscripts, subscripts, axis names, angle symbols, and sign conventions in the figure.

\subsection{Step 4: refine the geometry and labeling}

A good technical diagram should remain readable at article width.  In particular:

\begin{itemize}
\item use one clearly identifiable origin for coordinate axes that share an origin;
\item keep arrowheads away from text labels;
\item do not let flow arrows pass through boxes;
\item leave visible whitespace between titles, panel headings, arrows, and annotations;
\item keep axis labels near the corresponding arrowheads;
\item use line weights heavy enough to survive PNG conversion;
\item prefer a white background for normal PhysicsLibrary figures; and
\item avoid decorative elements that do not communicate physics.
\end{itemize}

For multi-panel figures, keep panel geometry and typography consistent.  If the same axis survives from one intermediate frame to the next, draw it in the same direction and location whenever the viewpoint allows it.

\subsection{Step 5: check the physics}

Before exporting the figure, perform a convention check.  For rotation figures, useful checks include:

\begin{itemize}
\item verify the right-hand rule;
\item verify the direction from the original axis to the rotated axis;
\item verify which axis is fixed by the rotation;
\item verify active versus passive interpretation;
\item verify the map direction used in the article;
\item verify intrinsic versus extrinsic axis selection;
\item verify that intermediate-frame labels are carried consistently between panels; and
\item compare the picture against a simple $90^\circ$ diagnostic case whenever possible.
\end{itemize}

For example, under the common PhysicsLibrary passive rotation convention
\begin{equation}
{}^B\mathbf v = {}^B C_A\,{}^A\mathbf v,
\end{equation}
a positive physical frame rotation still follows the positive right-hand rule.  The opposite sign appears in the numerical coordinate map, not in the physical frame-rotation arrow.  This distinction should be checked explicitly when constructing axis-rotation figures.

\subsection{Step 6: export or render a PNG}

The finished TikZ source is the master version, but the PhysicsLibrary article should currently display a PNG.  Use the browser editor's available export workflow when suitable, or compile the same TikZ source in another LaTeX environment and convert the resulting PDF to PNG.

A useful command-line workflow is:

\begin{verbatim}
pdflatex figure.tex
pdftocairo -png -singlefile figure.pdf figure
\end{verbatim}

Another common conversion tool is \texttt{pdftoppm}.  The exact conversion program is not important; what matters is that the PNG is large enough to remain crisp at the width used by the article.

Do not use a screenshot of the editor as the production figure when a direct render is available.  A direct render preserves line quality, mathematical text, and consistent margins.

\subsection{Step 7: use matching filenames}

Use descriptive filenames and keep the PNG and TikZ source basename closely related.  For example:

\begin{verbatim}
EA07_intrinsic_321_frame_chain.png
EA07_intrinsic_321_frame_chain_tikz.tex
\end{verbatim}

This makes it immediately clear which source belongs to which rendered figure.

Avoid spaces in production filenames.  Use letters, numbers, and underscores where practical.

\subsection{Step 8: upload both files to PhysicsLibrary}

Upload the PNG as the figure that the article will display.  Also upload the TikZ \texttt{.tex} source in the article's file box so another editor can reproduce or modify the figure later.

The PNG and TikZ source should be treated as a pair:

\begin{itemize}
\item \textbf{PNG}: renderer-compatible publication image;
\item \textbf{TikZ source}: editable and reproducible master.
\end{itemize}

If the figure is revised, update both files so that the uploaded source continues to reproduce the published image.


\end{document}</content>
</record>
