<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>(b)logophile &#187; (La)TeX</title>
	<atom:link href="http://www.logophile.org/blog/tags/latex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logophile.org/blog</link>
	<description>blog of a logophile (not "logos", but "λόγος")</description>
	<lastBuildDate>Sun, 05 Feb 2012 08:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Python datetime conversions</title>
		<link>http://www.logophile.org/blog/2010/08/15/python-datetime-conversions/</link>
		<comments>http://www.logophile.org/blog/2010/08/15/python-datetime-conversions/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 15:21:59 +0000</pubDate>
		<dc:creator>tikitu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[(La)TeX]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tikz]]></category>

		<guid isPermaLink="false">http://www.logophile.org/blog/?p=964</guid>
		<description><![CDATA[Recently for my work I had to do some date/time-wrangling in Python. We have a database containing unix timestamp values, and the front-end application needs to talk local time. The necessary conversions aren&#8217;t so complicated, but Python makes life a bit harder by having three relevant modules, three relevant data types (not matching the modules), [...]]]></description>
			<content:encoded><![CDATA[<p>Recently for my work I had to do some date/time-wrangling in Python. We have a database containing unix timestamp values, and the front-end application needs to talk local time. The necessary conversions aren&#8217;t so complicated, but Python makes life a bit harder by having three relevant modules, three relevant data types (not matching the modules), and a complicated web of conversion possibilities between them.</p>

<p>For instance:</p>

<ul>
<li>the <code>datetime</code> class lives in the <code>datetime</code> module; careful with your imports, you will want both!</li>
<li>the <code>datetime</code> module has a <code>time</code> class, but there&#8217;s also a <code>time</code> module</li>
<li>the documentation talks at different places about &#8220;time tuples&#8221; and also about &#8220;<code>time.struct_time</code>&#8221; objects; they&#8217;re the same thing</li>
<li>to convert a unix timestamp to a time tuple representing UTC time, you use <code>time.gmtime()</code>; for the reverse conversion, you use <code>calendar.timegm()</code> (this is the only place you&#8217;ll use the <code>calendar</code> module)</li>
<li>to get <em>now</em> you use:

<ul>
<li><code>time.localtime()</code> if you want a timetuple</li>
<li><code>time.time()</code> if you want a unix timestamp</li>
<li><code>datetime.now()</code> if you want a datetime object</li>
<li><code>time.gmtime()</code> if you want a timetuple representing UTC time</li>
<li><code>datetime.utcnow()</code> if you want a datetime object representing UTC time</li>
<li>a crowbar if necessary</li>
</ul></li>
<li>to build a <code>datetime</code> object from a time-tuple, you can set the fields one-by-one&#8230; or you can slice the time-tuple and unpack the list: <code>datetime(*a_time_tuple[:6])</code></li>
</ul>

<p>In other words, there&#8217;s a lot of fiddly detail to remember. So I made a chart.</p>

<div id="attachment_969" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.logophile.org/blog/wp-content/uploads/2010/08/python-date.pdf"><img src="http://www.logophile.org/blog/wp-content/uploads/2010/08/python-date.jpg" alt="Blurry overview of python date/time wrangling" title="python-date-img" width="600" height="424" class="size-full wp-image-969" /></a><p class="wp-caption-text">Click through for (non-blurry) PDF.</p></div>

<p>It&#8217;s formatted for a4 paper and prints nicely. I used the incredible LaTeX drawing system <a href="http://www.texample.net/tikz/examples/">TikZ</a>. (On my screen the arrows have a little glitch at start and finish, but it doesn&#8217;t appear in my printout. Possibly a TikZ bug? Not sure.)</p>

<p>Note that it doesn&#8217;t show <em>everything</em> you can do; apart from the more egregious omissions (like timezone handling on <code>datetime</code> objects, which actually seems quite straight-forward but didn&#8217;t fit nicely into the design), I didn&#8217;t include arrows for nonsensical operations. For example you could feed a UTC time-tuple into <code>time.mktime()</code> (which takes a <em>localtime</em> time-tuple to a unix timestamp), but the result would be nonsense: the number of seconds since a date similar to, but probably not quite the same as, the unix epoch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logophile.org/blog/2010/08/15/python-datetime-conversions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Another TeX font hint</title>
		<link>http://www.logophile.org/blog/2010/05/17/another-tex-font-hint/</link>
		<comments>http://www.logophile.org/blog/2010/05/17/another-tex-font-hint/#comments</comments>
		<pubDate>Mon, 17 May 2010 21:10:22 +0000</pubDate>
		<dc:creator>tikitu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[(La)TeX]]></category>
		<category><![CDATA[complicated]]></category>
		<category><![CDATA[fonts]]></category>

		<guid isPermaLink="false">http://www.logophile.org/blog/?p=897</guid>
		<description><![CDATA[New to ctan: the TeX Font Errors Cheatsheet, by Nico Schlömer. It&#8217;s for people trying to install fonts for vanilla (La)TeX (as I noted recently, there is an easier way), or for unfortunates whose already-installed fonts somehow break. It gives a chart showing what files TeX looks for when, cross-indexed to the errors that it [...]]]></description>
			<content:encoded><![CDATA[<p>New to <a href="http://www.ctan.org/">ctan</a>: the <a href="http://ctan.org/tex-archive/info/tex-font-errors-cheatsheet/">TeX Font Errors Cheatsheet</a>, by Nico Schlömer. It&#8217;s for people trying to install fonts for vanilla (La)TeX (as I <a href="/blog/2010/04/28/some-notes-on-fonts/">noted recently</a>, there is an <a href="http://ctan.org/tex-archive/macros/xetex/latex/fontspec/">easier way</a>), or for unfortunates whose already-installed fonts somehow break. It gives a chart showing what files TeX looks for when, cross-indexed to the errors that it gives when it doesn&#8217;t find things. Handy, if things are going wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logophile.org/blog/2010/05/17/another-tex-font-hint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some notes on fonts</title>
		<link>http://www.logophile.org/blog/2010/04/28/some-notes-on-fonts/</link>
		<comments>http://www.logophile.org/blog/2010/04/28/some-notes-on-fonts/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 18:39:20 +0000</pubDate>
		<dc:creator>tikitu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[(La)TeX]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://www.logophile.org/blog/?p=878</guid>
		<description><![CDATA[Recently I&#8217;ve discovered some fun new things about fonts, in LaTeX and under linux. (Yes, it&#8217;s another geek-out post. Sorry mum.) All this stuff can be found online (that&#8217;s where I found it), but it&#8217;s a bit scattered around. And I can&#8217;t remember where any of it is. Summary: XeTeX gives LaTeX access to non-TeX-installed [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve discovered some fun new things about fonts, in LaTeX and under linux. (Yes, it&#8217;s another geek-out post. Sorry mum.) All this stuff can be found online (that&#8217;s where I found it), but it&#8217;s a bit scattered around. And I can&#8217;t remember where any of it is.</p>

<p>Summary:</p>

<ul>
<li><a href="http://scripts.sil.org/xetex">XeTeX</a> gives LaTeX access to non-TeX-installed fonts, and <a href="http://ctan.org/tex-archive/macros/xetex/latex/fontspec/"><code>fontspec</code></a> makes it easy.</li>
<li>XeTeX also lets you write in unicode; <a href="http://ctan.org/tex-archive/macros/latex/exptl/biblatex/"><code>biblatex</code></a> will play nicely if you use <a href="http://ctan.org/tex-archive/biblio/biber/"><code>biber</code></a> instead of <code>bibtex</code> as the backend.</li>
<li><code>fc-list</code> lists installed fonts (giving the names that XeTeX needs).</li>
<li><a href="http://fontforge.sourceforge.net/"><code>fontforge</code></a> will display every glyph in the font, nice and big (and you can print the result).</li>
<li><a href="http://fontmatrix.net/"><code>fontmatrix</code></a> has a <em>very</em> slick interface for font-browsing, from &#8220;tag-this-font&#8221; to &#8220;inspect-this-glyph&#8221;.</li>
<li>All of these except <code>biblatex</code> and <code>biber</code> (which are still in beta) are packaged for various Linux flavours; <code>biblatex</code> installation is easy, for <code>biber</code> I vaguely recall that I installed via CPAN, which is rather a pain. There may be easier alternatives by now though. </li>
</ul>

<p><span id="more-878"></span></p>

<h2>XeTeX lets you use all your fonts in LaTeX</h2>

<p>XeTeX is a TeX replacement; you compile your document with <code>xelatex</code> if you&#8217;ve been using <code>pdflatex</code>, and nothing much changes apart from that. But behind the scenes quite a lot happens; among other things, you get to use the <code>fontspec</code> package, which works with the font names that the rest of your Linux system knows about. (Another, less positive, feature of the move is that you XeTeX is incompatible with <a href="http://ctan.org/tex-archive/macros/latex/contrib/microtype/"><code>microtype</code></a>. Can&#8217;t have everything&#8230;)</p>


<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">documentclass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">article</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">fontspec</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">xunicode</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">xltxtra</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\setmainfont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Mapping=tex-text</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">Verdana</span><span style="color: #E02020; ">}</span></pre></div></div>


<p>If you pick a font with italic and bold alternatives, <code>\textit{}</code> and <code>\textbf{}</code> and so on will just work. Just like that. Which is nice.</p>

<p>If your font has Greek and Russian characters (Greek <em>text</em> characters, not a math alphabet), you can just type &#8216;em:</p>


<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;">Lorem ipsem and so forth; ο ξυπόλητος πρίγκιπας; 
зону большого над, языке а; 
italic: <span style="color: #E02020; ">\</span><span style="color: #800000;">textit</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">in Latin και στα Ελληνικά</span><span style="color: #E02020; ">}</span>,</pre></div></div>


<p>Which is nice.</p>

<p>(I don&#8217;t know what the Russian says, nor do I remember where I got it. The Greek says &#8220;The barefoot prince&#8221; and &#8220;and in Greek&#8221;.)</p>

<p>That <code>Mapping=tex-text</code> says that XeTeX should recognise the old LaTeX style for quotes, long dashes, and so on. But you don&#8217;t have to use it: you can type them directly as unicode characters (which is nice).</p>


<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;">When he goes---``Hello World!''<span style="color: #E02020; ">\\</span>
She replies—“Hello dear!”</pre></div></div>


<p>And if the font you&#8217;re using has fun OpenType features (and that&#8217;s the whole point, right?), you can access them easily too:</p>


<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\fontspec</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Ligatures={<span style="color: #2020C0; font-weight: normal;">Common, Rare</span>}</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">Impact</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\fontsize</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">12pt</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">18pt</span><span style="color: #E02020; ">}</span><span style="color: #800000; font-weight: normal;">\selectfont</span> Questo è strano assai!
<span style="color: #800000; font-weight: normal;">\fontspec</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Numbers={<span style="color: #2020C0; font-weight: normal;">OldStyle</span>}</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">Impact</span><span style="color: #E02020; ">}</span>Old style: 1234567<span style="color: #E02020; ">\\</span>
<span style="color: #800000; font-weight: normal;">\fontspec</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Numbers={<span style="color: #2020C0; font-weight: normal;">Lining</span>}</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">Impact</span><span style="color: #E02020; ">}</span>Lining: 1234567</pre></div></div>


<p>See the <code>fontspec</code> documentation for much, much more. (If your pdf seems to have half its text missing, there&#8217;s something wrong with your pdf rendering library. I don&#8217;t remember what I did to fix this though; possibly just updated, or possibly changed to a different pdf viewer.)</p>

<h2><code>biblatex</code> with <code>biber</code> can handle unicode bibliographies</h2>

<p>So part of the reason I was originally playing around with all this was to help Olga write documents mixing Greek and Latin characters, with both Greek and Latin in the bibliography, with a minimum of hassle. It turns out that <code>bibtex</code> doesn&#8217;t like unicode, in particular it doesn&#8217;t know what to do with Greek. But <code>biber</code>, which is being developed as a backend for the <code>biblatex</code> package, is designed for unicode from the ground up. Both <code>biber</code> and <code>biblatex</code> are beta release software and there are still a few kinks to iron out, but they can already do <em>a lot</em>.</p>

<h2>List installed fonts with <code>fc-list</code></h2>

<p>If you&#8217;re anything like me, the first thing you&#8217;re going to want to do once you see how XeTeX and <code>fontspec</code> work is try out <em>lots</em> of fonts to see what you&#8217;ve got installed that you could use.</p>

<p>If you just want to know names, <code>fc-list</code> is your friend. Be prepared for a lot of output though&#8230;</p>

<p>Here&#8217;s a handy trick: use the <a href="http://ctan.org/tex-archive/graphics/pgf/base/plain/pgf/utilities"><code>pgffor</code></a> package (part of the fantastic graphics package <a href="http://ctan.org/tex-archive/graphics/pgf/"><code>pgf</code></a>) and you don&#8217;t have to constantly retype Lorem ipsem:</p>


<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">pgffor</span><span style="color: #E02020; ">}</span>
...
<span style="color: #800000; font-weight: normal;">\foreach</span> <span style="color: #800000; font-weight: normal;">\f</span> in <span style="color: #E02020; ">{</span>
  Droid Serif,
  Alfios,
  Alexander,
  Dustismo
  ...
  URW Bookman L<span style="color: #2C922C; font-style: italic;">%</span>
<span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">
  <span style="color: #800000; font-weight: normal;">\noindent</span><span style="color: #800000; font-weight: normal;">\setmainfont</span><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\f</span></span><span style="color: #E02020; ">}</span><span style="color: #800000; font-weight: normal;">\f</span>:
  Lorem ipsem and so forth.
  <span style="color: #E02020; ">\</span><span style="color: #800000;">par</span><span style="color: #800000; font-weight: normal;">\medskip</span>
<span style="color: #E02020; ">}</span></pre></div></div>


<h2>Viewing fonts (and individual glyphs) with <code>fontforge</code> and <code>fontmatrix</code></h2>

<p>Somewhere along the line I picked up a free font with heaps of fleurons, and a font of 300 ampersands each by a different designer (yeah, a gimmick, but the proceeds went to charity). For both of these, I wanted a way to see all the glyphs the font contains, large enough to appreciate them as individual characters, and also with the codepoint information so I know how to get access to whichever one I might want to use.</p>

<p>The internet was silent on how to achieve this (or my google-fu was weak), until <a href="http://typophile.com/user/9108">JanekZ</a> helped me out <a href="http://typophile.com/node/69816">on typophile</a>. It seems <a href="http://fontforge.sourceforge.net/"><code>fontforge</code></a> is the only way to get a conveniently-formatted listing of every glyph the font contains (&#8220;Encoding >> Compact&#8221;); it can generate a pdf for printing but the pdf doesn&#8217;t contain codepoint information. But for simply browsing, <a href="http://fontmatrix.net/"><code>fontmatrix</code></a> is a thing of beauty. Unfortunately it seems to be buggy: &#8220;print&#8221; doesn&#8217;t produce any output, and &#8220;view all mapped glyphs&#8221; refuses to scroll. But the stuff that works works beautifully.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logophile.org/blog/2010/04/28/some-notes-on-fonts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>In which I learn things about TeX</title>
		<link>http://www.logophile.org/blog/2009/04/27/in-which-i-learn-things-about-tex/</link>
		<comments>http://www.logophile.org/blog/2009/04/27/in-which-i-learn-things-about-tex/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 13:26:55 +0000</pubDate>
		<dc:creator>tikitu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[(La)TeX]]></category>
		<category><![CDATA[epiphany]]></category>
		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://www.logophile.org/blog/?p=652</guid>
		<description><![CDATA[Apparently a local texmf tree no longer requires the ls-R file. Since how long, I know not, nor care I particularly. Nor expect I you to care, particularly, but I was tickled by it. Yet another piece of obscurity and complication getting slightly simpler in the LaTeX world. (Thanks to Micha &#8212; I discovered this [...]]]></description>
			<content:encoded><![CDATA[<p>Apparently a local texmf tree no longer requires the <code>ls-R</code> file. Since how long, I know not, nor care I particularly. Nor expect I you to care, particularly, but I was tickled by it. Yet another piece of obscurity and complication getting slightly simpler in the LaTeX world.</p>

<p>(Thanks to Micha &#8212; I discovered this while helping him tidy up his texmf tree. And yes, I guess this is less down to (La)TeX and more down to my distribution, details jargon technicalities disclaimer.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logophile.org/blog/2009/04/27/in-which-i-learn-things-about-tex/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Pdf shuffling in LaTeX</title>
		<link>http://www.logophile.org/blog/2009/04/08/pdf-shuffling-in-latex/</link>
		<comments>http://www.logophile.org/blog/2009/04/08/pdf-shuffling-in-latex/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 13:08:40 +0000</pubDate>
		<dc:creator>tikitu</dc:creator>
				<category><![CDATA[opinion]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[(La)TeX]]></category>
		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://www.logophile.org/blog/?p=626</guid>
		<description><![CDATA[Pdfpages is a LaTeX package that lets you drop individual pages of other pdfs into your LaTeX documents. Put it together with the \foreach command provided by pgf/TikZ, and you can get quite a bit done very simply. For instance, you can scan in somebody&#8217;s photocopy of a paper from 1978 using the office printer, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=pdfpages">Pdfpages</a> is a LaTeX package that lets you drop individual pages of other pdfs into your LaTeX documents. Put it together with the <code>\foreach</code> command provided by <a href="http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=pgf">pgf</a>/<a href="http://pgf.sourceforge.net/">TikZ</a>, and you can get quite a bit done very simply.</p>

<p>For instance, you can scan in somebody&#8217;s photocopy of a paper from 1978 using the office printer, which emails you a pdf of the scan, and run it through this file to get a single page of the original on each page of the pdf:</p>


<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">documentclass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">article</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">pgffor</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">pdfpages</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #2C922C; font-style: italic;">% Paper starts on a right-hand page of the original book,</span>
<span style="color: #2C922C; font-style: italic;">% we don't need the final page of the paper before it.</span>
<span style="color: #800000; font-weight: normal;">\includepdf</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">pages=1,
            angle=90,
            trim=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">0 0 0 135mm</span>}
            </span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">Kamp78SemanticsVersusPragmatics.pdf</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #2C922C; font-style: italic;">% For each double-page spread, rip out the left hand then</span>
<span style="color: #2C922C; font-style: italic;">% the right hand side. The trim was set by eye.</span>
<span style="color: #800000; font-weight: normal;">\foreach</span> <span style="color: #800000; font-weight: normal;">\page</span> in <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">2,...,17</span><span style="color: #E02020; ">}</span> <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">
  <span style="color: #800000; font-weight: normal;">\includepdf</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">pages=<span style="color: #800000; font-weight: normal;">\page</span>,
              angle=90,
              trim={0 135mm 0 0</span>}
              </span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">Kamp78SemanticsVersusPragmatics.pdf</span><span style="color: #E02020; ">}</span>
  <span style="color: #800000; font-weight: normal;">\includepdf</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">pages=<span style="color: #800000; font-weight: normal;">\page</span>,
              angle=90,
              trim=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">0 0 0 135mm</span>}
              </span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">Kamp78SemanticsVersusPragmatics.pdf</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span></pre></div></div>


<p>(This also gives me a chance to <del datetime="2009-04-08T13:06:29+00:00">show off</del> try out my new <a href="http://wordpress.org/extend/plugins/wp-syntax/">code-formatting</a> plugin. Pretty!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logophile.org/blog/2009/04/08/pdf-shuffling-in-latex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClassicThesis LaTeX style</title>
		<link>http://www.logophile.org/blog/2008/11/28/classicthesis-latex-style/</link>
		<comments>http://www.logophile.org/blog/2008/11/28/classicthesis-latex-style/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 12:14:04 +0000</pubDate>
		<dc:creator>tikitu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[(La)TeX]]></category>
		<category><![CDATA[beautiful]]></category>
		<category><![CDATA[PhD]]></category>

		<guid isPermaLink="false">http://www.logophile.org/blog/?p=524</guid>
		<description><![CDATA[Andr&#233; Miede&#8217;s Classic Thesis LaTeX style is a thing of beauty. Things to like about it: It&#8217;s damn elegant. It&#8217;s inspired by Bringhurst&#8217;s The Elements of Typographic Style, which remains the most eloquent and convincing argument for attention to typography I&#8217;ve ever read. Namecheck of the booktabs documentation (on why the tables don&#8217;t have vertical [...]]]></description>
			<content:encoded><![CDATA[<p>Andr&eacute; Miede&#8217;s <a href="http://ctan.org/tex-archive/macros/latex/contrib/classicthesis/">Classic Thesis LaTeX style</a> is a thing of beauty.</p>

<p>Things to like about it:</p>

<ul>
<li>It&#8217;s <em>damn</em> elegant.</li>
<li>It&#8217;s inspired by Bringhurst&#8217;s <a href="http://www.librarything.com/work/2143"><em>The Elements of Typographic Style</em></a>, which remains the most eloquent and convincing argument for attention to typography I&#8217;ve ever read.</li>
<li>Namecheck of the <a href="http://ctan.org/tex-archive/macros/latex/contrib/booktabs/">booktabs</a> documentation (on why the tables don&#8217;t have vertical lines), which I&#8217;ve also <a href="http://www.logophile.org/LaTeX/EssentialDocs#toc1">tried to promote</a>.</li>
<li>&#8220;And no: the lines are not too short.&#8221;</li>
<li>Sidenotes. (And footnotes. But sidenotes. Lovely.)</li>
<li>The author wants postcards. And asks that you send complaints/suggestions/questions on the postcards, not by email. Nice filter.</li>
</ul>

<p>There&#8217;s also the <a href="http://ctan.org/tex-archive/macros/latex/contrib/arsclassica/">Ars Classica</a> package, which patches ClassicThesis for a slightly different look. That&#8217;s all in Italian, but the code is almost readable anyway (much more LaTeX than TeX) which is encouraging for the prospect of coming up with a patch myself.</p>

<p>Reckon I&#8217;ll be <a href="http://postcards.miede.de/">sending a postcard</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logophile.org/blog/2008/11/28/classicthesis-latex-style/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>LeGO talk: slides, how-to</title>
		<link>http://www.logophile.org/blog/2008/10/29/lego-talk-slides-how-to/</link>
		<comments>http://www.logophile.org/blog/2008/10/29/lego-talk-slides-how-to/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 14:38:44 +0000</pubDate>
		<dc:creator>tikitu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[(La)TeX]]></category>
		<category><![CDATA[PhD]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.logophile.org/blog/?p=483</guid>
		<description><![CDATA[I&#8217;ve posted the slides (3.1M download!) to my LeGO talk, on my publications page. A bit about how and why, and some technical questions maybe the laziweb will answer for me, after the gap. I don&#8217;t usually do this, since my talks tend to rely a lot on &#8230; well, talking. The slides without the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve posted the <a href="http://www.logophile.org/pmwiki/uploads/Academic/LeGO-10-08-slides-vert.pdf">slides</a> (3.1M download!) to my LeGO talk, on my <a href="http://www.logophile.org/Academic/Publications">publications page</a>. A bit about how and why, and some technical questions maybe the laziweb will answer for me, after the gap.</p>

<p><span id="more-483"></span></p>

<p>I don&#8217;t usually do this, since my talks tend to rely a lot on &#8230; well, talking. The slides without the patter can vary between cryptic, irrelevant, and just plain wrong. (I quite enjoy letting the audience absorb some choice piece of wisdom on a slide then saying &#8220;This isn&#8217;t true.&#8221;) This time I&#8217;ve taken the trouble to add notes to each slide, explaining what I had to say and why I wanted to say it. (I&#8217;ve incorporated a bit of the discussion as well, but resisted the temptation to improve things with the benefit of hindsight.)</p>

<p>For others interested in how to do this, Beamer has a <code>\note{}</code> macro. If you issue it in a frame, its contents get collected into a notes &#8220;slide&#8221; that comes after the frame (it does the right thing with frames containing transitions: every transition semi-frame gets the same notes slide, so the notes stay the same while the frame changes). Do this for every frame and you get an alternating sequence frame/notes/frame/notes&#8230; The next thing to do is put each frame/notes pair on a single page. I couldn&#8217;t find a tidy (and free) way to do this, so I got my officemate to print-to-pdf on his Mac, which did the job. (That&#8217;s why the notes are <em>under</em> the slides, not beside: we couldn&#8217;t figure out the options that would do it the other way.)</p>

<p>Some questions for the laziweb:</p>

<ol>
<li>Any good pdf manipulation programs, free for linux? For (for example) arranging several consecutive pages onto one page (like you can do with <code>pstops</code>).</li>
<li>How does the over-and-under positioning work (if anyone is actually reading the slides, that is) for you? I have a weird screen ratio that makes it perfect (I lie my screen on its side, for comfortably reading a4 pages), but I guess it&#8217;s less handy in 800&#215;600. Do I need to worry excessively about this?</li>
<li>Beamer produces really <em>big</em> pdfs &#8212; 3.1M for that presentation. Any tips on cutting them down to size would be great.</li>
<li>I couldn&#8217;t seem to get beamer to make the notes slides plain, despite following what I thought were the instructions in the manual. Has anyone made this work, and if so how?</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.logophile.org/blog/2008/10/29/lego-talk-slides-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thesis-writing in LaTeX</title>
		<link>http://www.logophile.org/blog/2008/08/22/thesis-writing-in-latex/</link>
		<comments>http://www.logophile.org/blog/2008/08/22/thesis-writing-in-latex/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 11:35:46 +0000</pubDate>
		<dc:creator>tikitu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[(La)TeX]]></category>
		<category><![CDATA[PhD]]></category>

		<guid isPermaLink="false">http://www.logophile.org/blog/?p=436</guid>
		<description><![CDATA[I&#8217;ve spent a bit of time organising my LaTeX setup for maximal dissertatory efficiency. Mainly I want a system that lets me put definitions somewhere sensible (a thesis.sty package), but also makes it easy to typeset chapters individually to hand around, without duplicating definitions or having to hand-edit files for book or single-chapter output. I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent a bit of time organising my LaTeX setup for maximal dissertatory efficiency. Mainly I want a system that lets me put definitions somewhere sensible (a thesis.sty package), but also makes it easy to typeset chapters individually to hand around, without duplicating definitions or having to hand-edit files for book or single-chapter output.</p>

<p>I&#8217;ve got a basic system that works pretty well, and now it has <a href="/LaTeX/MyThesisSetup">its own page on my site</a>. Any suggestions would be welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logophile.org/blog/2008/08/22/thesis-writing-in-latex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New TeX distribution</title>
		<link>http://www.logophile.org/blog/2007/06/06/new-tex-distribution/</link>
		<comments>http://www.logophile.org/blog/2007/06/06/new-tex-distribution/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 12:36:14 +0000</pubDate>
		<dc:creator>tikitu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[(La)TeX]]></category>

		<guid isPermaLink="false">http://www.logophile.org/blog/?p=273</guid>
		<description><![CDATA[Shipping even as we speak, your favourite typesetting engine now has wheels: Snapped from the train on the way back from Paris. I guess I&#8217;ll post photos of that trip at some point too.]]></description>
			<content:encoded><![CDATA[<p>Shipping even as we speak, your favourite typesetting engine now has <i>wheels</i>:</p>

<p><a href='http://www.logophile.org/blog/wp-content/uploads/2007/06/tex-small.jpg' title='TeX truck'><img class="center" src='http://www.logophile.org/blog/wp-content/uploads/2007/06/tex-small.jpg' alt='TeX truck' /></a></p>

<p>Snapped from the train on the way back from Paris. I guess I&#8217;ll post photos of that trip at some point too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logophile.org/blog/2007/06/06/new-tex-distribution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaTeX math mode and italics</title>
		<link>http://www.logophile.org/blog/2006/09/05/latex-math-mode-and-italics/</link>
		<comments>http://www.logophile.org/blog/2006/09/05/latex-math-mode-and-italics/#comments</comments>
		<pubDate>Tue, 05 Sep 2006 11:51:43 +0000</pubDate>
		<dc:creator>tikitu</dc:creator>
				<category><![CDATA[(La)TeX]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://www.logophile.org/blog/?p=208</guid>
		<description><![CDATA[It&#8217;s an awfully simple rule: Don&#8217;t put words (of more than one letter) in pure math mode. This should be carved into the monitor of every mathematician and (particularly) computer scientist who ever wrote a paper in LaTeX. Don&#8217;t use math mode for words. Don&#8217;t (don&#8217;t you dare) use math mode for italics. Why not? [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s an awfully simple rule: <b>Don&#8217;t put words (of more than one letter) in pure math mode.</b> This should be carved into the monitor of every mathematician and (particularly) computer scientist who ever wrote a paper in LaTeX. Don&#8217;t use math mode for words. Don&#8217;t (don&#8217;t you <em>dare</em>) use math mode for italics.</p>

<h3>Why not?</h3>

<p>The spacing is wrong. It&#8217;s usually only slightly, subtly wrong. But around an &#8216;f&#8217;, it&#8217;s grotesque. The reason is that in math mode TeX assumes individual letters represent individual variables, so it doesn&#8217;t use the kerning information that would otherwise tell it to close up the spacing around the &#8216;f&#8217;, since its ascender and descender stick out sideways. This behaviour is fine if the &#8216;f&#8217; is a function variable, but it doesn&#8217;t work in &#8216;infold&#8217;, for instance.</p>

<h3>Aren&#8217;t you being a bit picky?</h3>

<p>Nope. I have in front of me page 307 of <a href="http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/">Type Theory &amp; Functional Programming</a>, which contains a function definition beginning <em>in f old f st</em>&#8230; or possible <em>inf old f st</em>, or (as in fact intended) <em>infold f st</em>, where <em>infold</em> is the function name, <em>f</em> is a function argument, and <em>st</em> is a state argument. The link takes you to an online PDF copy, go check it out. I&#8217;ll wait.</p>

<p>See it? If you look closely you might notice some weird spacing on the right-hand-side also &#8212; it <em>would</em> be truly picky to call that out, but the oddity on the left really interferes with the interpretation. (Why that page? It happened to come out on top of a signature as I was folding the book up for binding. And 307 is a nice number, don&#8217;t you think?)</p>

<h3>What should it look like then?</h3>

<p>Simple answer: use <code>\mathit{}</code> and <code>\mathrm{}</code> to get properly spaced <em>words</em>, italicised or roman, in math mode. (Thanks Tom for the <b>r</b>e<b>m</b>inder.)</p>

<p>Slightly more complicated and pedantic answer: it&#8217;s worth carefully considering whether you need italics at all. Traditionally these are used for <em>variable</em> quantities or entities; a function variable <em>f</em> which can take many values, a state variable <em>st</em> likewise (although I&#8217;d prefer <em>s</em>), and so on. It&#8217;s flatout wrong to use italics for well-known functions like sine and cosine, which is why LaTeX provides primitives <code>\sin</code> and <code>\cos</code> which typeset these in upright roman. So if you&#8217;re defining a function &#8220;infold&#8221;, which will always have the same definition, it might make sense to put that in roman too. Another case which crops up often (in the same line of TT&amp;FP, for instance) is an equality symbol subscripted with &#8216;df&#8217; or &#8216;def&#8217; or similar, for &#8220;definitional&#8221;. Here there&#8217;s really no reason to use italics at all, and of course the spacing is again messed up by the &#8216;f&#8217;.</p>

<p>All right, now I <em>am</em> being picky.</p>

<h3>Can I go now?</h3>

<p>Yes yes, run along.</p>

<p>Oh, one more thing. I don&#8217;t mean to pick on Simon Thompson, who after all has written a textbook that I just downloaded and printed and expect to learn quite a lot from. I use that example because it shows that it&#8217;s not just students writing term papers who do this stuff, it crops up also in books with editors, that get published and that people pay money for. And it&#8217;s so <em>easy</em> to avoid, once you know there&#8217;s a problem. So do try, please? You&#8217;ll do wonders for my blood pressure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logophile.org/blog/2006/09/05/latex-math-mode-and-italics/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

