<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>tufte-python</title>
    <description>A Tufte styled static site, inspired by LaTeX academic papers and generated with Python</description>
    <link>https://hyperphantasia.github.io/tufte-python/</link>
    <atom:link href="https://hyperphantasia.github.io/tufte-python/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Tue, 21 Jul 2026 22:34:05 +0000</pubDate>
    <lastBuildDate>Tue, 21 Jul 2026 22:34:05 +0000</lastBuildDate>
    <generator>tufte-python</generator>
    <item>
      <title>Tufte-style Python blog</title>
      <description>&lt;p&gt;&lt;span class=&#39;newthought&#39;&gt;Tufte-Python&lt;/span&gt; is an attempt to create a website design with the look and feel of Edward Tufte&amp;rsquo;s books and handouts. Tufte&amp;rsquo;s style is known for its extensive use of sidenotes, tight integration of graphics with text and a well-set typography.&lt;/p&gt;
&lt;h2 id=&#34;genesis&#34;&gt;Genesis&lt;/h2&gt;
&lt;p&gt;This theme is based on the GitHub &lt;a href=&#34;https://github.com/edwardtufte/tufte-css&#34;&gt;repository&lt;/a&gt; by Edward Tufte, which was originally created by Dave Liepmann&lt;label for=&#39;One&#39; class=&#39;margin-toggle sidenote-number&#39;&gt;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;One&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;sidenote&#39;&gt;This project is essentially inspired from Tufte and the R Markdown Tufte Handout format. See &lt;a href=&#34;https://github.com/Tufte-LaTeX/tufte-latex&#34;&gt;tufte-latex&lt;/a&gt; and &lt;a href=&#34;http://rmarkdown.rstudio.com/tufte_handout_format.html&#34;&gt;rstudio&lt;/a&gt;. This post itself is an adaptation of the &lt;a href=&#34;http://rmarkdown.rstudio.com/examples/tufte-handout.pdf&#34;&gt;Tufte Handout PDF&lt;/a&gt;.&lt;/span&gt;, but is now labeled under Edward Tufte&amp;rsquo;s moniker. It reached this Python generator by the way of &lt;a href=&#34;https://github.com/clayh53/tufte-jekyll&#34;&gt;tufte-jekyll&lt;/a&gt;, a Ruby/Jekyll theme that turned much of Tufte-CSS&amp;rsquo;s typographic and page-structural craft into a set of custom Liquid tags. This port stays true to its prior but swaps Ruby and Liquid for Python. The tags are now plain-text &lt;em&gt;shortcodes&lt;/em&gt;, expanded by a small Python module in the &lt;code&gt;tufte_ssg/shortcodes.py&lt;/code&gt; file before the rest of the page is run through Markdown.&lt;/p&gt;
&lt;p&gt;The rest of this post is an overview of the theme&amp;rsquo;s features, with sample content directly adapted from &lt;a href=&#34;https://github.com/edwardtufte/tufte-css&#34;&gt;Tufte-CSS&lt;/a&gt; to demonstrate visual consistency across all three iterations of this theme. Additional commentary documents the shortcode syntax and the new features bundled with this generator.&lt;/p&gt;
&lt;h3 id=&#34;theming-not-just-a-settings-file&#34;&gt;Theming, not just a settings file&lt;/h3&gt;
&lt;p&gt;Where the original Jekyll theme let you tweak fonts and colors in a single &lt;code&gt;_sass/_settings.scss&lt;/code&gt; file compiled by Sass, this generator takes it a step further: the entire color palette lives behind CSS custom properties. A whole &lt;em&gt;theme&lt;/em&gt;, not just one color, can be swapped at build time by editing one line in &lt;code&gt;config.yml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&#34;nt&#34;&gt;theme&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l l-Scalar l-Scalar-Plain&#34;&gt;solarized&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Tufte-Python ships with nine themes (plus a print-only one): &lt;a href=&#34;https://ethanschoonover.com/solarized/&#34;&gt;Solarized&lt;/a&gt; (the default, shown here), &lt;a href=&#34;https://github.com/dracula/dracula-theme&#34;&gt;Dracula&lt;/a&gt;, and five variants of &lt;a href=&#34;https://github.com/thvardhan/Gradianto&#34;&gt;Gradianto&lt;/a&gt;. Solarized and Dracula include a light and a dark palette. They follow your system&amp;rsquo;s &lt;code&gt;prefers-color-scheme&lt;/code&gt; automatically, with a toggle for a manual override. Try it! The whole page, including the code blocks below, re-colors itself.&lt;/p&gt;
&lt;h2 id=&#34;fundamentals&#34;&gt;Fundamentals&lt;/h2&gt;
&lt;h3 id=&#34;color&#34;&gt;Color&lt;/h3&gt;
&lt;p&gt;Although paper handouts obviously have a pure white background, the web is better served by the use of slightly off-white and off-black colors or, as here, a deliberately chosen palette. Tufte&amp;rsquo;s books are a study in spare, minimalist design. In his book &lt;a href=&#34;http://www.edwardtufte.com/tufte/books_vdqi&#34;&gt;The Visual Display of Quantitative Information&lt;/a&gt;, Tufte uses a red ink to add some visual punctuation to the buff colored paper and dark ink. In that spirit, this theme reserves one accent color: the theme&amp;rsquo;s link color.&lt;/p&gt;
&lt;h3 id=&#34;headings&#34;&gt;Headings&lt;/h3&gt;
&lt;p&gt;Tufte CSS uses &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; for the document title, &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; with class &lt;code&gt;code&lt;/code&gt; for the document subtitle, &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt; for section headings, and &lt;code&gt;&amp;lt;h3&amp;gt;&lt;/code&gt; for low-level headings. More specific headings are not encouraged. If you feel the urge to reach for a heading of level 4 or greater, consider redesigning your document:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[It is] notable that the Feynman lectures (three volumes) write about all of physics in 1800 pages, using only two levels of hierarchical headings: chapters and A-level heads in the text. It also uses the methodology of &lt;em&gt;sentences&lt;/em&gt; which then cumulate sequentially into &lt;em&gt;paragraphs&lt;/em&gt;, rather than the grunts of bullet points. Undergraduate Caltech physics is very complicated material, but it didn&amp;rsquo;t require an elaborate hierarchy to organize.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;cite&gt;&lt;a href=&#34;http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000hB&#34;&gt;Edward Tufte, forum post, ‘Book design: advice and examples’ thread&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;p&gt;As a bonus, this excerpt regarding the use of headings provides an example of using block quotes. Markdown does not have a native &lt;code&gt;&amp;lt;cite&amp;gt;&lt;/code&gt; shorthand, but real HTML can be sprinkled in with the Markdown text. In the previous example, the &lt;code&gt;&amp;lt;cite&amp;gt;&lt;/code&gt; was preceded with a single return after the quotation itself. The previous blockquote was written in Markdown thusly:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;[It is] notable that the Feynman lectures (3 volumes) write about all of physics in 1800 pages, using only 2 levels of hierarchical headings: chapters and A-level heads in the text. It also uses the methodology of *sentences* which then cumulate sequentially into *paragraphs*, rather than the grunts of bullet points. Undergraduate Caltech physics is very complicated material, but it didn&amp;#39;t require an elaborate hierarchy to organize.
&amp;lt;cite&amp;gt;[Edward Tufte, forum post, ‘Book design: advice and examples’ thread](http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000hB)&amp;lt;/cite&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;span class=&#39;newthought&#39;&gt;In his later books&lt;/span&gt;&lt;label for=&#39;two&#39; class=&#39;margin-toggle sidenote-number&#39;&gt;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;two&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;sidenote&#39;&gt;&lt;a href=&#34;http://www.edwardtufte.com/tufte/books_be&#34;&gt;&lt;em&gt;Beautiful Evidence&lt;/em&gt;&lt;/a&gt;&lt;/span&gt;, Tufte starts each section with a bit of vertical space, a non-indented paragraph, and sets the first few words of the sentence in small caps. To accomplish this using this theme, enclose the sentence fragment you want styled with small caps in a shortcode called &lt;code&gt;newthought&lt;/code&gt;, like so:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;{% newthought &amp;#39;In his later books&amp;#39; %}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&#34;text&#34;&gt;Text&lt;/h3&gt;
&lt;p&gt;In print, Tufte uses the proprietary Monotype Bembo&lt;label for=&#39;3&#39; class=&#39;margin-toggle sidenote-number&#39;&gt;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;3&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;sidenote&#39;&gt;See Tufte’s comment in the &lt;a href=&#34;http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000Vt&#34;&gt;Tufte book fonts&lt;/a&gt; thread.&lt;/span&gt; font. A similar effect is achieved in digital formats with the now open-source ETBook, which this theme supplies with a &lt;code&gt;@font-face&lt;/code&gt; reference to a &lt;code&gt;.ttf&lt;/code&gt; file. In case ETBook somehow doesn&amp;rsquo;t work, the CSS degrades gracefully to other serif fonts like Palatino and Georgia. Notice that separate font files are included for &lt;strong&gt;bold&lt;/strong&gt; (strong) and &lt;em&gt;italic&lt;/em&gt; (emphasis) text, instead of relying on the browser to mechanically transform it. This is typographic best practice.&lt;/p&gt;
&lt;p&gt;Code snippets imitate GitHub&amp;rsquo;s font selection using Microsoft&amp;rsquo;s &lt;a href=&#34;http://www.microsoft.com/typography/ClearTypeFonts.mspx&#34;&gt;&lt;em&gt;Consolas&lt;/em&gt;&lt;/a&gt; and the sans-serif font uses Tufte&amp;rsquo;s choice of Gill Sans. Since this is not a free font, and some systems will not have it installed, the free Google font &lt;a href=&#34;https://www.google.com/fonts/specimen/Lato&#34;&gt;&lt;em&gt;Lato&lt;/em&gt;&lt;/a&gt; is designated as a fallback.&lt;/p&gt;
&lt;h2 id=&#34;epigraphs&#34;&gt;Epigraphs&lt;/h2&gt;

