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

<record version="2" id="20">
 <title>Figure Guide for PhysicsLibrary</title>
 <created>2026-08-30 18:43:30</created>
 <modified>2026-08-30 20:14:33</modified>
 <creator id="1" name="bloftin"/>
 <modifier id="1" name="bloftin"/>
 <comment>next section</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.

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