When the November 2001 issue
WebTechniques magazine arrived in the mail, I eventually flipped to
merlyn's column, and found that it was mangled. In the code listing,
" appears in place of double-quotes. In the process of converting to print from what I assume is his standard submission format, the article's source code was apparently run through an HTML conversion twice. Holy double-escaped-Entities, Batman! What a non-compilable mess. I hope it gets straightened out in the web version of the article.
This is hardly the first time I've seen mangled code in print. It happens to lots of authors, who pour their skills into article submissions, only to experience the horror of having their carefully formatted code examples appear mangled in print.
And so this Meditation, and appeal to the authors among us to share their wisdom:
What can an author do to avoid seeing code mangled when it finally appears in ink-on-paper print?
I have a bit of experience getting mangled in print, going years back to Dr. Dobbs and the old Mac Technical Journal (both of which did a pretty good job with code fragments), and to PC World, which didn't. The only two pieces of advice I can offer from direct experience are:
- After carefully reading through a publication's writers guidelines, walk through the entire pre-publication process with your Editor, since there always seem to be a few caveats about the process that haven't yet made it into the guidelines.
- Get a prior issue of the publication, and count the line lengths in code examples. If the guidelines say keep line to 64 characters or less, but what shows up in print seems to suggest 60 characters is the real limit, trust what you see in print, and format your code examples accordingly.
If you have experience getting or staying unmangled in Print, please share your suggestions.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.