Gas station without pumps

2023 February 6

Proofreading my book

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

World Scientific Publishing sent me round four of proofs recently (round three had terrible problems with scrambled citations, and I sent the citation fixes and only a little other stuff on round 3—they still had not fixed some serious errors from round 2). I’ve been working pretty much full-time on reading the proofs, lately, trying to catch as many of the problems as I can.

Proofreading is different from copy editing—I’m not taking a single PDF file and and looking for typos, spelling errors, punctuation errors, and other minor problems, but taking two different PDF files and comparing them. I’m looking for all the differences between their version of the book and my version, then deciding for each difference whether to correct their version, correct my version, or allow them to remain different.

You would think that there would be good tools for taking differences of PDF files, but I haven’t found one (at least, not a free one). All the tools I found were designed to work a page at a time, assuming that the files were almost identical.  But World Scientific has set the book in a smaller font, with less white space, so their version of the book has about 12% fewer pages than mine. So I fell back on ancient tools like diff (originally written in 1974).

The diff program compares two text files, trying to come up with a small set of insertions and deletions that convert one file into the other. So the first task was to extract text from the PDF file. Both my son and I had written tools (using different PDF parsing packages) to extract URLs from the hot links in the PDF file, for checking all the links to the web, but rather than try to wrestle with those packages for this problem (I’d not had much luck getting clean text last time I tried), I used an off-the-shelf program, pdf2txt.py, that is available with the Anaconda distribution of python, which uses the pdfminer package. Running that program on each pdf file created a corresponding text file that had most of the text of the pdf file, though somewhat scrambled around any math formulas. I called these the “unpdf” files.

Unfortunately, running diff on the unpdf files was pretty useless, as diff considers lines to be the objects to compare, and the line breaks were totally different between the unpdf files, even in regions where the text was really functionally identical.

My first thought was to take the unpdf file and break it into one word per line, so that diff could find matching blocks of words. I spent a day doing or two doing proofreading with the words files, but it was very tedious, as diff often matched common words from different sentences, so I had to spend a lot of time deciphering whether a particular change was real or not. I used emacs with the ediff-buffers command to display the matches, but it did not really give me enough context.

I thought that using a more modern diff algorithm might help, so I wasted some time figuring out how to apply “git diff” with the histogram algorithm to pair of files. Unfortunately “git diff” also uses a more modern output format, which the emacs ediff package does not understand,  and I did not want to write yet another program to take the “git diff” output and convert it to normal diff format.

Instead, I realized that words were not the right size unit—I wanted to compare something more like blocks of sentences. So I wrote yet another Python program to take the unpdf text file and break it into sentences. More precisely, I split it into sentence-like chunks—I just merged everything into one long string then split after every sentence-ending punctuation mark that was followed by white space, and compressed all white space to a single space.

Running diff via ediff-buffers on sentences files worked fairly well, highlighting sentences that had changed and showing me what words within each sentence were different. Diff has some major problems dealing with structural variation, though—if a figure floats to a different location relative to the text, then its caption (or the text that it floated over) will get handled as a deletion in one place and an insertion in the other, without being compared for changes. There is a very similar problem in genomics, looking for structural variation between two copies of a genome, with the added complexity of having inversions possible as well as simple rearrangement, but I don’t know of a (free) text tool that works well on text rearrangements. In any case, the figure captions are relatively small, so I could hand check them when diff was unable to match them.

I could get most of the plain text to match ok, but pdf2txt.py scrambled stuff rather badly around each math formula, and the scrambling was very different in the two unpdf files, so a lot of the lines in the sentences files were different, even when the corresponding text and formulas on the page were the same. So I often had to visually inspect the differences that diff found, or ignore changes near math.

I found hundred of differences between their version and mine. Many were small copy-editing changes they had made, of which I accepted maybe half and incorporated them into my version. Many were copy-editing errors, where they had introduced a change that I regarded as unacceptable—like referring to Lab 13 consistently as Lab 42 or swapping two of the references in the reference list, so that citations for A-weighting pointed to an article on action potentials.

