# Gas station without pumps

## 2019 January 8

### One figure has been giving me grief for a long time

Filed under: Circuits course — gasstationwithoutpumps @ 09:22
Tags: , , ,

There is one figure in my book that has been giving me trouble for a long time:

A Moiré pattern figure for the sampling and aliasing chapter that was giving me trouble.

The figure itself is very simple, and it should have been no trouble at all. I created the figure in hand-written SVG, and all the SVG readers (Inkscape, Preview, and browsers) had no trouble rendering it on the screen. But when Inkscape converted it to PDF (using the Cairo library, I believe), it threw away the black bars in the background. When I asked Inkscape to print the image to PDF, it rotated the image.

For a while, I got away with rerotating the image in Preview and saving the result, but the file got damaged or deleted at some point, and redoing the rotation in Preview no longer worked—pdflatex seemed to have no idea that there was a rotation nor a bounding box any more.  (I think Preview changed when I upgraded the mac OS on my laptop.) This change happened between the 2018 Dec 15 and 2018 Dec 30 releases of the book, so the Dec 30 release had a messed-up figure without my realizing it.

Yesterday evening, I noticed the problem and set about trying to fix it.  Nothing I could do with Inkscape or Preview seemed to work—I either ended up with no black bars or with the image rotated and scaled wrong.  (Viewing the individual image with Preview sometimes worked—but the inclusion by pdflatex was failing in those cases.)

Finally, I decided that since Inkscape was incapable of rendering in PDF the pattern-fill I was using to create the bars, that I would give up on pattern fill to create them.  Instead I used a Python program to generate separate rectangles.  Inkscape had no trouble converting that longer but less sophisticated SVG program to PDF, and I was able to fix the figure.

Because this figure was messed up in the “final” release of 30 Dec 2018, I did a quick re-release last night, fixing this figure and a bunch of typos students had found.  Yesterday was the first day of class, and students have already reported 7 errors in the book (one reported after yesterday’s release, so it is still in the current version at LeanPub).

This year’s class seems to be very diligent, as all the students had the book downloaded by the first day of class, and some had started on the homework.

## 2015 March 27

### Bogus comparison of Word and LaTeX

Filed under: Uncategorized — gasstationwithoutpumps @ 09:36
Tags: , ,

An article was recently brought to my attention that claimed to compare LaTeX to Word for preparing manuscripts: PLOS ONE: An Efficiency Comparison of Document Preparation Systems Used in Academic Research and Development. The authors claim,

To assist the research community, we report a software usability study in which 40 researchers across different disciplines prepared scholarly texts with either Microsoft Word or LaTeX. The probe texts included simple continuous text, text with tables and subheadings, and complex text with several mathematical equations. We show that LaTeX users were slower than Word users, wrote less text in the same amount of time, and produced more typesetting, orthographical, grammatical, and formatting errors.

It turns out to be a completely bogus study—they compared typist or typesetting tasks, not authoring tasks. There was no inserting new figures or equations into the middle of a draft, no rearranging sections, no changing citations styles—not even any writing—just copying text from an existing typeset document. It is very misleading to say that the “LaTeX users … wrote less text”, as none of the subjects were writing, just copying, which uses a very different set of skills.

I don’t think that there is much question that for simply retyping an existing document, a WYSIWYG editor like Word is better than a document compiler like LaTeX, but that has very little to do with the tasks of an author. (And even they noted that the LaTeX users enjoyed the task more than the Word users.)

For those of us who use LaTeX on a regular basis, the benefits do not come from speeding up our typing—LaTeX is a bit slower to work with than a WYSIWYG editor.  The advantages come from things like automatic renumbering of figures and references to them, floating figures that don’t require manual placement (except when there are too many figures—then having to do manual placement with LaTeX is a pain), good math handling, automatic formatting of section and chapter headings, being able to define macros for commonly used actions, and the versatility of having a programming language available. For example, I have a macro that I like to use for proper formatting of conditional probability expressions, and another that I use for references to sections, so that I can switch between “Section 3.2”, “Sec. 3.2”, and “§3.2” through an entire book with a change to just one line in the file.

