|
|
Guidelines for coding style of LaTeX files for the manualThe guidelines can be discussed on the LatexGuidelinesTalk page. LanguageGeneral
QuotesBritish writing uses "smart quotes" quotation marks. They are coded in LaTeX as (two backticks) for the opening quotation mark and '' (two apostrophes) for the closing quotation markEllipsisAn Ellipsis usually indicates an omitted part in the text. It's always three dots and coded as\ldots HyphensEnglish typesetting has three different types of hyphens.
NamesManufacturer and product names are formatted in accordance with the standard rules of English grammar e.g. "Ipod playback is currently unsupported", "This feature is not available for the Iriver H120". In general these should be defined in macros in the platform specific LaTeX files. Manufacturer and model names are proper nouns, and should thus begin with a capital letter.SectioningTo be discussed.TablesButton mapping tables ("button map")There is now an environment helping to unify all button map tables. Use it as following:\begin{table} % this is still needed! Don't put position modifiers here! \begin{btnmap}{mapping table caption)}{mapping table label} \ButtonStop & Stops playback \\ ... \ButtonPlay & Starts playback \\ \end{btnmap} \end{table}Note: you need to end the last line with \\. To suppress caption / label leave them empty. Generic tablesTo provide a consistent look, all tables should be created using therbtabular environment. This environment correctly fills the headers with colors, sets the horizontal rules and provides alternating colors for table rows. Example: \begin{rbtabular}{\textwidth}{lX}{Head 1 & Head 2}{Caption}{Label} % your table goes here \end{rbtabular}The first parameter ( \textwidth in the example) specifies the width of the table, the second specifies the format of the columns (same syntax as in the latex package tabularx ). Then follow the headers (must match the columns' formats), and then the caption and the label (for referencing to this table from other places in the manual). The last two parameters may be left blank, but the braces should still be present.
When you create the table this way you don't need any hline , toprule or the like. The environment does this all for you!
ListsLists in general use the unnumbered list style. Don't use line breaks in lists unless there's a good reason (Extra paragraphs under a buller point are normally formatted as unbulleted items in the list. This makes the spacing uniform.) Avoid numbered lists if you can.DescriptionsDescription lists have previously set asitemize . This shouldn't be used anymore, use description instead. The description itself goes as optional argument for \item. Also, we decided to write a full stop after the description, not a colon. Thus, we get something like "Bookmark. To create a bookmark ...", not "Bookmark: To create ...". For better readability of the source put the separating space out of the argument like in the example below (and not "\item[Bookmark. ]To create ...") \begin{description} \item[Bookmark.] To create a bookmark ... \end{description}These won't be bulleted anymore. It has still to be decided if we want to change the style to use bullet signs again, but you really should use description
Include/Exclude sectionsTo include a section of text for a specific target or feature, use the \opt command. Note: opt introduces unwanted spaces when followed by line breaks. If you break a line directly after an \opt command, you need to end that line with a comment mark % to avoid that unwanted spaces, especially if that opt is followed by more opt lines! Thus it is recommended to end all opt's with a trailing comment sign. If you want to break an overly long \opt "list" you also need to use the % at the end of the line to sort of escape the line feed. Otherwise the item before or after the line break will be ignored depending on the position of the comma.\opt{HAVE_LCD_COLOR,ondio}{This text will only be included in the manual for targets with color lcd's and ondios}Excluding a section is done in a similar way, but for this the opt command is used. opt{iriver}{This is included for all targets except irivers}All the current defined features are to be found within the platform files in the /manual/platform folder. Look at the keywords in the def and edef lines. There is also the possibility to use all the features defined to enable or disable strings in the language files in /apps/features.txt. This file will be parsed automatically to a features.tex in the manual build folder and contains the usable options for the specified target. It's very handy for excluding or including parts that apply to a certain hardware set, e.g. only colour screens. MarkupEmphasizingEmphasize a word / sentence with \emph{}. Do not use \textbf{}.Font variantsDo not use \textsc{} to get small caps. This will produce heavy HTML code. Use \caps{} instead. Generally, you should avoid to use font formatting directly in the text itself but use style macros like \setting{} unless it's unavoidable.NotesUse the ote macro for setting notes. They will automatically get the "Note:" added and have an icon on the margin so the reader can catch them pretty quick. Within a note do not use \textbf to emphasize parts, use only \emph instead!ote{Your note text goes here} WarningsIf you want to write a warning, use the \warn macro. This behaves similar to ote indicating this text is a warning using an icon alongside the text.\warn{Don't drop your player!} Fixme NoteIf you want to highlight a part of the text that needs attention, use the \fixme macro. This will highlight the text within the curly braces in red.\fixme{This needs some serious attention} Tags/ConfigUse the \config macro to emphasize a wps tag or a config setting.\config{\%xx} Code blockWhen writing blocks of code meant to be written in a terminal or terminal output, use the code environment. This will format the code in a consistent way. You have to indent the code with 4 spaces, as the first 4 are stripped.\begin{code} ipod_fw -g nano -o rockboot.bin -i apple_os.bin bootloader-nano.bin \end{code} Example blockWhen you want to give an example on e.g. wps files or config files, use the example environment. You have to indent the example with 4 spaces, as the first 4 are stripped.\begin{example} # Example configuration file volume: 70 bass: 11 treble: 12 balance: 0 \end{example} Menu entries and optionsMenu options and configuration option names should use the macro \setting. Deeper paths use an arrow, which is coded as $\rightarrow$. Write the same casing as the entries on the device, which is atm uppercase every first letter of menu entries. If we want to change the style we can do this later in the preamble.\setting{General Settings $\rightarrow$ Playback} File namesFilenames and paths (with trailing /) should use the \fname macro. Paths use the unix' style "slash" as directory delimiter, not Windows backslash! To escape special characters, put a backslash before them.\fname{/.rockbox}is rendered as /.rockbox \fname{/.rockbox/folder\_advance\_list.txt}is rendered as /.rockbox/folder_advance_list.txt
HyperlinksHyperlinks aren't underlined. This is handled in the pre-amble so you generally don't need to worry about it.
\url{http://www.rockbox.org}
\wikilink{LatexGuidelines} Images
Screenshots
SVG imagesTo include svg images they need to be converted.
LabelsIf you place a label somewhere, please stick to the following rules. Labels should be named by the context in which they are placed.
\reference{sec:my_section} File structure"Coding" style
Directory structuretbd.Macros you should use
r39 - 02 Apr 2021 - 20:46:07 - UnknownUser
Copyright © by the contributing authors.
|