A few other differences were ones I could live with, but didn’t like, so I left them in their version but did not incorporate them into mine.  One of the most common was that they replaced essentially all my ellipses (…) with “etc.”, which I could live with, except when the ellipsis was at the end of a sentence (I don’t like overloading the period to be both the end of the abbreviation and the end of the sentence) or when it was in the middle of a list, rather than at the end. I think that the reason they did not like ellipses is that they set them horribly—not using the ellipsis glyph in Unicode, nor the closely spaced periods that TeX uses. Instead they had periods separated by word spaces, like some high-schooler might use.

Another change that I allowed, but did not incorporate, was a change in the format for numbering the subfigures.  I used numbers like “Figure 3.4a”, while they used “Figure 3.4(a)”.  It was clear that they had hand-edited the cross-references, though, as they often removed or broke the corresponding hot links to the figures, while the unchanged figure references still had hot links.

There were also a few capitalization and punctuation differences, where the copy editors were not so wrong that they needed to be corrected, nor so right that I felt I should match them.

The whole process took several 10-hour days to make one pass through the book. I would never have been able to do the proofreading manually without a program to point out all the little differences. I’ve still not checked the math typesetting, which I hope they did not mess up too badly. The few places I did check looked ok, except for some examples in the LaTeX tutorial sections, where they had “corrected” the examples that were supposed to be showing what happens when you don’t do it right.

Part of the reason for some of the biggest hassles I’ve had in the proof is that the publisher seems to do a lot of stuff manually that should be automated (like all the reference list and citations—if it were done with a tool like BibTeX, then there would not have been the hundreds of citation errors in round 3 of the proofs). They fixed the citation errors in round 4 (except for one swap), but I dread what they are going to do with the index—I suspect that it is going to be hand-crafted and full of errors, while the index I generated will be clean and mostly correct (I put a lot of work into annotating the LaTeX files for the index and formatting the index nicely).

I regard my PDF file as the “true” version of the book, with the World Scientific one as a slightly inferior copy, but I suspect that most people would not distinguish between them, and they will be producing paper copies to sell, which I will not be doing, so there is value in what they are doing.

With them just starting on correcting the errors, I suspect that the book will be coming out in June 2023 (rather than the original target of June 2022).  The official web page now says March 2023, but I suspect it will slip again.

Blue-cover

2022 April 8

Press release for my book

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

World Scientific Publishing has released a press release for my book at https://www.eurekalert.org/news-releases/949205.  That press release is lightly edited from one I wrote for them.

The press release does not point to the lower-cost PDF version at https://leanpub.com/applied_analog_electronics, but I can’t really expect World Scientific to advertise the cheaper option, even though they did allow me to continue selling it.  They have not given me permission to use their cover design

Blue-cover

Blue cover

for my PDF sales, so I will continue to use my own design:

colorized-draft4-464x600

I’m not that fond of their all-caps typesetting anyway, and the generic “tech” background has nothing to do with the contents of the book—but if they think that generic tech backgrounds sell better, I’m willing to believe them, as they have much more experience selling books than I do.

The text for the two versions of the book should be identical, but they are resetting it (with smaller headings and some other formatting changes), so the pagination will be different.

2022 January 4

Book scheduled to come out in June

Filed under: Circuits course — gasstationwithoutpumps @ 17:56
Tags: , , ,