LaTeX also has the advantage of having a much longer life span than Word—I can still run 30-year-old LaTeX files and print them, and I expect that the files I create now will still be usable in 30 years (if anyone still cares), while Word files become unusable in only 10-to-20 years.  LaTeX is also free and runs on almost any computer (the original TeX was written for machines that by modern standards were really tiny—64k bytes of RAM).

For those who want multiple-author simultaneous access (like Google Docs), there are web services like sharelatex.com that permit multiple authors to edit a LaTeX document simultaneously. I’ve used sharelatex.com with a co-author, and found it to be fairly effective, though the server behind the rendering is ridiculously slow—40 seconds for  a 10-page document on the web service, while I can compile my whole 217-page textbook three times in about 12 seconds on my 2009 MacBook Pro.

Like the emacs vs. vi wars, the LaTeX vs. Word camps are more about what people are used to and what culture they identify with than the actual advantages and disadvantages of the different tools. Bogus studies like the one in PLoS One don’t really serve any positive function (unless you happen to be a monopoly software seller like Microsoft).

## 2011 June 30

### LaTeX: essential skills for engineers

Filed under: Uncategorized — gasstationwithoutpumps @ 09:52
Tags: , , ,

I’ve been thinking that the School of Engineering ought to have a required freshman seminar, like the required 200 course for grad students, that teaches the basics of how to be a college student.  One thing I would require in such a course (as I have required in 200 for several years) is that students learn to use use $\LaTeX$.  I’ve long thought it an essential skill for math and computer science majors, but the more I see bioengineers and electrical engineers producing crappy documents in Word, the more I realize that all engineers would benefit from having a document system that can handle math and properly referenced figures.

One thing that prompted this observation was the post on Engineer Blogs, She’s got the look, in which a young engineer (a mechanical engineer, I believe) found out the hard way that $\LaTeX$ is much better for theses than Word.  Several other young engineers have commented on that blog, most agreeing that Word is totally unsuited for theses and other documents that need to be formatted properly and edited through many revisions.  A few have had trouble with the document-compiler nature of $\LaTeX$ and recommended front-ends like LyX.

There is a startup cost to learning $\LaTeX$, so the sooner we start students on it, the more that cost gets amortized.  We can’t count on high schools teaching it (though the Art of Problem Solving  online classes require it for their middle-school and high-school students—they even have a gentle tutorial for youngsters).  It seems like a freshman seminar (required also for new transfer students) would be the best place to put such instruction.

What else should be included in a how-to-be-an-engineering-student course?  A little Python with NumPy?  Some soldering? UNIX command line utility programs? Definitely some search skills from the librarians!

## 2010 November 28

### Powerpoint?

Filed under: Uncategorized — gasstationwithoutpumps @ 00:07
Tags: , , , , ,

This post is not a list of tips for producing slides to support a presentation (maybe I’ll do a post on that some other time).  Instead, it is a reflection on a pair of essays by Edward Tufte and Jean-Luc Doumont.

