<?xml version="1.0" encoding="iso-8859-1"?>
<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>[Lowerbounds, Upperbounds] &#187; Electronic Documents</title>
	<atom:link href="http://magic.aladdin.cs.cmu.edu/category/software-tools/electronic-documents/feed/" rel="self" type="application/rss+xml" />
	<link>http://magic.aladdin.cs.cmu.edu</link>
	<description>Algorithms are everywhere.</description>
	<lastBuildDate>Tue, 23 Dec 2008 19:58:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9-rare</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SumatraPDF 0.8 Released</title>
		<link>http://magic.aladdin.cs.cmu.edu/2008/01/02/sumatrapdf-08-released/</link>
		<comments>http://magic.aladdin.cs.cmu.edu/2008/01/02/sumatrapdf-08-released/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 18:01:57 +0000</pubDate>
		<dc:creator>Maverick Woo</dc:creator>
				<category><![CDATA[Electronic Documents]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://magic.aladdin.cs.cmu.edu/?p=433</guid>
		<description><![CDATA[SumatraPDF has just become a very strong contender as an everyday PDF viewer on Windows. The reason: it finally supports searching and bookmarks in version 0.8.
Its interface is still a bit over simplistic, but it&#8217;s already quite good for everyday uses. At the moment, the keyboard shortcuts are not very well-documented. Looking at the source [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.kowalczyk.info/software/sumatrapdf/index.html">SumatraPDF</a> has just become a very strong contender as an everyday PDF viewer on Windows. The reason: it finally supports searching and bookmarks in version 0.8.</p>
<p>Its interface is still a bit over simplistic, but it&#8217;s already quite good for everyday uses. At the moment, the <a href="http://blog.kowalczyk.info/software/sumatrapdf/manual.html">keyboard shortcuts</a> are not very well-documented. Looking at the source code, I noticed some missing entries that are noteworthy:</p>
<ul>
<li>The search interface: <code>/</code> starts a search, so as <code>Ctrl-F</code>. <code>Ctrl-G</code> and <code>F3</code> is next, and <code>Shift-F3</code> is previous. Note that the toolbar doesn&#8217;t have to be visible for the search keys to work.</li>
<li><code>Ctrl-L</code> toggles full screen mode.</li>
<li><code>F12</code> toggles the bookmark panel.</li>
</ul>
<p>(<strong>Update:</strong> Also note that Ctrl-Drag will select a region and copy its text to clipboard.)</p>
<p>I don&#8217;t have a list of the numerous PDF viewers on Windows here: a <a href="http://www.google.com/search?q=pdf+viewer+windows">google search</a> will get you many hits. Personally, I have &#8220;switched&#8221; to SumatraPDF on my browsers a few months ago, while spending most of my &#8220;PDF time&#8221; in PDF-XChange Viewer (<a href="http://magic.aladdin.cs.cmu.edu/2007/10/21/free-pdf-annotation-softwares/">see this post</a> about its annotation capability).</p>
<p>I still keep Adobe Reader 8 as the default PDF handler: in terms of printing, anti-aliasing and javascript support, I have yet to see any competition to Adobe. However, now that PDF is <a href="http://blogs.adobe.com/insidepdf/2007/12/iso_ballot_for_pdf_17_passed.html">in the process of becoming an ISO standard</a> and FSF is declaring the <a href="http://www.gnupdf.org/">GNU PDF project</a> as one of the few <a href="http://www.fsf.org/campaigns/priority.html">high priority projects</a>, hopefully we will see some change in a few years (see <a href="http://www.linux.com/feature/122195">this linux.com article</a>).</p>
<p>I should note that SumatraPDF 0.8 is still missing hyperlink support. Also, none of Windows PDF viewers seems to support <a href="http://itexmac.sourceforge.net/pdfsync.html">pdfsync</a> (round-tripping between PDF and TeX source). I know the former is being worked on. The latter, hmm&#8230;</p>
<p>P.S. Common PDF viewers on Windows also include Ghostview and Foxit Reader.</p>
]]></content:encoded>
			<wfw:commentRss>http://magic.aladdin.cs.cmu.edu/2008/01/02/sumatrapdf-08-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Protect Your Email Address in PS and PDF</title>
		<link>http://magic.aladdin.cs.cmu.edu/2007/12/09/protect-your-email-address-in-ps-and-pdf/</link>
		<comments>http://magic.aladdin.cs.cmu.edu/2007/12/09/protect-your-email-address-in-ps-and-pdf/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 16:49:01 +0000</pubDate>
		<dc:creator>Maverick Woo</dc:creator>
				<category><![CDATA[Electronic Documents]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://magic.aladdin.cs.cmu.edu/?p=468</guid>
		<description><![CDATA[The randtext package is a great random find in CTAN. Here is its description in full, but with an emphasis added by me:
The package provides a single macro \randomize{TEXT} that typesets the characters of TEXT in random order, such that the resulting output appears correct, but most automated attempts to read the file will misunderstand [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.ctan.org/tex-archive/help/Catalogue/entries/randtext.html">randtext</a> package is a great random find in CTAN. Here is its description in full, but with an emphasis added by me:</p>
<blockquote><p>The package provides a single macro \randomize{TEXT} that typesets the characters of TEXT in random order, such that the resulting output appears correct, but <em>most</em> automated attempts to read the file will misunderstand it. </p>
<p>This function allows one to include an email address in a TeX document and publish it online without fear of email address harvesters or spammers easily picking up the address.</p>
<p>The author is Charles Duan.</p></blockquote>
<p>While you most certainly want to use this package for some protection, you should not rely solely on it. For a historical reason(*) , Adobe&#8217;s PDF library can easily extract an email address protected by this package. I don&#8217;t know about the top search engines, but I would expect their extractors to perform no worse.</p>
<p>(*) Basically, space characters need not exist after the TeX phase. They may instead exist as kerning and spacing information. Therefore, Adobe have an extraction routine that guesses the word breaks based on how the characters are spaced. In other words, the routine is literally &#8220;reading&#8221; the text from the rendering, just like any human!</p>
]]></content:encoded>
			<wfw:commentRss>http://magic.aladdin.cs.cmu.edu/2007/12/09/protect-your-email-address-in-ps-and-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing PDF Margins With The pdfpages Package</title>
		<link>http://magic.aladdin.cs.cmu.edu/2007/11/13/changing-pdf-margins-with-the-pdfpages-package/</link>
		<comments>http://magic.aladdin.cs.cmu.edu/2007/11/13/changing-pdf-margins-with-the-pdfpages-package/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 03:22:40 +0000</pubDate>
		<dc:creator>Maverick Woo</dc:creator>
				<category><![CDATA[Electronic Documents]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://magic.aladdin.cs.cmu.edu/?p=145</guid>
		<description><![CDATA[Sometimes I am given a PDF and I wish I could change its margins. For example, when I print out a conference version of a paper to study in detail, usually there isn&#8217;t much space on the sides to write my own ideas. I heard Fermat had a solution for this type of issue  [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I am given a PDF and I wish I could change its margins. For example, when I print out a conference version of a paper to study in detail, usually there isn&#8217;t much space on the sides to write my own ideas. I heard Fermat had a solution for this type of issue <img src='http://magic.aladdin.cs.cmu.edu/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> , but in the modern days, I use sticky notes. The same situation surprisingly arises even if you use PDF annotating softwares. <a href="http://magic.aladdin.cs.cmu.edu/2007/10/21/free-pdf-annotation-softwares/">Free</a> or not free (no link for them), they simply do not support the &#8220;enlarge canvas&#8221; feature yet. All you can do is to insert electronic sticky notes. So much for the metaphor!</p>
<p>Now there is actually a technology called &#8220;reflowable PDFs&#8221;, which are PDFs that contain enough information to support reflowing its content to fit any width. You can see <a href="http://www.adobe.com/uk/epaper/tips/acr5reflow/">this page</a> for a screenshot of a reflowed document. Reflowing works wonder for text-dominant documents like novels, but the PDF has to be specially prepared for reflowing to really work well. (Try View->Zoom->Reflow in Adobe Reader 8.)</p>
<p>But if the given PDF is not reflowable, we can still use some graphics editor and edit the PDF interactively. After all, a PDF is mostly a vector graphics file, modulo some potential embedded bitmaps, and so you can edit it like any vector graphics file. I&#8217;ve seen it done in Illustrator, and I guess some of the free software competitors like <a href="http://www.inkscape.org/">Inkscape</a> or <a href="http://www.scribus.net/">Scribus</a> can do this kind of editing too. But using a command line tool would be far easier.</p>
<p>For a long while, I actually know how to change the margins of a PDF. (Turns out <a href="http://blogs.adobe.com/acrolaw/2006/01/how_do_i_shrink.html">lawyers</a> have essentially the same problem.) The trick is to use the <a href="http://www.ctan.org/tex-archive/macros/latex/contrib/pdfpages/"><code>pdfpages</code></a> package with pdfLaTeX. You may recall that this package allows us to include specific pages of a PDF into our own document. Magically, it has a <code>scale</code> option (that is really inherited from <code>graphicx</code>)&#8230; This gives us the first batch file: <a href="/wp-uploads/pdf-rescale.bat">pdf-rescale.bat</a>. Execute</p>
<blockquote><p><code>pdf-rescale.bat foo.pdf 0.8</code></p></blockquote>
<p>and you will get <code>foo-0.8.pdf</code>, which is <code>foo.pdf</code> shrunk to 80%. I&#8217;ve found that 80% is a good default and so the third argument is actually optional. You can also specify a scale of larger than 1 for some journal articles formatted for smaller paper sizes. I can also imagine fancier applications in which you combine this idea with the <code>geometry</code> package (see <a href="http://magic.aladdin.cs.cmu.edu/2005/08/25/setting-margin-in-latex/">this post</a>) to control of the final outcome.</p>
<p>But since we are not changing the actual size of the paper, shrinking the content for a larger margin actually means, well, shrunk content. Conference proceedings are already typeset in a small enough font. Since the proceedings are in two columns, I had the idea to print each column on its own page. That will definitely give us ample space. After a lot of different attempts since last year, I finally managed to get the second batch file: <a href="/wp-uploads/pdf-1c.bat">pdf-1c.bat</a>. Execute</p>
<blockquote><p><code>pdf-1c.bat foo.pdf</code></p></blockquote>
<p>and you will get <code>foo-1c.pdf</code>, which is <code>foo.pdf</code> but with one column per page. No kidding.</p>
<p>The following PNG illustrates these scripts using the title page of an old paper. The upper-left shows the original, and the upper-right is after shrinking to 80%. The lower-left and lower-right are the two pages from the one-column version. I have also attached the <a href="/wp-uploads/pdf-montage-src.pdf">source PDF</a> from which I generated the PNG. The key feature is that this PDF retains the text of the original&#8212;try search for the word &#8220;degree&#8221; and you will see. (At one point my solution was to assemble a bunch of PNGs representing each single column into a huge PDF. Although you can annotate on it electronically, you cannot search in it. It also prints slowly.)</p>
<p><img src='/wp-uploads/pdf-montage-400.png' /></p>
<p>Finally, I also note that it is in fact possible to prepare reflowable PDFs using pdfLaTeX or dvipdfm (there seems to be trouble if going through a PS), but I will save it for a later story. For now, you can experience reflowing a LaTeX PDF with <a href="http://www.tug.org/pracjourn/2007-2/robbers/robbers.pdf">this PracTeX article</a>, which is actually on the use of the <code>pdfpages</code> package. Having played with reflowing for a while, I would say that the real deal-breaker for reflowable PDFs lies in the mathematical expressions. You can see <a href="www.tug.org/TUGboat/Articles/tb22-4/tb72perlS.pdf">this TUGboat article</a> for some excellent macros on fine-tuning mathematical expressions. Now, try to reflow it&#8230; <img src='http://magic.aladdin.cs.cmu.edu/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>P.S. If you write the corresponding bash scripts, please send them to me so that I can, with full acknowledgement, post them here. The only reason why I stick to batch files is to avoid extra dependencies. </p>
<p><strong>Change PDF Margin Scripts</strong>: <a href="/wp-uploads/pdf-rescale.bat">pdf-rescale.bat</a> <a href="/wp-uploads/pdf-1c.bat">pdf-1c.bat</a></p>
<p><strong>Update</strong>: Joshua Dunfield has ported the rescaling script to Linux. See the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://magic.aladdin.cs.cmu.edu/2007/11/13/changing-pdf-margins-with-the-pdfpages-package/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Free PDF Annotation Softwares</title>
		<link>http://magic.aladdin.cs.cmu.edu/2007/10/21/free-pdf-annotation-softwares/</link>
		<comments>http://magic.aladdin.cs.cmu.edu/2007/10/21/free-pdf-annotation-softwares/#comments</comments>
		<pubDate>Sun, 21 Oct 2007 18:25:20 +0000</pubDate>
		<dc:creator>Maverick Woo</dc:creator>
				<category><![CDATA[Electronic Documents]]></category>

		<guid isPermaLink="false">http://magic.aladdin.cs.cmu.edu/?p=429</guid>
		<description><![CDATA[Given the amount of documents that I deal with, I&#8217;ve had many opportunities to save paper if only I could annotating on a PDF directly. Until recently, Jarnal has been the only free solution on Windows. However, I would say that Jarnal is not exactly the most polished piece of software I have used&#8230; (But [...]]]></description>
			<content:encoded><![CDATA[<p>Given the amount of documents that I deal with, I&#8217;ve had many opportunities to save paper if only I could annotating on a PDF directly. Until recently, <a href="http://www.dklevine.com/general/software/tc1000/jarnal.htm">Jarnal</a> has been the only free solution on Windows. However, I would say that Jarnal is not exactly the most polished piece of software I have used&#8230; (But I am not complaining against its price.)</p>
<p>Well, Jarnal has some serious competition now. <a href="http://www.docu-track.com/home/prod_user/pdfx_viewer/">PDF-XChange Viewer</a> is a free (as in beer) PDF viewer that supports a full suite of native PDF annotation capabilities. By &#8220;native&#8221;, I mean if you insert a &#8220;sticky note&#8221; comment into the PDF, it shows up as a sticky note in Adobe Reader and so you can open, close and move the note, just like the stickies created by Acrobat Professional. In comparison, the interface is not very customizable and the keyboard shortcuts are not quite &#8220;there&#8221; yet, but it is certainly looking very good for a version-1 product. The font rendering is not as good as well, but it is comparable to other free solutions. Its performance on graphics intensive PDF is very good on too! There is even a button that allows you to quickly open the current PDF using Adobe Reader, just in case.</p>
<p>I wish it has better ink support, but again, I am not complaining against its price. <img src='http://magic.aladdin.cs.cmu.edu/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>P.S. Not that I really want to destroy any sales, but I note that <a href="http://sourceforge.net/projects/pdfcreator/">PDFCreator</a> is a very good Distiller replacement. Together with PDF-XChange Viewer, they cover most of my PDF needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://magic.aladdin.cs.cmu.edu/2007/10/21/free-pdf-annotation-softwares/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PrimoPDF</title>
		<link>http://magic.aladdin.cs.cmu.edu/2006/06/29/primopdf/</link>
		<comments>http://magic.aladdin.cs.cmu.edu/2006/06/29/primopdf/#comments</comments>
		<pubDate>Thu, 29 Jun 2006 19:56:54 +0000</pubDate>
		<dc:creator>Maverick Woo</dc:creator>
				<category><![CDATA[Electronic Documents]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://magic.aladdin.cs.cmu.edu/?p=329</guid>
		<description><![CDATA[In the past, I used to manually set up the tool chain for PDF production on Windows.
Basically, this requires the installation of Ghostscript and a PS printer driver that prints to a RedMon port. The trick is to configure the PS printer driver so that it embeds Type 42 fonts. And I also need to [...]]]></description>
			<content:encoded><![CDATA[<p>In the past, I used to manually set up the tool chain for PDF production on Windows.</p>
<p>Basically, this requires the installation of <a href="http://www.ghostscript.com/">Ghostscript</a> and a PS printer driver that prints to a <a href="http://www.cs.wisc.edu/~ghost/redmon/">RedMon</a> port. The trick is to configure the PS printer driver so that it embeds Type 42 fonts. And I also need to have <a href="http://www.accesspdf.com/pdftk/">pdftk</a> to set the document security and then stuff&#8230; </p>
<p>Well, that was indeed the past. <img src='http://magic.aladdin.cs.cmu.edu/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  These days I get lazy and just use the free (as in beer) product <a href="http://www.primopdf.com/">PrimoPDF</a>. So far, I find it does everything right, but I still manually remove the Ghostscript 8.50 that is bundled in its installer (remove the gs subdirectory) and let it use the most current version on my computer.</p>
<p>Combined with the ability to <a href="http://magic.aladdin.cs.cmu.edu/2005/07/02/splitting-and-joining-pdfs-by-pdftk/">split and join PDFs using pdftk</a>, that&#8217;s a pretty good basic setup for everyday PDF production at a low low cost of zero dollars. I am all thankful!</p>
<p><strong>Update:</strong> Many of you reminded me that I should really mention <a href="http://sourceforge.net/projects/pdfcreator/">PDFCreator</a> in this post as well. I agree. Both of them are great!</p>
]]></content:encoded>
			<wfw:commentRss>http://magic.aladdin.cs.cmu.edu/2006/06/29/primopdf/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>LaTeX Source Specials</title>
		<link>http://magic.aladdin.cs.cmu.edu/2006/06/07/latex-source-specials/</link>
		<comments>http://magic.aladdin.cs.cmu.edu/2006/06/07/latex-source-specials/#comments</comments>
		<pubDate>Wed, 07 Jun 2006 19:38:04 +0000</pubDate>
		<dc:creator>Maverick Woo</dc:creator>
				<category><![CDATA[Electronic Documents]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Text Editing]]></category>

		<guid isPermaLink="false">http://magic.aladdin.cs.cmu.edu/?p=147</guid>
		<description><![CDATA[As I have hinted in this post about pdfopen, it is possible to do some sort of round-trip LaTeX editing with the right tools. There are two directions to make the round-trip complete.
The forward jump is editor-to-previewer: given the current cursor location in the editor, jump to the corresponding paragraph in the previewer. The backward [...]]]></description>
			<content:encoded><![CDATA[<p>As I have hinted in <a href="http://magic.aladdin.cs.cmu.edu/2005/07/15/pdfopen-and-pdfclose/">this post about pdfopen</a>, it is possible to do some sort of round-trip LaTeX editing with the right tools. There are two directions to make the round-trip complete.</p>
<p>The forward jump is editor-to-previewer: given the current cursor location in the editor, jump to the corresponding paragraph in the previewer. The backward jump is symmetrical. The magic behind this is called &#8220;source specials&#8221;.</p>
<p>While it sounds somewhat like a Chinese dish with special sauces, it really isn&#8217;t. <img src='http://magic.aladdin.cs.cmu.edu/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />   Instead, when you generate the DVI file, you ask <code>latex</code> to tag the DVI file with &#8220;source specials&#8221;. Imagine each word in the DVI file is tagged with the source filename and the line number of the word. </p>
<p>The forward jump is to ask the previewer to display the location that is right after the editor&#8217;s cursor location (filename and line number). The backward jump is to ask the editor to put the cursor closest to the current location in the previewer (usually the location of a double-click). </p>
<p>Let&#8217;s get to the example. I will show how to get round-tripping to work in Windows using <a href="http://www.miktex.org/">MiKTeX</a> distribution 2.4 and <a href="http://www.gnu.org/software/emacs/windows/ntemacs.html">GNU Emacs</a>. Other configurations are similar.</p>
<p>(Round-tripping between LaTeX and PDF is similar <em>in principle</em>, but the tools are not very mature yet. I will save this for a later post.)</p>
<ul>
<li>Install the <a href="http://www.gnu.org/software/auctex/">AUC TeX</a> package into Emacs.</li>
<li>To enable tagging in <code>latex</code>, invoke it with the <code>--src-specials</code> option. Say the primary LaTeX source is <code>main.tex</code>, AUC TeX invokes it this way, :<br />
<blockquote><code>latex --src-specials \nonstopmode\input{main.tex}</code></p></blockquote>
</li>
<li>To do the forward jump with YAP (the DVI previewer in MiKTeX), say when the cursor is on line 65 of <code>hetero.tex</code>, AUC TeX will execute:<br />
<blockquote><code>yap -1 -s65hetero.tex main.dvi</code></p></blockquote>
</li>
<li>To enable the backward search, install the <code>gnuserv</code> package. Google can help you locate many links, like <a href="http://www.weitz.de/win/">this</a> and the rest.</li>
<li>Assuming you have <code>gnuclientw</code> installed on your path, in YAP, go to View->Options->Inverse Search. Inside Program combo, you should see &#8220;GNU Emacs (Single Instance)&#8221;. Example command line:<br />
<blockquote><code>gnuclientw.exe -F +%l "%f"</code></p></blockquote>
</li>
<li>Note that installing <code>gnuclientw</code> addresses the problem in <a href="http://magic.aladdin.cs.cmu.edu/2005/07/15/pdfopen-and-pdfclose/#comment-419">this comment</a>.  In general, you rarely want to invoke <code>emacs</code> directly. Use <code>gnuclientw</code> instead.</li>
</ul>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://magic.aladdin.cs.cmu.edu/2006/06/07/latex-source-specials/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Mathematical Illustrations</title>
		<link>http://magic.aladdin.cs.cmu.edu/2005/08/18/mathematical-illustrations/</link>
		<comments>http://magic.aladdin.cs.cmu.edu/2005/08/18/mathematical-illustrations/#comments</comments>
		<pubDate>Thu, 18 Aug 2005 04:42:01 +0000</pubDate>
		<dc:creator>Maverick Woo</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Electronic Documents]]></category>
		<category><![CDATA[Geometry]]></category>

		<guid isPermaLink="false">http://magic.aladdin.cs.cmu.edu/?p=153</guid>
		<description><![CDATA[As a manual of geometry and Postscript, the beginning chapters of this book reminds me a lot of my junior school Logo tutorials. But very soon Bill Casselman starts to draw 3D objects in 2D and projection is where the story gets very interesting. (Think how to draw a polyhedron on a piece of paper.)
The [...]]]></description>
			<content:encoded><![CDATA[<p>As a manual of geometry and Postscript, the beginning chapters of this book reminds me a lot of my junior school Logo tutorials. But very soon Bill Casselman starts to draw 3D objects in 2D and projection is where the story gets very interesting. (Think how to draw a polyhedron on a piece of paper.)</p>
<p>The book has an <a href="http://www.math.ubc.ca/~cass/graphics/manual/index.html">online version</a> and a <a href="http://www.cambridge.org/us/catalogue/catalogue.asp?isbn=0521547881">paper edition</a>.</p>
<p>P.S. One tidbit I learned from this book is that doughnut, oh I mean, torus means cushion in Latin. Hehe.</p>
]]></content:encoded>
			<wfw:commentRss>http://magic.aladdin.cs.cmu.edu/2005/08/18/mathematical-illustrations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pdfopen and pdfclose</title>
		<link>http://magic.aladdin.cs.cmu.edu/2005/07/15/pdfopen-and-pdfclose/</link>
		<comments>http://magic.aladdin.cs.cmu.edu/2005/07/15/pdfopen-and-pdfclose/#comments</comments>
		<pubDate>Fri, 15 Jul 2005 04:19:39 +0000</pubDate>
		<dc:creator>Maverick Woo</dc:creator>
				<category><![CDATA[Electronic Documents]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://magic.aladdin.cs.cmu.edu/?p=117</guid>
		<description><![CDATA[Update on 2008-01-24:
The &#8220;back&#8221; feature is no longer needed, at least on Windows Acrobat Reader 8. See: Edit->Preferences->Documents->Restore last view settings when reopening documents
Update on 2007-01-30:
I have patched the source and replaced the zip files so that pdfclose will be less likely to crash Adobe Reader 8. Thanks to this post. Also, apparently pdfopen cannot [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update on 2008-01-24:</strong><br />
The &#8220;back&#8221; feature is no longer needed, at least on Windows Acrobat Reader 8. See: Edit->Preferences->Documents->Restore last view settings when reopening documents</p>
<p><strong>Update on 2007-01-30:</strong><br />
I have patched the source and replaced the zip files so that <code>pdfclose</code> will be less likely to crash Adobe Reader 8. Thanks to <a href="http://www.latex-community.org/viewtopic.php?f=31&#038;t=14&#038;st=0&#038;sk=t&#038;sd=a&#038;start=30">this post</a>. Also, apparently <code>pdfopen</code> cannot issue a &#8220;back&#8221; command to Adobe Reader and you need the full version for that feature.</p>
<p>If you are a Windows user and use Acrobat or Adobe Reader(*) to view PDF files, you may have experienced Acrobat locking your PDF file, making it impossible to overwrite. This is a serious problem when previewing your paper in the PDF format because every time before you generate a new PDF, you need to remember closing the old PDF in Acrobat.</p>
<p>Part of my solution to this problem is to open the PDF using <code>pdfopen</code>:</p>
<blockquote><p><code>pdfopen --file foo.pdf</code></p></blockquote>
<p>This will allow me to close <code>foo.pdf</code> by:</p>
<blockquote><p><code>pdfclose --file foo.pdf</code></p></blockquote>
<p>Integrating these two commands into your work-flow is left as an exercise to the reader. <img src='http://magic.aladdin.cs.cmu.edu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But there is still an important usability problem that these two commands won&#8217;t solve. Every time you re-open a PDF, you will not be on the same page when you closed it. Instead, you will be on the first page. How would I to fix this? One solution would be to press Alt-Left after I re-opened the PDF file. This goes back in history and brings me to the last view I was at. But I&#8217;ve got something better.</p>
<p>I&#8217;ve modified <a href="http://www.tug.org/texlive/devsrc/Build/source/TeX/texk/contrib/pdfdde.c">the source code of <code>pdfopen</code></a> from TUG to include an extra option <code>--back</code> to do the obvious thing. So instead of the above, you should open a PDF file by:</p>
<blockquote><p><code>pdfopen --file foo.pdf --back</code></p></blockquote>
<p>Now the cycle is complete. Phew!</p>
<p>I have posted the <a href="/wp-uploads/mavpdfopenbin.zip">exe files in a zip</a>. The <a href="/wp-uploads/mavpdfopensrc.zip">source files</a> are available too.</p>
<p>For the record, you can obtain the original <code>pdfopen</code> and <code>pdfclose</code> at this URL:<br />
<a href="http://www.tug.org/tex-archive/systems/win32/web2c/current/binary/bin-pdftools-win32.zip">http://www.tug.org/tex-archive/systems/win32/web2c/current/binary/bin-pdftools-win32.zip</a></p>
<p>BTW, I&#8217;ve read that recent versions of  <a href="http://www.toolscenter.org/">TeXnicCenter</a> and <a href="http://www.winedt.com/">WinEdt</a> can both perform this Acrobat cycle too. But I am not sure if they can go back to the previous view. Heh, surely I know my Emacs can. <img src='http://magic.aladdin.cs.cmu.edu/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>P.S. I am also aware that you can use <a href="http://www.cs.wisc.edu/~ghost/">gsview32</a> to preview PDFs and gsview32 does not lock PDF files. That&#8217;s one way to avoid this problem.</p>
<p>(*) Really, it&#8217;s called <a href="http://www.adobe.com/products/acrobat/readermain.html">Adobe Reader</a>. I don&#8217;t know since when they dropped the middle word.</p>
]]></content:encoded>
			<wfw:commentRss>http://magic.aladdin.cs.cmu.edu/2005/07/15/pdfopen-and-pdfclose/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Splitting and Joining PDFs by pdftk</title>
		<link>http://magic.aladdin.cs.cmu.edu/2005/07/02/splitting-and-joining-pdfs-by-pdftk/</link>
		<comments>http://magic.aladdin.cs.cmu.edu/2005/07/02/splitting-and-joining-pdfs-by-pdftk/#comments</comments>
		<pubDate>Sat, 02 Jul 2005 13:10:29 +0000</pubDate>
		<dc:creator>Maverick Woo</dc:creator>
				<category><![CDATA[Electronic Documents]]></category>

		<guid isPermaLink="false">http://magic.aladdin.cs.cmu.edu/2005/04/29/pdftk/</guid>
		<description><![CDATA[Imagine you have a large PDF document that you want to submit to some three-letter government agency. Besides having the document as one big PDF, the agency also asks you to submit the abstract and the biography as two separate PDFs.
Well, you are running out of time, and your coauthors are still working on their [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine you have a large PDF document that you want to submit to some three-letter government agency. Besides having the document as one big PDF, the agency also asks you to submit the abstract and the biography as two separate PDFs.</p>
<p>Well, you are running out of time, and your coauthors are still working on their sections. You even wrote a make file to automate the document generation because you don&#8217;t want to run LaTeX multiple times manually to resolve all the references&#8230;</p>
<p>But how do you do make these two PDF files efficiently, preferably in an automatic way? Well, if you have Acrobat (the full version), then you can use Document -> Extract Pages to save the relevant pages into separate PDFs. But that&#8217;s not easy to automate. And what if you didn&#8217;t shell out the \$\$\$ to buy Acrobat?</p>
<p>Here is the good news. To extract pages from a PDF, we can use <a href="http://www.accesspdf.com/index.php?topic=pdftk">the free software  <code>pdftk</code></a>. Suppose you know(*) the abstract happens to be on pages 2 and 3 and the biography spans from page 30 to the end. Here is an example usage for our imaginary situation (<code>dont_ask</code> is used to suppress the prompt to overwrite existing files):</p>
<blockquote><p><code>pdftk foo.pdf cat 2-3 output abstract.pdf dont_ask<br />
pdftk foo.pdf cat 30-end output biography.pdf dont_ask</code></p></blockquote>
<p>Besides page extraction, <code>pdftk</code> can also catenate PDFs and perform several other PDF magic tricks. You can discover all these from reading <a href="http://www.accesspdf.com/article.php/20041129175231241">this page</a>. For example, you can discover that you can compute the number of pages of a PDF by</p>
<blockquote><p><code>pdftk foo.pdf dump_data output - | grep NumberOfPages | cut -d' ' -f 2-</code></p></blockquote>
<p>(*) How you can know these ranges automatically is another story to be written later. Hint: use <code>pdftotext</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://magic.aladdin.cs.cmu.edu/2005/07/02/splitting-and-joining-pdfs-by-pdftk/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
