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

<record version="10" id="785">
 <title>harmonic series diagram</title>
 <name>HarmonicSeriesDiagramHtmlRenderingTest</name>
 <created>2009-05-29 10:35:05</created>
 <modified>2026-09-07 20:26:36</modified>
 <type>Data Structure</type>
<parent id="784">harmonic series</parent>
 <creator id="441" name="bci1"/>
 <modifier id="1" name="bloftin"/>
 <comment>Physics Library autolinker corrupting the TikZ color names.

The giveaway is:

Argument of \XC@definec@lor has an extra }.
Paragraph ended before \XC@definec@lor was complete.

\XC@definec@lor is an internal xcolor command. In the previous TikZ figure we had:

\draw[red,thick,...]
...
\draw[blue,thick]

Given the autolinker problems we have already seen in other entries, it may be turning a bare word like red or blue inside the TikZ option list into something like a generated hyperlink. Then TikZ/xcolor tries to interpret that injected markup as a color name and explodes.

I would not export to PNG yet. First remove all named colors from the TikZ.</comment>
 <author id="441" name="bci1"/>
 <classification>
	<category scheme="pacs" code="00."/>
	<category scheme="pacs" code="02."/>
 </classification>
 <defines>
	<concept>html rendering test</concept>
 </defines>
 <related>
	<object name="TimeDependentHarmonicOscillators"/>
 </related>
 <keywords>
	<term>diagram html rendering test</term>
 </keywords>
 <preamble>% Object 785: Harmonic Series Diagram
% Rendering-safe Physics Library preamble.
% PSTricks removed because the production renderer uses pdfLaTeX/make4ht.

\usepackage{amsmath}
\usepackage{tikz}
</preamble>
 <content>The following diagram illustrates the harmonic series
\PMlinkname{diagram}{HarmonicSeries}, together with the limiting relation
between the harmonic partial sums and the natural logarithm.

\begin{center}
\begin{tikzpicture}[x=1.0cm,y=1.0cm]

  % Axes
  \draw[-&gt;] (-0.5,0) -- (5.7,0) node[right] {$x$};
  \draw[-&gt;] (0,-0.5) -- (0,5.7) node[above] {$y$};

  % Tick marks and labels
  \foreach \x in {1,2,3,4,5} {
    \draw (\x,0.08) -- (\x,-0.08);
    \node[below] at (\x,-0.08) {\x};
  }

  \foreach \y in {1,2,3,4,5} {
    \draw (0.08,\y) -- (-0.08,\y);
    \node[left] at (-0.08,\y) {\y};
  }

  \node[below left] at (0,0) {$0$};

  % Curve y = 1/x
  \draw[red,thick,domain=0.22:5.2,samples=100,smooth,variable=\x]
    plot ({\x},{1/\x});

  % Harmonic-series staircase rectangles
  \draw[blue,thick]
    (1,0) -- (1,1) -- (2,1) -- (2,0.5)
    -- (3,0.5) -- (3,0.333333)
    -- (4,0.333333) -- (4,0.25)
    -- (5,0.25) -- (5,0.2);

  \draw (2,0) -- (2,0.5);
  \draw (3,0) -- (3,0.333333);
  \draw (4,0) -- (4,0.25);

  \node at (1.25,3.5) {$y=\dfrac{1}{x}$};

\end{tikzpicture}
\end{center}

\[
\lim_{n\to\infty}
\left(
\sum_{k=1}^{n-1}\frac{1}{k}
-
\ln n
\right)
=
\gamma .
\]
</content>
</record>