&lt;div class=&#39;epigraph&#39;&gt;&lt;blockquote&gt;&lt;p&gt;The English language . . . becomes ugly and inaccurate because our thoughts are foolish, but the slovenliness of our language makes it easier for us to have foolish thoughts.&lt;/p&gt;&lt;footer&gt;George Orwell, &lt;cite&gt; &#34;Politics and the English Language&#34; &lt;/cite&gt;&lt;/footer&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;div class=&#39;epigraph&#39;&gt;&lt;blockquote&gt;&lt;p&gt;For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled.&lt;/p&gt;&lt;footer&gt;Richard P. Feynman, &lt;cite&gt; “What Do You Care What Other People Think?” &lt;/cite&gt;&lt;/footer&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;If you&amp;rsquo;d like to introduce your page or a section of your page with some quotes, use epigraphs. The two examples above show how they are styled. Epigraph elements are modeled after chapter epigraphs in Tufte&amp;rsquo;s books (particularly &lt;em&gt;Beautiful Evidence&lt;/em&gt;). As an easier alternative to hand-written HTML, this theme uses a shortcode that lets you embed elements such as epigraphs in the middle of the regular Markdown text being edited.&lt;/p&gt;
&lt;p&gt;In order to use an epigraph in a page or section, type this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;{% epigraph &amp;#39;text of citation&amp;#39; &amp;#39;author of citation&amp;#39; &amp;#39;citation source&amp;#39; %}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to produce this:&lt;/p&gt;
&lt;div class=&#39;epigraph&#39;&gt;&lt;blockquote&gt;&lt;p&gt;I do not paint things, I paint only the differences between things.&lt;/p&gt;&lt;footer&gt;Henri Matisse, &lt;cite&gt;Henri Matisse Dessins: thèmes et variations, 1943&lt;/cite&gt;&lt;/footer&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;div class=&#39;epigraph&#39;&gt;&lt;blockquote&gt;&lt;p&gt; &#34;How did you go bankrupt?&#34; Two ways. Gradually, then suddenly.&lt;/p&gt;&lt;footer&gt;Ernest Hemingway, &lt;cite&gt; &#34;The Sun Also Rises&#34; &lt;/cite&gt;&lt;/footer&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;lists&#34;&gt;Lists&lt;/h3&gt;
&lt;p&gt;Tufte points out that while lists have valid uses, they tend to promote ineffective writing habits due to their &amp;ldquo;lack of syntactic and intellectual discipline&amp;rdquo;. He is particularly critical of hierarchical and bullet-pointed lists. So before reaching for an HTML list element, ask yourself:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Does this list actually have to be represented using an HTML &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;ol&amp;gt;&lt;/code&gt; element?&lt;/li&gt;
&lt;li&gt;Would my idea be better expressed as sentences in paragraphs?&lt;/li&gt;
&lt;li&gt;Is my message causally complex enough to warrant a flow diagram instead?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is but a small subset of a proper overview of the topic of lists in communication. A better way to understand Tufte&amp;rsquo;s thoughts on lists would be to read &amp;ldquo;The Cognitive Style of PowerPoint: Pitching Out Corrupts Within,&amp;rdquo; a chapter in Tufte&amp;rsquo;s book &lt;em&gt;Beautiful Evidence&lt;/em&gt;, excerpted at some length by Tufte himself &lt;a href=&#34;http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0002QF&#34;&gt;on his website&lt;/a&gt;. The whole piece is information-dense and therefore difficult to summarize. He speaks to design specifically, but in terms of examples and principles rather than as a set of simple do-this, don&amp;rsquo;t-do-that prescriptions. It is well worth reading in full for that reason alone.&lt;/p&gt;
&lt;p&gt;For these reasons, this theme encourages caution before reaching for a list element, and by default removes the bullet points from unordered lists.&lt;/p&gt;
&lt;h2 id=&#34;figures&#34;&gt;Figures&lt;/h2&gt;
&lt;h3 id=&#34;margin-figures&#34;&gt;Margin Figures&lt;/h3&gt;
&lt;p&gt;&lt;label for=&#39;mf-id-1&#39; class=&#39;margin-toggle&#39;&gt;&amp;#8853;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;mf-id-1&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;marginnote&#39;&gt;&lt;img class=&#39;fullwidth&#39; src=&#39;/tufte-python/assets/img/rhino.png&#39;/&gt;&lt;br&gt;F.J. Cole, “The History of Albrecht Dürer’s Rhinoceros in Zoological Literature,” &lt;em&gt;Science, Medicine, and History: Essays on the Evolution of Scientific Thought and Medical Practice&lt;/em&gt; (London, 1953), ed. E. Ashworth Underwood, 337-356. From page 71 of Edward Tufte’s &lt;em&gt;Visual Explanations&lt;/em&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Images and graphics play an integral role in Tufte&amp;rsquo;s work. To place figures in the margin, use the &lt;code&gt;marginfigure&lt;/code&gt; shortcode:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;{% marginfigure &amp;#39;mf-id-whatever&amp;#39; &amp;#39;assets/img/rhino.png&amp;#39; &amp;#39;F.J. Cole, “The History of Albrecht Dürer’s Rhinoceros in Zoological Literature,” *Science, Medicine, and History: Essays on the Evolution of Scientific Thought and Medical Practice* (London, 1953), ed. E. Ashworth Underwood, 337-356. From page 71 of Edward Tufte’s *Visual Explanations*.&amp;#39; %}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Note that this shortcode takes &lt;em&gt;three&lt;/em&gt; parameters. The first is an arbitrary id. It can be named anything as long as it is unique to this post. The second parameter is the path to the image. The final parameter is whatever caption you want displayed with the figure. All parameters &lt;em&gt;must&lt;/em&gt; be enclosed in quotes for the shortcode to work! &lt;/p&gt;
&lt;p&gt;In this example, the &lt;code&gt;marginfigure&lt;/code&gt; shortcode was inserted &lt;em&gt;before&lt;/em&gt; the paragraph so that it aligns with the beginning of the paragraph. On small screens, the image will collapse into a small viewability toggle symbol: &lt;span class=&#34;contrast &#34;&gt;&amp;#8853;&lt;/span&gt; at the location it has been inserted in the manuscript. Clicking on it will open the image.&lt;/p&gt;
&lt;h3 id=&#34;full-width-figures&#34;&gt;Full Width Figures&lt;/h3&gt;
&lt;p&gt;If you need a full-width image or figure, another shortcode is available to use. Oddly enough, it is named &lt;code&gt;fullwidth&lt;/code&gt;, and this markup:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;{% fullwidth &amp;#39;assets/img/napoleons-march.png&amp;#39; &amp;#39;Napoleon&amp;#39;s March *(Edward Tufte’s English translation)*&amp;#39; %}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Yields this:&lt;/p&gt;
&lt;figure class=&#39;fullwidth&#39;&gt;&lt;img src=&#39;/tufte-python/assets/img/napoleons-march.png&#39;/&gt;&lt;figcaption&gt;Napoleon&amp;rsquo;s March &lt;em&gt;(Edward Tufte’s English translation)&lt;/em&gt;&lt;/figcaption&gt;&lt;/figure&gt;

&lt;h3 id=&#34;main-column-figures&#34;&gt;Main Column Figures&lt;/h3&gt;
&lt;p&gt;Besides margin and full width figures, you can of course also include figures constrained to the main column. Yes, you guessed it, a shortcode rides to the rescue once again:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;{% maincolumn &amp;#39;assets/img/export-imports.png&amp;#39; &amp;#39;From Edward Tufte, *Visual Display of Quantitative Information*, page 92&amp;#39; %}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;yields this:&lt;/p&gt;
&lt;figure&gt;&lt;img src=&#39;/tufte-python/assets/img/exports-imports.png&#39;/&gt;&lt;figcaption class=&#39;maincolumn-figure&#39;&gt;From Edward Tufte, &lt;em&gt;Visual Display of Quantitative Information&lt;/em&gt;, page 92&lt;/figcaption&gt;&lt;/figure&gt;

&lt;h2 id=&#34;sidenotes-and-margin-notes&#34;&gt;Sidenotes and Margin notes&lt;/h2&gt;
&lt;p&gt;One of the most prominent and distinctive features of Tufte&amp;rsquo;s style is the extensive use of sidenotes and margin notes. Perhaps you have noticed their use in this document already. Their purpose is to present related but not necessary information such as asides or citations &lt;em&gt;as close as possible&lt;/em&gt; to the text that references them. At the same time, this secondary information should stay out of the way of the eye, not interfering with the progression of ideas in the main text.&lt;/p&gt;
&lt;p&gt;There is a wide margin to provide ample room for sidenotes and small figures. There exists a slight semantic distinction between &lt;em&gt;sidenotes&lt;/em&gt; and &lt;em&gt;marginnotes&lt;/em&gt;.&lt;/p&gt;
&lt;h3 id=&#34;sidenotes&#34;&gt;Sidenotes&lt;/h3&gt;
&lt;p&gt;Sidenotes&lt;label for=&#39;sn-id-whatever&#39; class=&#39;margin-toggle sidenote-number&#39;&gt;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;sn-id-whatever&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;sidenote&#39;&gt;This is a sidenote and &lt;em&gt;displays a superscript&lt;/em&gt;&lt;/span&gt; display a superscript. The &lt;code&gt;sidenote&lt;/code&gt; shortcode takes two parameters. The first is an identifier allowing the sidenote to be targeted by the twitchy index fingers of mobile device users so that all the yummy sidenote goodness is revealed when the superscript is tapped. The second is the actual content of the sidenote. Both should be enclosed in quotes. This theme uses the CSS &lt;code&gt;counter&lt;/code&gt; trick to automatically keep track of the number sequence on each page or post. On small screens, the sidenotes disappear and when the superscript is clicked, a side note will open below the content, which can then be closed with a similar click. Here is the markup for the sidenote at the beginning of this paragraph:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;{% sidenote &amp;#39;sn-id-whatever&amp;#39; &amp;#39;This is a sidenote and *displays a superscript*&amp;#39; %}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&#34;margin-notes&#34;&gt;Margin notes&lt;/h3&gt;
&lt;p&gt;Margin notes&lt;label for=&#39;mn-id-whatever&#39; class=&#39;margin-toggle&#39;&gt;&amp;#8853;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;mn-id-whatever&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;marginnote&#39;&gt;This is a margin note &lt;em&gt;without&lt;/em&gt; a superscript&lt;/span&gt; are similar to sidenotes, but do not display a superscript. The &lt;code&gt;marginnote&lt;/code&gt; shortcode has the same two parameters as &lt;code&gt;sidenote&lt;/code&gt;. Anything can be placed in a margin note. Well, anything that is an inline element. On small screens, the margin notes disappear and this symbol: &lt;span class=&#34;contrast &#34;&gt;&amp;#8853;&lt;/span&gt; pops up. When clicked, it will open the margin note below the content, which can then be closed with a similar click. The markup has a similar shape to a sidenote&amp;rsquo;s, just without a number involved:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;{% marginnote &amp;#39;mn-id-whatever&amp;#39; &amp;#39;This is a margin note *without* a superscript&amp;#39; %}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&#34;equations&#34;&gt;Equations&lt;/h2&gt;
&lt;p&gt;This theme loads &lt;a href=&#34;//www.mathjax.org&#34;&gt;MathJax&lt;/a&gt; to render both inline and block-level mathematical notation. Both are written the same way you&amp;rsquo;d write them anywhere else MathJax is used. Raw &lt;code&gt;$$...$$&lt;/code&gt; (or &lt;code&gt;\(...\)&lt;/code&gt;) delimiters, left untouched by the Markdown pass so MathJax can pick them up client-side.&lt;/p&gt;
&lt;p&gt;For instance, the following inline sequence:&lt;/p&gt;
&lt;p&gt;When \( a \ne 0 \), there are two solutions to \( ax^2 + bx + c = 0 \)&lt;/p&gt;
&lt;p&gt;is written by enclosing a MathJax expression within a &lt;em&gt;matching pair of backslash-parentheses&lt;/em&gt;: &lt;strong&gt;&lt;code&gt;\( ... \)&lt;/code&gt;&lt;/strong&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;When \( a \ne 0 \), there are two solutions to \( ax^2 + bx + c = 0 \)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;$$...$$&lt;/code&gt; is reserved for block/display equations that should get their own centered line, for example this block-level MathJax expression:&lt;/p&gt;
&lt;p&gt;$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$&lt;/p&gt;
&lt;p&gt;is written by enclosing the expression within a pair of &lt;code&gt;$$&lt;/code&gt; with an empty line above and below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can get pretty fancy, the wave equation&amp;rsquo;s nabla is no big thing:&lt;/p&gt;
&lt;p&gt;$$ \frac{\partial^2 y}{\partial t^2}= c^2\nabla^2u $$&lt;/p&gt;
&lt;p&gt;All of the standard &lt;span class=&#34;latex&#34;&gt;L&lt;sup&gt;a&lt;/sup&gt;T&lt;sub&gt;e&lt;/sub&gt;X&lt;/span&gt; equation markup is available to use inside these blocks. &lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;d rather not rely on raw &lt;code&gt;$$&lt;/code&gt; delimiters, the theme also ports the original &lt;code&gt;{% math %}...{% endmath %}&lt;/code&gt; and &lt;code&gt;{% m %}...{% em %}&lt;/code&gt; shortcodes for block and inline math, respectively. Either way, be careful to isolate your &lt;span class=&#34;latex&#34;&gt;L&lt;sup&gt;a&lt;/sup&gt;T&lt;sub&gt;e&lt;/sub&gt;X&lt;/span&gt; with blank lines above and below. Some notation, like inline matrix syntax, is finicky about it.&lt;/p&gt;
&lt;h2 id=&#34;tables&#34;&gt;Tables&lt;/h2&gt;
&lt;p&gt;Tables are, frankly, a pain to create. That said, they often are one of the best methods for presenting data. Tabular data are normally presented with right-aligned numbers, left-aligned text, and minimal grid lines.&lt;/p&gt;
&lt;p&gt;Note that there will often be a need to get some dirt under your fingernails and stoop to writing a little honest-to-god HTML directly in your Markdown. Yes, all that hideous &lt;code&gt;&amp;lt;table&amp;gt;..&amp;lt;thead&amp;gt;..&amp;lt;th&amp;gt;&lt;/code&gt; nonsense. &lt;em&gt;And&lt;/em&gt; you must wrap the unholy mess in a &lt;code&gt;&amp;lt;div class=&#34;table-wrapper&#34;&amp;gt;&lt;/code&gt; tag to ensure that the table stays centered in the main content column.&lt;/p&gt;
&lt;p&gt;Tables are designed with an &lt;code&gt;overflow:scroll&lt;/code&gt; property to create slider bars when the viewport is narrow. This is so that you do not collapse all your beautiful data into a jumble of letters and numbers when you view it on your smartphone.&lt;/p&gt;
&lt;p&gt;&lt;label for=&#39;table-1-id&#39; class=&#39;margin-toggle&#39;&gt;&amp;#8853;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;table-1-id&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;marginnote&#39;&gt;&lt;em&gt;Table 1&lt;/em&gt;: A table with default style formatting&lt;/span&gt;&lt;/p&gt;
&lt;div class=&#34;table-wrapper&#34;&gt;
  &lt;table class=&#34;table-alpha&#34; id=&#34;newspaper-tone&#34;&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th class=&#34;left&#34;&gt;Content and tone of front-page articles in 94 U.S. newspapers, October and November, 1974&lt;/th&gt;
        &lt;th class=&#34;left&#34;&gt;Number of articles&lt;/th&gt;
        &lt;th&gt;Percent of articles with negative criticism of specific person or policy&lt;/th&gt;&lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td class=&#34;text&#34;&gt;Watergate: defendants and prosecutors, Ford’s pardon of Nixon&lt;/td&gt;
        &lt;td&gt;&lt;div class=&#34;number&#34;&gt;537&lt;/div&gt;&lt;/td&gt;
        &lt;td class=&#34;c&#34;&gt;&lt;div class=&#34;number&#34;&gt;49%&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&#34;text&#34;&gt;Inflation, high cost of living&lt;/td&gt;
        &lt;td&gt;&lt;div class=&#34;number&#34;&gt;415&lt;/div&gt;&lt;/td&gt;
        &lt;td class=&#34;c&#34;&gt;&lt;div class=&#34;number&#34;&gt;28%&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&#34;text&#34;&gt;Government competence: costs, quality, salaries of public employees&lt;/td&gt;
        &lt;td&gt;&lt;div class=&#34;number&#34;&gt;322&lt;/div&gt;&lt;/td&gt;
        &lt;td class=&#34;c&#34;&gt;&lt;div class=&#34;number&#34;&gt;30%&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&#34;text&#34;&gt;Confidence in government: power of special interests, trust in political leaders, dishonesty in politics&lt;/td&gt;
        &lt;td&gt;&lt;div class=&#34;number&#34;&gt;266&lt;/div&gt;&lt;/td&gt;
        &lt;td class=&#34;c&#34;&gt;&lt;div class=&#34;number&#34;&gt;52%&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&#34;text&#34;&gt;Government power: regulation of business, secrecy, control of CIA and FBI&lt;/td&gt;
        &lt;td&gt;&lt;div class=&#34;number&#34;&gt;154&lt;/div&gt;&lt;/td&gt;
        &lt;td class=&#34;c&#34;&gt;&lt;div class=&#34;number&#34;&gt;42%&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&#34;text&#34;&gt;Crime&lt;/td&gt;
        &lt;td&gt;&lt;div class=&#34;number&#34;&gt;123&lt;/div&gt;&lt;/td&gt;
        &lt;td class=&#34;c&#34;&gt;&lt;div class=&#34;number r&#34;&gt;30%&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&#34;text&#34;&gt;Race&lt;/td&gt;
        &lt;td&gt;&lt;div class=&#34;number&#34;&gt;103&lt;/div&gt;&lt;/td&gt;
        &lt;td class=&#34;c&#34;&gt;&lt;div class=&#34;number&#34;&gt;25%&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&#34;text&#34;&gt;Unemployment&lt;/td&gt;
        &lt;td&gt;&lt;div class=&#34;number&#34;&gt;100&lt;/div&gt;&lt;/td&gt;
        &lt;td class=&#34;c&#34;&gt;&lt;div class=&#34;number&#34;&gt;13%&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class=&#34;text&#34;&gt;Shortages: energy, food&lt;/td&gt;
        &lt;td&gt;&lt;div class=&#34;number&#34;&gt;68&lt;/div&gt;&lt;/td&gt;
        &lt;td class=&#34;c&#34;&gt;&lt;div class=&#34;number&#34;&gt;16%&lt;/div&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;This is not the One True Table. Such a style does not exist. One must craft each data table with custom care to the narrative one is telling with that specific data. So take this not as &amp;ldquo;the table style to use&amp;rdquo;, but rather as &amp;ldquo;a table style to start from&amp;rdquo;. From here, use principles to guide you: avoid chartjunk, optimize the data-ink ratio (&amp;ldquo;within reason&amp;rdquo;, as Tufte says), and &amp;ldquo;mobilize every graphical element, perhaps several times over, to show the data.&lt;label for=&#39;table-id&#39; class=&#39;margin-toggle sidenote-number&#39;&gt;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;table-id&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;sidenote&#39;&gt;Page 139, &lt;em&gt;The Visual Display of Quantitative Information&lt;/em&gt;, Edward Tufte 2001.&lt;/span&gt; Furthermore, one must know when to reach for more complex data presentation tools, like a custom graphic or a JavaScript charting library.&lt;/p&gt;
&lt;p&gt;As an example of alternative table styles, academic publications written in &lt;span class=&#34;latex&#34;&gt;L&lt;sup&gt;a&lt;/sup&gt;T&lt;sub&gt;e&lt;/sub&gt;X&lt;/span&gt; often rely on the &lt;code&gt;booktabs&lt;/code&gt; package to produce clean, clear tables. Similar results can be achieved here with the &lt;code&gt;booktabs&lt;/code&gt; class, as demonstrated in this table:&lt;/p&gt;
&lt;p&gt;&lt;label for=&#39;table-2-id&#39; class=&#39;margin-toggle&#39;&gt;&amp;#8853;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;table-2-id&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;marginnote&#39;&gt;&lt;em&gt;Table 2&lt;/em&gt;: A table with booktabs style formatting&lt;/span&gt;&lt;/p&gt;
&lt;div class=&#34;table-wrapper&#34;&gt;
&lt;table class=&#34;booktabs&#34;&gt;
          &lt;thead&gt;
            &lt;tr&gt;&lt;th colspan=&#34;2&#34; class=&#34;cmid&#34;&gt;Items&lt;/th&gt;&lt;th class=&#34;nocmid&#34;&gt;&lt;/th&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;th class=&#34;l&#34;&gt;Animal&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th class=&#34;r&#34;&gt;Price ($)&lt;/th&gt;&lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;&lt;td&gt;Gnat&lt;/td&gt;     &lt;td&gt;per gram&lt;/td&gt;&lt;td class=&#34;r&#34;&gt;13.65&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;&lt;/td&gt;         &lt;td&gt;each&lt;/td&gt;    &lt;td class=&#34;r&#34;&gt;0.01&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Gnu&lt;/td&gt;      &lt;td&gt;stuffed&lt;/td&gt; &lt;td class=&#34;r&#34;&gt;92.50&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Emu&lt;/td&gt;      &lt;td&gt;stuffed&lt;/td&gt; &lt;td class=&#34;r&#34;&gt;33.33&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Armadillo&lt;/td&gt;&lt;td&gt;frozen&lt;/td&gt;  &lt;td class=&#34;r&#34;&gt;8.99&lt;/td&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;The table above was written in HTML as follows:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;table-wrapper&amp;quot;&amp;gt;
&amp;lt;table class=&amp;quot;booktabs&amp;quot;&amp;gt;
          &amp;lt;thead&amp;gt;
            &amp;lt;tr&amp;gt;&amp;lt;th colspan=&amp;quot;2&amp;quot; class=&amp;quot;cmid&amp;quot;&amp;gt;Items&amp;lt;/th&amp;gt;&amp;lt;th class=&amp;quot;nocmid&amp;quot;&amp;gt;&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;
            &amp;lt;tr&amp;gt;&amp;lt;th class=&amp;quot;l&amp;quot;&amp;gt;Animal&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th class=&amp;quot;r&amp;quot;&amp;gt;&amp;lt;th&amp;gt;Price ($)&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;
          &amp;lt;/thead&amp;gt;
          &amp;lt;tbody&amp;gt;
            &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Gnat&amp;lt;/td&amp;gt;     &amp;lt;td&amp;gt;per gram&amp;lt;/td&amp;gt;&amp;lt;td class=&amp;quot;r&amp;quot;&amp;gt;13.65&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
            &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;         &amp;lt;td&amp;gt;each&amp;lt;/td&amp;gt;    &amp;lt;td class=&amp;quot;r&amp;quot;&amp;gt;0.01&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
            &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Gnu&amp;lt;/td&amp;gt;      &amp;lt;td&amp;gt;stuffed&amp;lt;/td&amp;gt; &amp;lt;td class=&amp;quot;r&amp;quot;&amp;gt;92.50&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
            &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Emu&amp;lt;/td&amp;gt;      &amp;lt;td&amp;gt;stuffed&amp;lt;/td&amp;gt; &amp;lt;td class=&amp;quot;r&amp;quot;&amp;gt;33.33&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
            &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Armadillo&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;frozen&amp;lt;/td&amp;gt;  &amp;lt;td class=&amp;quot;r&amp;quot;&amp;gt;8.99&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
          &amp;lt;/tbody&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;span class=&#39;newthought&#39;&gt;&lt;a href=&#34;https://clayh53.github.io/tufte-jekyll/articles/20/tufte-style-jekyll-blog#tables&#34;&gt;Harmon&lt;/a&gt; likes this style of table,&lt;/span&gt; so I have made it the default for unstyled tables. This uses the table support built into Python-Markdown&amp;rsquo;s &lt;code&gt;extra&lt;/code&gt; extension. Here is a table created using ordinary Markdown table syntax, which has the side benefit of being human-readable in the raw Markdown file:&lt;/p&gt;
&lt;p&gt;&lt;label for=&#39;tableID-3&#39; class=&#39;margin-toggle&#39;&gt;&amp;#8853;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;tableID-3&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;marginnote&#39;&gt;Table 3: a table created with Markdown table syntax using only the default table styling&lt;/span&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&#34;text-align: left;&#34;&gt;&lt;/th&gt;
&lt;th style=&#34;text-align: right;&#34;&gt;mpg&lt;/th&gt;
&lt;th style=&#34;text-align: right;&#34;&gt;cyl&lt;/th&gt;
&lt;th style=&#34;text-align: right;&#34;&gt;disp&lt;/th&gt;
&lt;th style=&#34;text-align: right;&#34;&gt;hp&lt;/th&gt;
&lt;th style=&#34;text-align: right;&#34;&gt;drat&lt;/th&gt;
&lt;th style=&#34;text-align: right;&#34;&gt;wt&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align: left;&#34;&gt;Mazda RX4&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;21&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;6&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;160&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;110&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;3.90&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;2.62&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align: left;&#34;&gt;Mazda RX4 Wag&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;21&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;6&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;160&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;110&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;3.90&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;2.88&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align: left;&#34;&gt;Datsun 710&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;22.8&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;4&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;108&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;93&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;3.85&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;2.32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align: left;&#34;&gt;Hornet 4 Drive&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;21.4&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;6&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;258&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;110&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;3.08&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;3.21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align: left;&#34;&gt;Hornet Sportabout&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;18.7&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;8&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;360&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;175&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;3.15&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;3.44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align: left;&#34;&gt;Valiant&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;18.1&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;6&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;160&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;105&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;2.76&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;3.46&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Using the following Markdown formatting:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;|                 |mpg  | cyl  |  disp  |   hp   |  drat  | wt  |
|:----------------|----:|-----:|-------:|-------:|-------:|----:|
|Mazda RX4        |21   |6     |160     |110     |3.90    |2.62 |
|Mazda RX4 Wag    |21   |6     |160     |110     |3.90    |2.88 |
|Datsun 710       |22.8 |4     |108     |93      |3.85    |2.32 |
etc...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The following is a simpler table, showing the Markdown-style table markup. Remember to label the table with a &lt;code&gt;marginnote&lt;/code&gt; shortcode, and you &lt;em&gt;must&lt;/em&gt; separate the label from the table with a single blank line. This markup:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;{% marginnote &amp;#39;Table-ID4&amp;#39; &amp;#39;Table 4: a simple table showing left, center, and right alignment of table headings and data&amp;#39; %}

|**Left** |**Center**|**Right**|
|:--------|:--------:|--------:|
 Aardvarks|         1|$3.50
       Cat|   5      |$4.23
  Dogs    |3         |$5.29
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Yields this table:&lt;/p&gt;
&lt;p&gt;&lt;label for=&#39;Table-ID4&#39; class=&#39;margin-toggle&#39;&gt;&amp;#8853;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;Table-ID4&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;marginnote&#39;&gt;Table 4: a simple table showing left, center, and right alignment of table headings and data&lt;/span&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&#34;text-align: left;&#34;&gt;&lt;strong&gt;Left&lt;/strong&gt;&lt;/th&gt;
&lt;th style=&#34;text-align: center;&#34;&gt;&lt;strong&gt;Center&lt;/strong&gt;&lt;/th&gt;
&lt;th style=&#34;text-align: right;&#34;&gt;&lt;strong&gt;Right&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align: left;&#34;&gt;Aardvarks&lt;/td&gt;
&lt;td style=&#34;text-align: center;&#34;&gt;1&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;$3.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align: left;&#34;&gt;Cat&lt;/td&gt;
&lt;td style=&#34;text-align: center;&#34;&gt;5&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;$4.23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align: left;&#34;&gt;Dogs&lt;/td&gt;
&lt;td style=&#34;text-align: center;&#34;&gt;3&lt;/td&gt;
&lt;td style=&#34;text-align: right;&#34;&gt;$5.29&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;code&#34;&gt;Code&lt;/h2&gt;
&lt;p&gt;Code needs to be monospace for formatting purposes and to aid in code analysis, but it must maintain its readability. To those ends, Tufte-Python follows GitHub’s font selection, which shifts gracefully along the monospace spectrum. Code samples use a monospace font using the &amp;lsquo;code&amp;rsquo; class. Python-Markdown&amp;rsquo;s &lt;code&gt;extra&lt;/code&gt; extension enables GitHub-flavored fenced code blocks, so both inline code such as &lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/code&gt; and blocks of code can be delimited by surrounding them with three backticks:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;(map tufte-style all-the-things)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;is created by the following markup:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```(map tufte-style all-the-things)```&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To get the code highlighted in the language of your choice, enclose the code block in three backticks followed by the language name, like this one showing the Python shortcode handler this theme uses for the &lt;code&gt;fullwidth&lt;/code&gt; tag you saw above:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&#34;k&#34;&gt;def&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;_h_fullwidth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;resolve_img&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;md_render&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;caption&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;caption&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_inline_markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;md_render&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;caption&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
        &lt;span class=&#34;sa&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;&amp;lt;figure class=&amp;#39;fullwidth&amp;#39;&amp;gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&#34;sa&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;&amp;lt;img src=&amp;#39;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;resolve_img&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#39;/&amp;gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&#34;sa&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;quot;&amp;lt;figcaption&amp;gt;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;caption&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;lt;/figcaption&amp;gt;&amp;lt;/figure&amp;gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;which came from this markup:&lt;/p&gt;
&lt;pre&gt; &lt;code&gt;``` python
    def _h_fullwidth(args, resolve_img, md_render):
    blah, blah...
   ```&lt;/code&gt; &lt;/pre&gt;

&lt;p&gt;Syntax-highlighting colors, like everything else on this page, come from whichever theme is active.&lt;/p&gt;</description>
      <pubDate>Fri, 10 Jul 2026 09:46:04 +0000</pubDate>
      <link>https://hyperphantasia.github.io/tufte-python/articles/2026/tufte-style-python-blog/</link>
      <guid isPermaLink="true">https://hyperphantasia.github.io/tufte-python/articles/2026/tufte-style-python-blog/</guid>
      <category>python</category>
      <category>tufte</category>
      <category>visualization</category>
      <category>latex</category>
      <category>python</category>
      <category>css</category>
      <category>tutorial</category>
      <category>blog</category>
    </item>
    <item>
      <title>Edge Cases</title>
      <description>&lt;p&gt;Some edge cases &lt;label for=&#39;mn-id-1&#39; class=&#39;margin-toggle&#39;&gt;&amp;#8853;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;mn-id-1&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;marginnote&#39;&gt;For the source article, see &lt;a href=&#34;https://clayh53.github.io/tufte-jekyll/articles/20/Edge-Cases&#34;&gt;Harmon&lt;/a&gt;.&lt;/span&gt;and cautionary examples on using Markdown for writing content using this theme. In particular, list syntax can really knot things up.&lt;/p&gt;
&lt;h3 id=&#34;mathjax-and-characters-inside-blocks&#34;&gt;MathJax and &amp;ldquo;&amp;gt;&amp;rdquo;, &amp;ldquo;&amp;lt;&amp;rdquo;, &amp;ldquo;&amp;amp;&amp;rdquo; characters inside blocks&lt;/h3&gt;
&lt;p&gt;MathJax renders block-style expressions inside a &lt;code&gt;$$ ... $$&lt;/code&gt; pair straight from the raw page text. the Markdown pass doesn&amp;rsquo;t touch what&amp;rsquo;s between them, so there&amp;rsquo;s no risk of the parser mangling special characters before MathJax ever sees them.&lt;/p&gt;
&lt;p&gt;This code:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&#34;sb&#34;&gt;$$&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;  D &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;\left&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;\begin&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;{matrix}&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt; &amp;amp; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt; &amp;amp; &amp;amp; &amp;amp; &amp;amp; &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;\\&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;  &amp;amp;    &amp;amp; &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;\cdots&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt; &amp;amp;   &amp;amp; &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;\\&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;  &amp;amp;    &amp;amp;        &amp;amp; &lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt; &amp;amp; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;\end&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;{matrix}&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;\right&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;s&#34;&gt;$$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;yields this:&lt;/p&gt;
&lt;p&gt;$$
D = \left(\begin{matrix}
  1 &amp;amp; -1 &amp;amp; &amp;amp; &amp;amp; &amp;amp; \\
  &amp;amp;    &amp;amp; \cdots &amp;amp;   &amp;amp; \\
  &amp;amp;    &amp;amp;        &amp;amp; 1 &amp;amp; -1
\end{matrix}
\right)
$$&lt;/p&gt;
&lt;p&gt;Other examples from the &lt;a href=&#34;http://latex.wikia.com/wiki/Matrix_environments&#34;&gt;wikia Tex reference&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;$$
\begin{matrix}
\alpha&amp;amp; \beta^{*}\\
\gamma^{*}&amp;amp; \delta
\end{matrix}
$$&lt;/p&gt;
&lt;p&gt;$$
\begin{bmatrix}
\alpha&amp;amp; \beta^{*}\\
\gamma^{*}&amp;amp; \delta
\end{bmatrix}
$$&lt;/p&gt;
&lt;p&gt;$$
\begin{Bmatrix}
\alpha&amp;amp; \beta^{*}\\
\gamma^{*}&amp;amp; \delta
\end{Bmatrix}
$$&lt;/p&gt;
&lt;p&gt;$$
\begin{vmatrix}
\alpha&amp;amp; \beta^{*}\\
\gamma^{*}&amp;amp; \delta
\end{vmatrix}
$$&lt;/p&gt;
&lt;p&gt;$$
\begin{Vmatrix}
\alpha&amp;amp; \beta^{*}\\
\gamma^{*}&amp;amp; \delta
\end{Vmatrix}
$$&lt;/p&gt;
&lt;p&gt;$$
\begin{Vmatrix}
\alpha&amp;amp; \beta^{*}\\
\gamma^{*}&amp;amp; \delta
\end{Vmatrix}
$$&lt;/p&gt;
&lt;p&gt;Note that inline matrices need a bit of extra care, for example &lt;a href=&#34;https://en.wikibooks.org/wiki/LaTeX/Mathematics#Matrices_in_running_text&#34;&gt;here&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;To not increase leading in a portion of text, a matrix in text must be set smaller: &lt;/p&gt;
&lt;p&gt;$$ \bigl(\begin{smallmatrix}a &amp;amp; b \\ c &amp;amp; d\end{smallmatrix} \bigr) $$ &lt;/p&gt;
&lt;p&gt;The way this inline matrix is written is: &lt;/p&gt;
&lt;p&gt;&lt;code&gt;$$ \bigl(\begin{smallmatrix}a &amp;amp; b \\ c &amp;amp; d\end{smallmatrix} \bigr) $$&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;edge-case-1-list-formatting&#34;&gt;Edge Case 1: list formatting&lt;/h2&gt;
&lt;h3 id=&#34;no-blank-lines-between-markdown-list-items&#34;&gt;No blank lines between Markdown list items&lt;/h3&gt;
&lt;p&gt;The issue arises when sidenotes and marginnotes are put into list items. As mentioned in the main documentation page, &lt;strong&gt;lists can be problematic&lt;/strong&gt; not only for semantic clarity, but also because they can create formatting issues. For example:&lt;/p&gt;
&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Split Bregman iteration &lt;label for=&#39;1&#39; class=&#39;margin-toggle sidenote-number&#39;&gt;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;1&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;sidenote&#39;&gt;Goldstein, T. and Osher, S. (2009). The split Bregman method for l1-regularized problems. SIAM J. Img. Sci., 2:323-343.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Dykstra&amp;rsquo;s alternating projection algorithm &lt;label for=&#39;2&#39; class=&#39;margin-toggle sidenote-number&#39;&gt;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;2&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;sidenote&#39;&gt;Dykstra, R. L. (1983). An algorithm for restricted least squares regression. J. Amer. Statist. Assoc., 78(384):837-842.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Proximal point algorithm applied to the dual&lt;/li&gt;
&lt;li&gt;Numerous applications in statistics and machine learning: lasso, gen. lasso, graphical lasso, (overlapping) group lasso, &amp;hellip;&lt;/li&gt;
&lt;li&gt;Embraces distributed computing for big data &lt;label for=&#39;3&#39; class=&#39;margin-toggle sidenote-number&#39;&gt;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;3&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;sidenote&#39;&gt;Boyd, S., Parikh, N., Chu, E., Peleato, B., and Eckstein, J. (2011). Distributed optimization and statistical learning via the alternating direction method of multipliers. Found. Trends Mach. learn., 3(1):1-122.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;why-this-matters&#34;&gt;Why this matters&lt;/h3&gt;
&lt;p&gt;Notice how the sidenotes display properly, but the fact that sidenotes have more display &amp;lsquo;volume&amp;rsquo; than the list items themselves causes a horizontal mismatch between the sidenote item&amp;rsquo;s number and its corresponding list item.&lt;/p&gt;
&lt;p&gt;Please note that there must be &lt;em&gt;no blank lines between your list items&lt;/em&gt;. This isn&amp;rsquo;t specific to any one Markdown parser. It&amp;rsquo;s standard Markdown behavior (this theme&amp;rsquo;s Python-Markdown behaves the same way Kramdown, Python-Markdown&amp;rsquo;s own &lt;code&gt;extra&lt;/code&gt; extension, and most other implementations do): a blank line between list items switches a list from &amp;ldquo;tight&amp;rdquo; to &amp;ldquo;loose&amp;rdquo;, and loose lists wrap each item&amp;rsquo;s content in its own &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag. If you have a list, and you put a blank line between the items like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;  + list item 1

  + list item 2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It will create an html tag structure like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;lt;ul&amp;gt;
   &amp;lt;li&amp;gt;
      &amp;lt;p&amp;gt;list item 1&amp;lt;/p&amp;gt;
  &amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;
      &amp;lt;p&amp;gt;list item 2&amp;lt;/p&amp;gt;
   &amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Which &lt;em&gt;totally&lt;/em&gt; goofs up the layout CSS.&lt;/p&gt;
&lt;p&gt;However, if your Markdown is this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;    + list item 1
    + list item 2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It will create a tag structure like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;lt;ul&amp;gt;
   &amp;lt;li&amp;gt;list item 1&amp;lt;/li&amp;gt;
   &amp;lt;li&amp;gt;list item 2&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here is the same content as above, with a blank line separating the list items. Notice how the sidenotes get squashed into the main content area:&lt;/p&gt;
&lt;h3 id=&#34;remarks-on-admm-version-2-one-blank-line-between-markdown-list-items&#34;&gt;Remarks on ADMM version 2 - &lt;strong&gt;one blank line&lt;/strong&gt; between Markdown list items&lt;/h3&gt;
&lt;p&gt;Related algorithms&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Split Bregman iteration &lt;label for=&#39;1&#39; class=&#39;margin-toggle sidenote-number&#39;&gt;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;1&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;sidenote&#39;&gt;Goldstein, T. and Osher, S. (2009). The split Bregman method for l1-regularized problems. SIAM J. Img. Sci., 2:323-343.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Dykstra&amp;rsquo;s alternating projection algorithm &lt;label for=&#39;2&#39; class=&#39;margin-toggle sidenote-number&#39;&gt;&lt;/label&gt;&lt;input type=&#39;checkbox&#39; id=&#39;2&#39; class=&#39;margin-toggle&#39;/&gt;&lt;span class=&#39;sidenote&#39;&gt;Dykstra, R. L. (1983). An algorithm for restricted least squares regression. J. Amer. Statist. Assoc., 78(384):837-842.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Proximal point algorithm applied to the dual&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Numerous applications in statistics and machine learning: lasso, gen. lasso, graphical lasso, (overlapping) group lasso, &amp;hellip;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;edge-case-2-shortcode-quoting&#34;&gt;Edge Case 2: shortcode quoting&lt;/h2&gt;
&lt;p&gt;This Python port is actually &lt;em&gt;less&lt;/em&gt; fiddly than the Jekyll original it grew from. Jekyll&amp;rsquo;s Liquid tags are parsed before Markdown ever runs, with no concept of a Markdown code span. If you wanted to &lt;em&gt;show&lt;/em&gt; a shortcode&amp;rsquo;s literal syntax inside backticks (rather than have it expand), you had to wrap it in an escaping trick just to stop Liquid from touching it. Tufte-python&amp;rsquo;s shortcode expander, explicitly skips over fenced and inline code spans before it looks for anything to expand (see &lt;code&gt;tufte_ssg/shortcodes.py&lt;/code&gt;), so code spans containing shortcode-like syntax just work, with no escaping trick needed. Every code span you&amp;rsquo;ve seen throughout this site&amp;rsquo;s sample posts is proof of that.&lt;/p&gt;
&lt;p&gt;The other half of the puzzle is arguments &lt;em&gt;with&lt;/em&gt; real quote characters in them, like an &lt;code&gt;&amp;lt;a href=&#34;...&#34;&amp;gt;&lt;/code&gt; tag embedded in a caption. Shortcode arguments are parsed the same forgiving way a Unix shell parses a quoted command line (via Python&amp;rsquo;s &lt;code&gt;shlex&lt;/code&gt;): wrap an argument in double quotes and a backslash-escaped &lt;code&gt;\&#34;&lt;/code&gt; inside it becomes a literal &lt;code&gt;&#34;&lt;/code&gt;, and an apostrophe inside it (like Tufte&amp;rsquo;&lt;strong&gt;s&lt;/strong&gt;) needs no special handling at all, since it isn&amp;rsquo;t the character being used to delimit the argument. So this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;{% fullwidth &amp;quot;assets/img/napoleons-march.png&amp;quot; &amp;quot;Napoleon&amp;#39;s March (via &amp;lt;a href=\&amp;quot;//www.edwardtufte.com/tufte/\&amp;quot;&amp;gt;Edward Tufte&amp;lt;/a&amp;gt;)&amp;quot; %}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;produces the following image with a link in its caption, apostrophe and all, with none of the &amp;ldquo;escaping the escapes&amp;rdquo; gymnastics the original needed:&lt;/p&gt;
&lt;figure class=&#39;fullwidth&#39;&gt;&lt;img src=&#39;/tufte-python/assets/img/napoleons-march.png&#39;/&gt;&lt;figcaption&gt;Napoleon&amp;rsquo;s March (via &lt;a href=&#34;//www.edwardtufte.com/tufte/&#34;&gt;Edward Tufte&lt;/a&gt;)&lt;/figcaption&gt;&lt;/figure&gt;</description>
      <pubDate>Thu, 09 Jul 2026 15:04:01 +0000</pubDate>
      <link>https://hyperphantasia.github.io/tufte-python/articles/2026/edge-cases/</link>
      <guid isPermaLink="true">https://hyperphantasia.github.io/tufte-python/articles/2026/edge-cases/</guid>
      <category>post</category>
    </item>
  </channel>
</rss>