-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeed.xml
More file actions
640 lines (485 loc) · 48.1 KB
/
feed.xml
File metadata and controls
640 lines (485 loc) · 48.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Hernan Payrumani</title>
<description>My personal blog</description>
<link>/</link>
<atom:link href="/feed.xml" rel="self" type="application/rss+xml"/>
<pubDate>Sun, 28 Feb 2016 21:39:22 -0500</pubDate>
<lastBuildDate>Sun, 28 Feb 2016 21:39:22 -0500</lastBuildDate>
<generator>Jekyll v2.5.3</generator>
<item>
<title>Tufte-style Jekyll blog</title>
<description><h2 id="introduction">Introduction</h2>
<p><span class="newthought">The Tufte Jekyll theme</span> is an attempt to create a website design with the look and feel of Edward Tufte’s books and handouts. Tufte’s style is known for its extensive use of sidenotes, tight integration of graphics with text, and well-set typography.<!--more--> The idea for this project is essentially cribbed wholesale from Tufte and R Markdown’s Tufte Handout format<label for="One" class="margin-toggle sidenote-number"></label><input type="checkbox" id="One" class="margin-toggle" /><span class="sidenote">See <a href="https://tufte-latex.github.io/tufte-latex/">tufte-latex.github.io/tufte-latex/</a> and <a href="http://rmarkdown.rstudio.com/tufte_handout_format.html">rmarkdown.rstudio.com/tufte_handout_format</a> </span> This page is an adaptation of the <a href="http://rmarkdown.rstudio.com/examples/tufte-handout.pdf">Tufte Handout PDF</a>.</p>
<h2 id="jekyll-customizations">Jekyll customizations</h2>
<p>This Jekyll blog theme is based on the github repository by Edward Tufte <a href="https://github.com/edwardtufte/tufte-css">here</a>, which was orginally created by Dave Leipmann, but is now labeled under Edward Tufte’s moniker. I borrowed freely from the Tufte-CSS repo and have transformed many of the typographic and page-structural features into a set of custom Liquid tags that make creating content using this style much easier than writing straight HTML. Essentially, if you know markdown, and mix in a few custom Liquid tags, you can be creating a website with this document style in short order.</p>
<p>The remainder of this sample post is a self-documenting survey of the features of the Tufte-Jekyll theme. I have taken almost all of the sample content from the <a href="https://github.com/edwardtufte/tufte-css">Tufte-css</a> repo and embedded it here to illustrate the parity in appearence between the two. The additional verbiage and commentary I have added is to document the custom <em>Liquid</em> markup tags and other features that are bundled with this theme.</p>
<h3 id="the-sass-settings-file">The SASS settings file</h3>
<p>I have taken much of the actual <em>Tufte-css</em> files and modified them as necessary to accomodate the needs inherent in creating a Jekyll theme that has additional writing aids such as the Liquid tags. I have also turned the CSS file into a <a href="http://sass-lang.com">SASS</a> file (the .scss type). This means that you can alter things like font choices, text color, background color, and underlining style by changing values in this file. When the Jekyll site is built using <code>jekyll build</code> the settings in this file will be compiled into the customized CSS file that the site uses.</p>
<p>This file looks like this:</p>
<p>```
/* This file contains all the constants for colors and font styles */</p>
<p>$body-font: ETBembo, Palatino, “Palatino Linotype”, “Palatino LT STD”, “Book Antiqua”, Georgia, serif;
// Note that Gill Sans is the top of the stack and corresponds to what is used in Tufte’s books
// However, it is not a free font, so if it is not present on the computer that is viewing the webpage
// The free Google ‘Lato’ font is used instead. It is similar.
$sans-font: “Gill Sans”, “Gill Sans MT”, “Lato”, Calibri, sans-serif;
$code-font: Consolas, “Liberation Mono”, Menlo, Courier, monospace;
$url-font: “Lucida Console”, “Lucida Sans Typewriter”, Monaco, “Bitstream Vera Sans Mono”, monospace;
$text-color: #111;
$bg-color: #fffff8;
$contrast-color: #a00000;
$border-color: #333333;
$link-style: color; // choices are ‘color’ or ‘underline’. Default is color using $contrast-color set above
<code>
Any of these values can be changed in the</code>_sass/_settings.scss``` file before the site is built. The default values are the ones from <em>tufte-css</em>.</p>
<h2 id="fundamentals">Fundamentals</h2>
<h3 id="color">Color</h3>
<p>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. I picked <code>#fffff8</code> and <code>#111111</code> because they are nearly indistinguishable from their ‘pure’ cousins, but dial down the harsh contrast. Tufte’s books are a study in spare, minimalist design. In his book <a href="http://www.edwardtufte.com/tufte/books_vdqi">The Visual Display of Quantitative Information</a>, he uses a red ink to add some visual punctuation to the buff colored paper and dark ink. In that spirit, links are styled using a similar red color.</p>
<h3 id="headings">Headings</h3>
<p>Tufte CSS uses <code>&lt;h1&gt;</code> for the document title, <code>&lt;p&gt;</code> with class <code>code</code> for the document subtitle, <code>&lt;h2&gt;</code> for section headings, and <code>&lt;h3&gt;</code> 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:</p>
<blockquote>
<p>[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 <em>sentences</em> which then cumulate sequentially into <em>paragraphs</em>, rather than the grunts of bullet points. Undergraduate Caltech physics is very complicated material, but it didn’t require an elaborate hierarchy to organize.
<cite><a href="http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000hB">http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000hB</a></cite></p>
</blockquote>
<p>As a bonus, this excerpt regarding the use of headings provides an example of using block quotes. Markdown does not have a native <code>&lt;cite&gt;</code> shorthand, but real html can be sprinkled in with the Markdown text. In the previous example, the <code>&lt;cite&gt;</code> was preceded with a single return after the quotation itself. The previous blockquote was written in Markdown thusly:</p>
<p>&gt; <code>[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’t require an elaborate hierarchy to organize.</code>
<code>&lt;cite&gt;[http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000hB](http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000hB)&lt;/cite&gt;</code></p>
<p>Tufte CSS styles headings <code>h1</code>, <code>h2</code>, and <code>h3</code>, making them nearly identical except for font size. The <code>h1</code> should be used as a title, the <code>h2</code> for section headings, and <code>h3</code> for subsection headings.</p>
<p>While this Jekyll theme supports more specific headings, if you feel the urge to reach for a heading of level 4 or higher, consider redesigning your document.</p>
<p><span class="newthought">In his later books</span> <label for="two" class="margin-toggle sidenote-number"></label><input type="checkbox" id="two" class="margin-toggle" /><span class="sidenote"><a href="http://www.edwardtufte.com/tufte/books_be">http://www.edwardtufte.com/tufte/books_be</a> </span>, 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 style, enclose the sentence fragment you want styled with small caps in a custom Liquid tag called ‘newthought’ like so:</p>
<p><code>Liquid
{% newthought 'In his later books' %}
</code></p>
<h3 id="text">Text</h3>
<p>In print, Tufte uses the proprietary Monotype Bembo<label for="3" class="margin-toggle sidenote-number"></label><input type="checkbox" id="3" class="margin-toggle" /><span class="sidenote">See Tufte’s comment in the <a href="http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000Vt">Tufte book fonts</a> thread. </span> font. A similar effect is achieved in digital formats with the now open-source ETBembo, which Tufte-Jekyll supplies with a <code>@font-face</code> reference to a .ttf file. Thanks to <a href="https://github.com/daveliepmann/tufte-css/commit/0a810a7d5f4707941c6f9fe99a53ec41f50a5c00">Linjie Ding</a>, italicized text uses the ETBembo Italic font instead of mechanically skewing the characters. In case ETBembo somehow doesn’t work, Tufte CSS degrades gracefully to other serif fonts like Palatino and Georgia. Notice that Tufte CSS includes separate font files for bold (strong) and italic (emphasis), instead of relying on the browser to mechanically transform the text. This is typographic best practice. It’s also really important. Thus concludes my unnecessary use of em and strong for the purpose of example.</p>
<p>Code snippets ape GitHub’s font selection using Microsoft’s <a href="http://www.microsoft.com/typography/ClearTypeFonts.mspx"><em>Consolas</em></a> and the sans-serif font uses Tufte’s choice of Gill Sans. Since this is not a free font, and some systems will not have it installed, the free google font <a href="https://www.google.com/fonts/specimen/Lato"><em>Lato</em></a> is designated as a fallback.</p>
<h3 id="lists">Lists</h3>
<p>Tufte points out that while lists have valid uses, they tend to promote ineffective writing habits due to their “lack of syntactic and intellectual discipline”. He is particularly critical of hierarchical and bullet-pointed lists. So before reaching for an HTML list element, ask yourself:</p>
<ul>
<li>Does this list actually have to be represented using an HTML ul or ol element?</li>
<li>Would my idea be better expressed as sentences in paragraphs?</li>
<li>Is my message causally complex enough to warrant a flow diagram instead?</li>
</ul>
<p>This is but a small subset of a proper overview of the topic of lists in communication. A better way to understand Tufte’s thoughts on lists would be to read “The Cognitive Style of PowerPoint: Pitching Out Corrupts Within,” a chapter in Tufte’s book <em>Beautiful Evidence</em>, excerpted at some length by Tufte himself <a href="http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0002QF">on his website</a>. The whole piece is information-dense and therefore difficult to summarize. He speaks to web design specifically, but in terms of examples and principles rather than as a set of simple do-this, don’t-do-that prescriptions. It is well worth reading in full for that reason alone.</p>
<p>For these reasons, Tufte CSS encourages caution before reaching for a list element, and by default removes the bullet points from unordered lists.</p>
<h2 id="figures">Figures</h2>
<h3 id="margin-figures">Margin Figures</h3>
<p><label for="mf-id-1" class="margin-toggle">⊕</label><input type="checkbox" id="mf-id-1" class="margin-toggle" /><span class="marginnote"><img class="fullwidth" src="/assets/img/rhino.png" /><br />F.J. Cole, “The History of Albrecht Dürer’s Rhinoceros in Zoological Literature,” <em>Science, Medicine, and History: Essays on the Evolution of Scientific Thought and Medical Practice</em> (London, 1953), ed. E. Ashworth Underwood, 337-356. From page 71 of Edward Tufte’s <em>Visual Explanations</em>.</span>Images and graphics play an integral role in Tufte’s work. To place figures in the margin, use the custom margin figure liquid tag included in the <code>_plugins</code> directory like so:</p>
<p><code>{% marginfigure 'mf-id-whatever' 'assets/img/rhino.png' '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*.' %}</code>.</p>
<p>Note that this tag has <em>three</em> parameters. The first is an arbitrary id. This parameter can be named anything as long as it is unique to this post. The second parameter is the path to the image. And the final parameter is whatever caption you want to be displayed with the figure. All parameters <em>must</em> be enclosed in quotes for this simple liquid tag to work!</p>
<h3 id="full-width-figures">Full Width Figures</h3>
<p>If you need a full-width image or figure, another custom liquid tag is available to use. Oddly enough, it is named ‘fullwidth’, and this markup:</p>
<p><code>{% fullwidth 'assets/img/napoleons-march.png' 'Napoleon's March (Edward Tufte’s English translation)' %}</code></p>
<p>Yields this:</p>
<figure class="fullwidth"><img src="/assets/img/napoleons-march.png" /><figcaption>Napoleon's March (Edward Tufte’s English translation)</figcaption></figure>
<h3 id="main-column-figures">Main Column Figures</h3>
<p>Besides margin and full width figures, you can of course also include figures constrained to the main column. Yes, you guessed it, a custom liquid tag rides to the rescue once again:</p>
<p><code>{% maincolumn 'assets/img/export-imports.png' 'From Edward Tufte, *Visual Display of Quantitative Information*, page 92' %}</code></p>
<p>yields this:</p>
<figure><figcaption>From Edward Tufte, *Visual Display of Quantitative Information*, page 92</figcaption><img src="/assets/img/exports-imports.png" /></figure>
<h2 id="sidenotes-and-margin-notes">Sidenotes and Margin notes</h2>
<p>One of the most prominent and distinctive features of Tufte’s style is the extensive use of sidenotes and margin notes. Perhaps you have noticed their use in this document already. You are very astute.</p>
<p>There is a wide margin to provide ample room for sidenotes and small figures. There exists a slight semantic distinction between <em>sidenotes</em> and <em>marginnotes</em>.</p>
<h3 id="sidenotes">Sidenotes</h3>
<p>Sidenotes<label for="sn-id-whatever" class="margin-toggle sidenote-number"></label><input type="checkbox" id="sn-id-whatever" class="margin-toggle" /><span class="sidenote">This is a sidenote and <em>displays a superscript</em> </span> display a superscript. The <em>sidenote</em> Liquid tag contains two components. 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 components is the actual content of the sidenote. Both of these components should be enclosed in single quotes. Note that we are using the CSS ‘counter’ trick to automagically 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:</p>
<p><code>{% sidenote 'sn-id-whatever' 'This is a sidenote and *displays a superscript*'%}</code></p>
<h3 id="margin-notes">Margin notes</h3>
<p>Margin notes<label for="mn-id-whatever" class="margin-toggle"> ⊕</label><input type="checkbox" id="mn-id-whatever" class="margin-toggle" /><span class="marginnote">This is a margin note <em>without</em> a superscript </span> are similar to sidenotes, but do not display a superscript. The <em>marginnnote</em> Liquid tags has the same two components as the <em>sidenote</em> tag. Anything can be placed in a margin note. Well, anything that is an inline element. Block level elements can make the Kramdown parser do strange things. On small screens, the margin notes disappear and this symbol: <span class="contrast ">⊕</span> pops up. When clicked, it will open the margin note below the content, which can then be closed with a similar click. The Markdown content has a similar sort of markup as a sidenote, but without a number involved:</p>
<p><code>{% marginnote 'mn-id-whatever' 'This is a margin note *without* a superscript' %}</code></p>
<h2 id="equations">Equations</h2>
<p>The Markdown parser being used by this Jekyll theme is Kramdown, which contains some built-in <a href="//www.mathjax.org">Mathjax</a> support. Both inline and block-level mathematical figures can be added to the content.</p>
<p>For instance, the following inline sequence:</p>
<p><em>When <span><script type="math/tex">a \ne 0</script></span>, there are two solutions to <span><script type="math/tex">ax^2 + bx + c = 0</script></span></em></p>
<p>is written by enclosing a Mathjax expression with a <em>Liquid inline tag pair</em> (‘m’ and ‘em’) like so:</p>
<p><code>When {% m %} a \ne 0{% em %}, there are two solutions to {% m %}ax^2 + bx + c = 0{% em %}</code></p>
<p>Similarly, this block-level Mathjax expression:</p>
<div class="mathblock"><script type="math/tex; mode=display">x = {-b \pm \sqrt{b^2-4ac} \over 2a}.</script></div>
<p>is written by enclosing the expression with a <em>Liquid block tag pair</em> (‘math’ and ‘endmath’) like so:</p>
<p><code>{% math %}x = {-b \pm \sqrt{b^2-4ac} \over 2a}.{% endmath %}</code></p>
<p>You can get pretty fancy, for instance, the wave equation’s nabla is no big thing:</p>
<div class="mathblock"><script type="math/tex; mode=display">\frac{\partial^2 y}{\partial t^2}= c^2\nabla^2u</script></div>
<p>All of the standard Latex equation markup is available to use inside these block tags.</p>
<p>Please note that the block-level Mathjax expressions <em>must</em> be on their own line, separated from content above and below the block by a blank line for the Kramdown parser and the Mathjax javascript to play nicely with one another.</p>
<p>The Mathjax integration is tricky, and some things such as the inline matrix notation simply do not work well. Bottom line: If you are using this to document mathematics, be super careful to isolate your <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> blocks by blank lines!</p>
<h2 id="tables">Tables</h2>
<p>Tables are, frankly, a pain in the ass 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.</p>
<p>Note that when writing Jekyll Markdown content, there will often be a need to get some dirt under your fingernails and stoop to writing a little honest-to-god html. Yes, all that hideous <code>&lt;table&gt;..&lt;thead&gt;..&lt;th&gt;</code> nonsense. <em>And</em> you must wrap the unholy mess in a <code>&lt;div class="table-wrapper"&gt;</code> tag to ensure that the table stays centered in the main content column.</p>
<p>Tables are designed with an <code>overflow:scroll</code> 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.</p>
<p><label for="table-1-id" class="margin-toggle"> ⊕</label><input type="checkbox" id="table-1-id" class="margin-toggle" /><span class="marginnote"><em>Table 1</em>: A table with default style formatting </span></p>
<div class="table-wrapper">
<table class="table-alpha" id="newspaper-tone">
<thead>
<tr>
<th class="text">Content and tone of front-page articles in 94 U.S. newspapers, October and November, 1974</th>
<th>Number of articles</th>
<th>Percent of articles with negative criticism of specific person or policy</th></tr>
</thead>
<tbody>
<tr>
<td class="text">Watergate: defendants and prosecutors, Ford’s pardon of Nixon</td>
<td><div class="number">537</div></td>
<td><div class="number">49%</div></td>
</tr>
<tr>
<td class="text">Inflation, high cost of living</td>
<td><div class="number">415</div></td>
<td><div class="number">28%</div></td>
</tr>
<tr>
<td class="text">Government competence: costs, quality, salaries of public employees</td>
<td><div class="number">322</div></td>
<td><div class="number">30%</div></td>
</tr>
<tr>
<td class="text">Confidence in government: power of special interests, trust in political leaders, dishonesty in politics</td>
<td><div class="number">266</div></td>
<td><div class="number">52%</div></td>
</tr>
<tr>
<td class="text">Government power: regulation of business, secrecy, control of CIA and FBI</td>
<td><div class="number">154</div></td>
<td><div class="number">42%</div></td>
</tr>
<tr>
<td class="text">Crime</td>
<td><div class="number">123</div></td>
<td><div class="number">30%</div></td>
</tr>
<tr>
<td class="text">Race</td>
<td><div class="number">103</div></td>
<td><div class="number">25%</div></td>
</tr>
<tr>
<td class="text">Unemployment</td>
<td><div class="number">100</div></td>
<td><div class="number">13%</div></td>
</tr>
<tr>
<td class="text">Shortages: energy, food</td>
<td><div class="number">68</div></td>
<td><div class="number">16%</div></td>
</tr>
</tbody>
</table>
</div>
<p>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 “the table style to use”, but rather as “a table style to start from”. From here, use principles to guide you: avoid chartjunk, optimize the data-ink ratio (“within reason”, as Tufte says), and “mobilize every graphical element, perhaps several times over, to show the data.<label for="table-id" class="margin-toggle sidenote-number"></label><input type="checkbox" id="table-id" class="margin-toggle" /><span class="sidenote">Page 139, <em>The Visual Display of Quantitative Information</em>, Edward Tufte 2001. </span> Furthermore, one must know when to reach for more complex data presentation tools, like a custom graphic or a JavaScript charting library.</p>
<p>As an example of alternative table styles, academic publications written in <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> often rely on the <code>booktabs</code> package to produce clean, clear tables. Similar results can be achieved in Tufte CSS with the <code>booktabs</code> class, as demonstrated in this table:</p>
<p><label for="table-2-id" class="margin-toggle"> ⊕</label><input type="checkbox" id="table-2-id" class="margin-toggle" /><span class="marginnote"><em>Table 2</em>: A table with booktabs style formatting </span></p>
<div class="table-wrapper">
<table class="booktabs">
<thead>
<tr><th colspan="2" class="cmid">Items</th><th class="nocmid"></th></tr>
<tr><th>Animal</th><th>Description</th><th>Price ($)</th></tr>
</thead>
<tbody>
<tr><td>Gnat</td> <td>per gram</td><td class="r">13.65</td></tr>
<tr><td></td> <td>each</td> <td class="r">0.01</td></tr>
<tr><td>Gnu</td> <td>stuffed</td> <td class="r">92.50</td></tr>
<tr><td>Emu</td> <td>stuffed</td> <td class="r">33.33</td></tr>
<tr><td>Armadillo</td><td>frozen</td> <td class="r">8.99</td></tr>
</tbody>
</table>
</div>
<p><span class="newthought">I like this style of table,</span> so I have made it the default for unstyled tables. This allows use of the <a href="https://michelf.ca/projects/php-markdown/extra/"><em>Markdown Extra</em></a> features built into the <a href="http://kramdown.gettalong.org/parser/kramdown.html"><em>Kramdown</em></a> parser. Here is a table created using the Markdown Extra table syntax to make a nice table which has the side benefit of being human readable in the raw markdown file:</p>
<p><label for="tableID-3" class="margin-toggle"> ⊕</label><input type="checkbox" id="tableID-3" class="margin-toggle" /><span class="marginnote">Table 3: a table created with <em>Markdown Extra</em> markup using default table styling </span></p>
<table>
<thead>
<tr>
<th style="text-align: left"> </th>
<th style="text-align: right">mpg</th>
<th style="text-align: right">cyl</th>
<th style="text-align: right">disp</th>
<th style="text-align: right">hp</th>
<th style="text-align: right">drat</th>
<th style="text-align: right">wt</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">Mazda RX4</td>
<td style="text-align: right">21</td>
<td style="text-align: right">6</td>
<td style="text-align: right">160</td>
<td style="text-align: right">110</td>
<td style="text-align: right">3.90</td>
<td style="text-align: right">2.62</td>
</tr>
<tr>
<td style="text-align: left">Mazda RX4 Wag</td>
<td style="text-align: right">21</td>
<td style="text-align: right">6</td>
<td style="text-align: right">160</td>
<td style="text-align: right">110</td>
<td style="text-align: right">3.90</td>
<td style="text-align: right">2.88</td>
</tr>
<tr>
<td style="text-align: left">Datsun 710</td>
<td style="text-align: right">22.8</td>
<td style="text-align: right">4</td>
<td style="text-align: right">108</td>
<td style="text-align: right">93</td>
<td style="text-align: right">3.85</td>
<td style="text-align: right">2.32</td>
</tr>
<tr>
<td style="text-align: left">Hornet 4 Drive</td>
<td style="text-align: right">21.4</td>
<td style="text-align: right">6</td>
<td style="text-align: right">258</td>
<td style="text-align: right">110</td>
<td style="text-align: right">3.08</td>
<td style="text-align: right">3.21</td>
</tr>
<tr>
<td style="text-align: left">Hornet Sportabout</td>
<td style="text-align: right">18.7</td>
<td style="text-align: right">8</td>
<td style="text-align: right">360</td>
<td style="text-align: right">175</td>
<td style="text-align: right">3.15</td>
<td style="text-align: right">3.44</td>
</tr>
<tr>
<td style="text-align: left">Valiant</td>
<td style="text-align: right">18.1</td>
<td style="text-align: right">6</td>
<td style="text-align: right">160</td>
<td style="text-align: right">105</td>
<td style="text-align: right">2.76</td>
<td style="text-align: right">3.46</td>
</tr>
</tbody>
</table>
<p>Using the following markup(down):</p>
<p><code>
| |mpg | cyl | disp | hp | drat | wt |
|:----------------|----:|-----:|-------:|-------:|-------:|----:|
|Mazda RX4 |21 |6 |160 |110 |3.90 |2.62 |
etc..
</code></p>
<p>The following is a more simple table, showing the Markdown-style table markup. Remember to label the table with a <em>marginnote</em> Liquid tag, and you <em>must</em> separate the label from the table with a single blank line. This markup:</p>
<p>```
<label for="Table-ID4" class="margin-toggle"> ⊕</label><input type="checkbox" id="Table-ID4" class="margin-toggle" /><span class="marginnote">Table 4: a simple table showing left, center, and right alignment of table headings and data </span></p>
<p>|<strong>Left</strong> |<strong>Center</strong>|<strong>Right</strong>|
|:——–|:——–:|——–:|
Aardvarks| 1|$3.50
Cat| 5 |$4.23
Dogs |3 |$5.29
```</p>
<p>Yields this table:</p>
<p><label for="Table-ID4" class="margin-toggle"> ⊕</label><input type="checkbox" id="Table-ID4" class="margin-toggle" /><span class="marginnote">Table 4: a simple table showing left, center, and right alignment of table headings and data </span></p>
<table>
<thead>
<tr>
<th style="text-align: left"><strong>Left</strong></th>
<th style="text-align: center"><strong>Center</strong></th>
<th style="text-align: right"><strong>Right</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">Aardvarks</td>
<td style="text-align: center">1</td>
<td style="text-align: right">$3.50</td>
</tr>
<tr>
<td style="text-align: left">Cat</td>
<td style="text-align: center">5</td>
<td style="text-align: right">$4.23</td>
</tr>
<tr>
<td style="text-align: left">Dogs</td>
<td style="text-align: center">3</td>
<td style="text-align: right">$5.29</td>
</tr>
</tbody>
</table>
<h2 id="code">Code</h2>
<p>Code samples use a monospace font using the ‘code’ class. The Kramdown parser has the ‘GFM’ option enabled, which stands for ‘Github Flavored Markdown’, and this means that both inline code such as <code>#include &lt;stdio.h&gt;</code> and blocks of code can be delimited by surrounding them with 3 backticks:</p>
<p><code>
(map tufte-style all-the-things)
</code>
is created by the following markup:</p>
<pre><code>```(map tufte-style all-the-things)```</code></pre>
<p>To get the code highlighted in the language of your choice like so:</p>
<p>``` ruby
module Jekyll
class RenderFullWidthTag &lt; Liquid::Tag
require “shellwords”</p>
<pre><code>def initialize(tag_name, text, tokens)
super
@text = text.shellsplit
end
def render(context)
"&lt;div&gt;&lt;img class='fullwidth' src='#{@text[0]}'/&gt;&lt;/div&gt; " +
"&lt;p&gt;&lt;span class='marginnote'&gt;#{@text[1]}&lt;/span&gt;&lt;/p&gt;"
end end end
</code></pre>
<p>Liquid::Template.register_tag(‘fullwidth’, Jekyll::RenderFullWidthTag)
```</p>
<p>Enclose the code block in three backticks, followed by a space and then the language name, like this:</p>
<pre> <code>``` ruby
module Jekyll
blah, blah...
```</code> </pre>
</description>
<pubDate>Thu, 19 Feb 2015 16:46:04 -0500</pubDate>
<link>/articles/15/tufte-style-jekyll-blog</link>
<guid isPermaLink="true">/articles/15/tufte-style-jekyll-blog</guid>
<category>jekyll</category>
<category>css</category>
</item>
<item>
<title>Edge Cases</title>
<description><p>Some edge cases and cautionary examples on using Markdown for writing content using this theme. In particular, list syntax can really knot things up.
<!--more--></p>
<h3 id="mathjax-improperly-parsing-greater-and-less-than-and-ampersands-inside-blocks">Mathjax improperly parsing greater and less than and ampersands inside blocks</h3>
<p>The mathjax plugin has been modified to contain all the block style mathjax inside a <code>&lt;div class="mathblock"&gt;..&lt;/div&gt;</code> tag wrapper pair
which fixes many of the issues with conflicts with the Kramdown parser. Some examples sent to me by Quxiaofeng are now parsing correctly, I believe.</p>
<p>This code:</p>
<p><code>latex
{% math %}
D = \left(\begin{matrix}
1 &amp; -1 &amp; &amp; &amp; &amp; \\
&amp; &amp; \cdots &amp; &amp; \\
&amp; &amp; &amp; 1 &amp; -1
\end{matrix}
\right)
{% endmath %}
</code>
yields this:</p>
<div class="mathblock"><script type="math/tex; mode=display">
D = \left(\begin{matrix}
1 & -1 & & & & \\
& & \cdots & & \\
& & & 1 & -1
\end{matrix}
\right)
</script></div>
<p>Other examples from the <a href="http://latex.wikia.com/wiki/Matrix_environments">wikia Tex reference</a>:</p>
<div class="mathblock"><script type="math/tex; mode=display">
\begin{matrix}
\alpha& \beta^{*}\\
\gamma^{*}& \delta
\end{matrix}
</script></div>
<div class="mathblock"><script type="math/tex; mode=display">
\begin{bmatrix}
\alpha& \beta^{*}\\
\gamma^{*}& \delta
\end{bmatrix}
</script></div>
<div class="mathblock"><script type="math/tex; mode=display">
\begin{Bmatrix}
\alpha& \beta^{*}\\
\gamma^{*}& \delta
\end{Bmatrix}
</script></div>
<div class="mathblock"><script type="math/tex; mode=display">
\begin{vmatrix}
\alpha& \beta^{*}\\
\gamma^{*}& \delta
\end{vmatrix}
</script></div>
<div class="mathblock"><script type="math/tex; mode=display">
\begin{Vmatrix}
\alpha& \beta^{*}\\
\gamma^{*}& \delta
\end{Vmatrix}
</script></div>
<p>However, a problem still exists for inline matrix notation, from an example <a href="https://en.wikibooks.org/wiki/LaTeX/Mathematics#Matrices_in_running_text">here</a>:</p>
<p>A matrix in text must be set smaller: <span><script type="math/tex">\bigl(\begin{smallmatrix}a &amp; b \\ c &amp; d\end{smallmatrix} \bigr)</script></span> to not increase leading in a portion of text</p>
<h2 id="edge-case-1-from-quxiaofeng">Edge Case 1 from Quxiaofeng:</h2>
<h3 id="no-blank-lines-between-markdown-list-items">No blank lines between Markdown list items</h3>
<p>The issue arises when sidenotes and marginnotes are put into list items. For example:</p>
<h3 id="related-algorithms">Related algorithms</h3>
<ul>
<li>Split Bregman iteration <label for="1" class="margin-toggle sidenote-number"></label><input type="checkbox" id="1" class="margin-toggle" /><span class="sidenote">Goldstein, T. and Osher, S. (2009). The split Bregman method for l1-regularized problems. SIAM J. Img. Sci., 2:323-343. </span></li>
<li>Dykstra’s alternating projection algorithm <label for="2" class="margin-toggle sidenote-number"></label><input type="checkbox" id="2" class="margin-toggle" /><span class="sidenote">Dykstra, R. L. (1983). An algorithm for restricted least squares regression. J. Amer. Statist. Assoc., 78(384):837-842. </span></li>
<li>Proximal point algorithm applied to the dual</li>
<li>Numerous applications in statistics and machine learning: lasso, gen. lasso, graphical lasso, (overlapping) group lasso, …</li>
<li>Embraces distributed computing for big data <label for="3" class="margin-toggle sidenote-number"></label><input type="checkbox" id="3" class="margin-toggle" /><span class="sidenote">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. </span></li>
</ul>
<h3 id="why-this-matters">Why this matters</h3>
<p>Notice how the sidenotes display properly.</p>
<p><em>In summary</em>: Take out any blank lines between your list items.</p>
<p>Okay, this is a really strange thing about the Jekyll Markdown engine I have never noticed before. If you have a list, and you put a blank line between the items like this:</p>
<p>```
+ list item 1</p>
<pre><code> + list item 2 ```
</code></pre>
<p>It will create an html tag structure like this:</p>
<p>```</p>
<ul>
<li>
<p>list item 1</p>
</li>
<li>
<p>list item 2</p>
</li>
</ul>
<p>```
Which <em>totally</em> goofs up the layout CSS.</p>
<p>However, if your Markdown is this:</p>
<p><code>
+ list item 1
+ list item 2
</code></p>
<p>It will create a tag structure like this:</p>
<p>```</p>
<ul>
<li>list item 1</li>
<li>list item 2</li>
</ul>
<p>```</p>
<p>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:</p>
<h3 id="remarks-on-admm-version-2---one-blank-line-between-markdown-list-items">Remarks on ADMM version 2 - one blank line between Markdown list items</h3>
<p>Related algorithms</p>
<ul>
<li>
<p>Split Bregman iteration <label for="1" class="margin-toggle sidenote-number"></label><input type="checkbox" id="1" class="margin-toggle" /><span class="sidenote">Goldstein, T. and Osher, S. (2009). The split Bregman method for l1-regularized problems. SIAM J. Img. Sci., 2:323-343. </span></p>
</li>
<li>
<p>Dykstra’s alternating projection algorithm <label for="2" class="margin-toggle sidenote-number"></label><input type="checkbox" id="2" class="margin-toggle" /><span class="sidenote">Dykstra, R. L. (1983). An algorithm for restricted least squares regression. J. Amer. Statist. Assoc., 78(384):837-842. </span></p>
</li>
<li>
<p>Proximal point algorithm applied to the dual</p>
</li>
<li>
<p>Numerous applications in statistics and machine learning: lasso, gen. lasso, graphical lasso, (overlapping) group lasso, …</p>
</li>
</ul>
<h3 id="liquid-tag-parsing-strangeness">Liquid tag parsing strangeness</h3>
<p>Example of the proper way to write an url inside a Liquid full-width image tag.</p>
<p>This code: <code>{% fullwidth "assets/img/rhino.png" "Tufte pet rhino (via &lt;a href=\"//www.edwardtufte.com/tufte/\"&gt;Edward Tufte&lt;/a&gt;)" %}</code></p>
<figure class="fullwidth"><img src="/assets/img/rhino.png" /><figcaption>Tufte's pet rhino (via <a href="//www.edwardtufte.com/tufte/">Edward Tufte</a>)</figcaption></figure>
</description>
<pubDate>Tue, 17 Feb 2015 06:04:01 -0500</pubDate>
<link>/articles/15/Edge-Cases</link>
<guid isPermaLink="true">/articles/15/Edge-Cases</guid>
<category>post</category>
</item>
<item>
<title>Welcome to Jekyll!</title>
<description><p>You’ll find this post in your <code>_posts</code> directory - edit this post and re-build (or run with the <code>-w</code> switch) to see your changes!
To add new posts, simply add a file in the <code>_posts</code> directory that follows the convention: YYYY-MM-DD-name-of-post.ext.=]</p>
<p>Jekyll also offers powerful support for code snippets:</p>
<div class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">&quot;Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="k">end</span>
<span class="n">print_hi</span><span class="p">(</span><span class="s1">&#39;Tom&#39;</span><span class="p">)</span>
<span class="c1">#=&gt; prints &#39;Hi, Tom&#39; to STDOUT.</span></code></pre></div>
<p>Check out the <a href="http://jekyllrb.com">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/mojombo/jekyll">Jekyll’s GitHub repo</a>.</p>
</description>
<pubDate>Sun, 08 Feb 2015 08:06:04 -0500</pubDate>
<link>/articles/15/welcome-to-jekyll</link>
<guid isPermaLink="true">/articles/15/welcome-to-jekyll</guid>
<category>jekyll</category>
<category>update</category>
</item>
</channel>
</rss>