Wiley - Publishers Since 1807

United States Change Location

cart.gif CART |  MY ACCOUNT |  CONTACT US |  HELP    

The Word templates we use are set up to display code so that it appears on-screen the same way it will appear on the printed page. The exact number of characters per line varies depending on the series and the style used. For this one-to-one ratio to work, you should not change the margins of the paragraph, nor should you re-size the font. Additional issues about using code are explained in the following sections.

Tab Characters and Indentations

Tab characters are not permitted in code. They are intrinsically meaningless and depend on the tab settings of the software you use. Tab characters can cause problems for our Composition Services team when the time comes to transfer your chapters into Quark. In addition, do not indent your code lines by setting a left indent. You must press the spacebar to indent code lines and align them the way you want them to appear.

Soft Returns

Your code should not contain soft returns. End every code line by pressing Enter to insert a regular (hard) return. For best results, break every code line manually so that code doesn't continue wrapping from one line to the next.

Line Wrapping

Sometimes a line of code is too long to fit on one line, as in this example:

Sub Execute_Batch (strSQL as string, strDSN as string, strUID as string, strPwd as string)

If this happens, there are a couple things you can do:

  • Insert a hard return at a logical point and indent the line (using spaces, not a tab). In most cases, this is sufficient to convey to readers that they are looking at one long line of code. For example, you could break the line as shown here:
    Sub Execute_Batch (strSQL as string, strDSN as string,
         StrUID as string, strPwd as string)
  • Try styling the code as code 80, if it’s available in your template. This style is a smaller point size and can accommodate just under 80 characters on a line. However, code 80 is smaller and a bit harder to read in a finished book, so it should be used sparingly. Code and code 80 should not be “mixed-and-matched” in the same listing or example (although you can use both code and code 80 styles within a given chapter). If any part of a code listing requires code 80, use code 80 for the entire listing. This is what the line looks like in code 80 style:
    Sub Execute_Batch (strSQL as string, strDSN as string, strUID as string, strPwd as string)

    In this case, using code 80 doesn't help because the code is still too long to fit entirely on one line.

  • Type @ta at the point you want to break a line that is too long. This code indicates to the Layout Technician that a code continuation arrow (?) should be inserted at this point. If you decide to use the code continuation (or turnaround) arrow anywhere in your book, you should be sure to discuss the arrow in the Conventions section of the Preface so that readers know what it means.
Code Font within Running Text

It often occurs that certain terms, such as parameters, arguments, tag names, methods, properties, events, statements, variables, stored procedures, Web addresses, and commands might need to appear as code within running text. Please consult with your DE/PE for guidance on formatting those particular terms so they will convert automatically to a monospaced font during layout. Be sure to discuss with your PE/DE which terms you want to show in monospaced font early in the process, because that tends to vary from book to book, and the convention needs to be set at the beginning.