- Print
- DarkLight
Formatting code, macros, and scripts
Code, macros, and scripts must stand out from normal text. Programming code elements should be formatted in a monospace font that differentiates between the numbers “0” and “1” and the letters “O” and “l” (Courier New or Lucida Sans Typewriter, for example). Use a point size that works with your normal text. Indenting, outlining with a dotted outline, or using a light-shaded background can be effective ways of making the code stand out from normal text.
SELECT
employee_id,
last_name,
first_name,
salary,
RANK() OVER (ORDER BY salary DESC) as ranking
FROM employee
ORDER BY ranking
Always preserve the case (upper and lower) of programming terms, even if the normal style demands the use of a different case. For example, if the heading style is all-caps, the style must be overridden for any lower-case characters in a case-sensitive term.
If programming elements comprise less than a logical line or a single parameter within text format as monospace. Format the spaces on either side in the same font as the normal text. To show portions of sample code, use ellipses.
When showing mathematical equations that are not coded, use the equation editor (see Equations).
Formatting UI elements
The lack of and inconsistent formatting user interface (UI) elements of computer a program makes instructions very difficult to understand.
Program labels, menu items, and other UI elements must stand out from normal text. Take particular care to apply the correct format to identify different types of information. For example, you might want to refer to an element in a generic sense, or as something the user types, or as a label on a dialog box, for example “Type the file name file_name in the Filename box.”