| [ << Documentation work ] | [Top][Contents] | [ Website work >> ] |
| [ < External links ] | [ Up: Syntax survey ] | [ Indexing > ] |
Fixed-width font
-
@code{…},@samp{…}Use the
@code{…}command when referring to individual, language-specific tokens (keywords, commands, engravers, Scheme symbols, etc.) in the text. Ideally, a single@code{…}block should fit within one line in the PDF output.Use the
@samp{…}command when you have a short example of user input (for example, one or two letters), unless it constitutes an entire@itemby itself, in which case@code{…}is preferable. Otherwise, both should only be used when part of a larger sentence within a paragraph or@item. Do not use@code{…}or@samp{…}inside an@exampleblock, and do not use either as a free-standing paragraph; use@exampleinstead.A single, unindented line in the PDF has space for about 79 fixed-width characters (76 if indented). Within an
@itemthere is space for about 75 fixed-width characters. Each additional level of@itemizeor@enumerateshortens the line by about 4 columns.However, even short blocks of
@code{…}and@samp{…}can run into the margin if the Texinfo line-breaking algorithm gets confused. Additionally, blocks that are longer than this may in fact print nicely; it all depends where the line breaks end up. If you compile the documentation by yourself, check the PDF output to make sure the line breaks are satisfactory.The Texinfo setting
@allowcodebreaksis set tofalsein the manuals, so lines within@code{…}or@samp{…}blocks will only break at spaces, not at hyphens or underscores. If the block contains significant spaces, use@w{@code{…}}or@w{@samp{…}}to prevent unexpected line breaks.The Texinfo settings
txicodequoteundirectedandtxicodequotebacktickare both set in the manuals, so backticks (`) and apostrophes (') placed within blocks of@code,@example, or@verbatimare not converted to left- and right-angled quotes (‘ ’) as they normally are within the text, so the apostrophes in ‘@w{@code{\relative c''}}’ will display correctly. However, these settings do not affect the PDF output for anything within a@sampblock (even if it includes a nested@codeblock), so entering ‘@w{@samp{\relative c''}}’ wrongly produces ‘\relative c’’’ in PDF. Consequently, if you want to use a@samp{…}block which contains backticks or apostrophes, you should instead use ‘@q{@code{…}}’ (or ‘@q{@w{@code{…}}}’ if the block also contains significant spaces). -
@command{…}– Use when referring to command-line commands within the text (e.g., ‘@command{convert-ly}’). Do not use inside an@exampleblock. -
@example– Use for examples of program code. Do not add extraneous indentation (i.e., don’t start every line with whitespace). Use the following layout (notice the use of blank lines). Omit the@noindentif the text following the example starts a new paragraph:…text leading into the example… @example … @end example @noindent continuation of the text…
Individual lines within an
@exampleblock should not exceed 74 characters; otherwise they will run into the margin in the PDF output, and may get clipped. If an@exampleblock is part of an@item, individual lines in the@exampleblock should not exceed 70 columns. Each additional level of@itemizeor@enumerateshortens the line by about 4 columns.For long command-line examples, if possible, use a trailing backslash to break up a single line, indenting the next line with 2 spaces. If this isn’t feasible, use ‘@smallexample … @end smallexample’ instead, which uses a smaller font size. Use
@examplewhenever possible, but if needed,@smallexamplecan fit up to 90 characters per line before running into the PDF margin. Each additional level of@itemizeor@enumerateshortens a@smallexampleline by about 5 columns. -
@file{…}– Use when referring to file names, file name extensions, and directories in the text. Do not use inside an@exampleblock. -
@option{…}– Use when referring to command-line options in the text (e.g., ‘@option{--format}’). Do not use inside an@exampleblock. -
@verbatim– Print the block exactly as it appears in the source file (including whitespace, etc.), without handling any Texinfo commands. The characters ‘@’, ‘{’, and ‘}’ don’t need to be quoted with a leading ‘@’ character. For program code examples, use@exampleinstead.@verbatimuses the same format as@example.Individual lines within an
@verbatimblock should not exceed 74 characters; otherwise they will run into the margin in the PDF output, and may get clipped. If an@verbatimblock is part of an@item, individual lines in the@verbatimblock should not exceed 70 columns. Each additional level of@itemizeor@enumerateshortens the line by about 4 columns.
| [ << Documentation work ] | [Top][Contents] | [ Website work >> ] |
| [ < External links ] | [ Up: Syntax survey ] | [ Indexing > ] |