My book now has a web page with World Scientific Publishing (https://www.worldscientific.com/worldscibooks/10.1142/12781) with price information and a DOI.  The claim there is that the book will be available in June at $88 for paperback and $178 for hardback (a rather larger premium for the hardback than I had expected).  Of course, the PDF version will continue to be available for $7.99 from https://leanpub.com/applied_analog_electronics.

I have to write a press release (about 500 words and expressing something novel that would attract science writers). Writing press releases is not one of my strong skills—I’m not sure what spin to put on the book to attract science writers.  I know what I like about the book and why I wrote it, but I’m not sure I can encapsulate that in a press release that would attract attention.

Anyone have any advice for the press release?

I also have to decide whether to buy an ad in the July 2022 “Stanford Authors” issue of Stanford magazine.  It would be $525 for about 400 characters and a picture of the book cover, which I’d be unlikely to recover in direct sales, but if one of the people seeing the book there adopted it for a course, the ad might break even. The magazine claims about 200k readers.

Should I buy the Stanford ad?

2021 December 14

Which cover?

Filed under: Circuits course — gasstationwithoutpumps @ 14:50
Tags: , , ,

My publisher has sent me 3 mock-ups of the cover for the book.  Which of them do you think will sell best?  (I know which one I like best, I think, but that is less important than how well the book will sell.)  I’ve converted their files to PNG for the blog—the real covers have much better resolution.

Peach-cover

Peach cover

Blue-cover

Blue cover

Brown-cover

Brown cover

2021 Dec 28: We’re going with the blue cover.

2021 December 2

Help needed with writing blurb

Filed under: Circuits course — gasstationwithoutpumps @ 08:56
Tags: , , ,

I need to write a draft blurb for my textbook as part of the “promotional questionnaire”, and that is something I’ve always been bad at.  I’ve not been able to make the book sound as good as I think it is. Can anyone provide some suggestions?

Here is what I have so far:

2. Book Information

2.1. Describe the aims and scope of the book.

This textbook is for a first course on electronics. It assumes no prior electronics experience, but does assume that students have had calculus 1 (single-variable differential calculus) and high-school physics. A key idea of the course is that students need a lot of design experience and hands-on work, rather than a lot of theory. The course is centered around the labs, which are a mix of design labs and measurement/modeling labs.

The book is also intended for hobbyists and students on a limited budget to be able to learn from without a course. The inexpensive equipment needed is described in the Preface.

The book is intended to take students from knowing no electronics to being able to design and build amplifier and filter circuits for connecting sensors to microcontrollers within 20 weeks.  Students design a digital thermometer, a blood-pressure meter, an optical pulse monitor, an EKG, an audio preamplifier, and a class-D power amplifier.  They also learn how to measure and characterize components, including impedance spectroscopy of a loudspeaker and of electrochemical electrodes.

2.2 Explain why the book is important in the field or market. Feel free to elaborate on the value it can provide to the readers.

Many educators have seen the need for getting engineering students to do hands-on projects early in their education, but few textbooks exist to support ambitious projects with few prerequisites—most either develop foundational math and never get to design or assume that the foundations have already been covered in a previous course.  This book was deliberately written for a design-first approach, in which the design projects are the center of the course, with just-in-time teaching of concepts as they are needed for the projects.

The book focusses on three building-block concepts that are used over and over: voltage dividers, complex impedance, and negative-feedback amplifiers.  Despite the simplicity of these concepts, they provide powerful tools for doing design.

The book does not shy away from non-linear components, as it has students design a log-transimpedance amplifier for the optical pulse monitor and uses FETs as switches in the class-D power amplifier.

Although the book can certainly be used for teaching electrical engineering majors, it was aimed primarily at non-EE engineering majors (bioengineers).

2.3. Describe 3 key selling points of your book (e.g., how it differs from competing titles; unique treatment of certain topics; new edition/material; prominent authors or contributors).

  1. This book is centered around the design labs, rather than using labs just to illustrate concepts, the concepts are introduced just in time to support the work of the labs. Design is started right away, rather than building a lot of foundations with the usual empty promise that they will be useful “later”.
  2. The labs are mostly centered around the small amount of analog electronics needed for connecting sensors to computers and are chosen to appeal to a wide range of  engineering students, not just electrical engineers. In fact, bioengineering students were the primary audience for the first several years, and many labs are measuring heart function (blood pressure, optical pulse measurement, and EKG). The class-D power-amp lab also introduces H-bridges, which are a major concept for motor controllers and mechatronics.
  3. Three basic concepts (voltage dividers, complex impedance, and negative-feedback amplifiers) are used over and over in different ways, encouraging students to learn engineering as creative reuse of building blocks, rather than as memorizing piles of unrelated formulas.
Next Page »