I read and enjoyed Edward Tufte’s essay The Cognitive Style of Powerpoint: Pitching Out Corrupts Within. It is a hard-hitting critique of the “pitch culture” that turns all presentations into a series of bullet lists. I wanted to require it for my fall senior design class (which is largely about “soft” skills, such as team formation, management, verbal presentation, and writing), but I had a hard time justifying making the students pay $7 for a 32-page essay. Instead I required the free 6-page excerpt from the essay on Tufte’s web site that catches some of the main ideas, though it is not as well-crafted as the complete essay. One of the main points that Tufte makes is that the choppy, bullet-list format encouraged by slides is destructive to longer narratives and connected thoughts, and that sentences and paragraphs are not evil. Not in the excerpt is Tufte’s analysis of the spoof of the Gettysburg Address by Peter Norvig. Edward Tufte is famous for his self-published books, particularly the first one, Visual Display of Quantitative Information, which is perhaps the best book around on presenting data graphically. It should be required reading for every scientist, math teacher, science teacher, and journalist. Edward Tufte also gives one-day workshops based on his books. I’ve never been to one, but some of the grad students in my department have (Tufte gives a huge student discount: they get the seminar plus four of his books for just the price of the books). The students report that he gives awesome seminars also, well worth the time and the money. So Tufte’s credentials as a presenter of data are very, very solid, and people paid a lot of attention to his polemic against PowerPoint. Perhaps too much so, as his criticism seems mainly directed at the use of slides to replace tech reports, which they clearly cannot replace. Jean-Luc Doumont has written a good rebuttal to Tufte: “The Cognitive Style of PowerPoint: Slides Are Not All Evil” (Technical Communication, 52(1), 64–70, Feb 2005), which Amazon sells for$6.  Doumont also gives a good seminar on presentation (I’ve heard the one-hour version), and so I respect his opinions also. I got permission from Doumont to distribute his rebuttal to Tufte to my class, but I put it up on a secure server behind password protection. It seems that other teachers either asked for more permission, or have less respect for authors’ copyrights, as the PDF file can be found on-line with a Google search (and not at Doumont’s own website, where it would be if he had truly meant for it to be distributed freely).

Doumont’s main point is that Tufte missed the point of slides:

Three commonsense considerations related to purpose thus invalidate much of Tufte’s case against the use of slides:

• Oral presentations typically have a different purpose than written documents (different even than companion documents).
• Slides in oral presentations are viewed while the presenter is speaking, not read in silence like written documents.
• Tables and graphs, too, may serve a range of purposes, from analysis by oneself to communication to an audience.

The slides should support the speaker, not replace him or her. Both authors agree that (in Doumont’s words) “presentation slides do not double up effectively as [a] presentation handout,” because what is effective as a presentation aid is too terse to be of much use as a standalone document, and a useful standalone document is too wordy to be of much use as a presentation aid. I teach students that the purpose of an oral presentation is as an advertisement for the written document: to make the listeners aware of the ideas and interested enough to want to know more.  There should be just a handful of take-home messages from an oral presentation—trying to pack all the information of a detailed technical paper into a talk results in the listener coming away with nothing.

Doumont also criticizes Tufte for conflating the tool PowerPoint and the slides produced with it—many of the bad things Tufte points out are the fault of the presenters, not of the tool they used. His criticism here is perhaps a little too protective of Microsoft, as some of the common flaws that Tufte points out are indeed encouraged by the tool (PowerPoint provides many very bad templates).  Still, Doumont’s point is well-taken: it is possible to do good presentations with PowerPoint, even if it is not as easy as making bad ones.

Note: to create his own presentations, Doumont does not use PowerPoint, but uses $\TeX$ with an idiosyncratic macro package, not a style many people will find easy to copy.  I also use $\TeX$, with the prosper package in $\LaTeX$, using Adobe Reader to present the resulting PDF files.  This is the only way I’ve found to include decent math formulas in presentations, something I often need to do.  (There are other $\LaTeX$ slide styles, but I’ve been reasonably happy with prosper, and I was not at all happy with the original SliTeX program.)

## 2010 July 8

### LaTeX on WordPress

Filed under: Uncategorized — gasstationwithoutpumps @ 03:27
Tags: , ,

One of my reasons for selecting WordPress for my blogging was its support for $\LaTeX$, which can be typed as normal, delimited by dollar-sign-latex at the beginning and dollar sign at the end, instead of the backslash forms of LaTeX.  Let’s see if it works:$latex \int e^{x} = e^{x}$ produces $\int e^{x} = e^{x}$

In future posts, if I need to use math, I should be able to make it readable.