Template:ROOT/Template Documentation/RootInputLine

      This is the documentation for the template RootInputLine designed for the book ROOT. Please embed this documentation on the template's page (or elsewhere) with {{ROOT/Template Documentation/RootInputLine}}. To edit the template documentation, please edit this page.

      This is a template designed for the book ROOT. It should be used to format input during an interactive ROOT session.

      Usage

      Syntax

      {{ROOT/RootInputLine|#1|#2}}
      
      Parameter Default Value Mandatory Description
      #1 0 no Line number.
      #2   no Input line to be displayed.

      Comments

      • Do not add a blank line before this template or you'll get ugly space.
      • To format multiple lines of code, use a new template for each line.
      • Well, this is annoying: You can't use the = sign, curly braces or a pipe inside the parameter. Encode them as HTML, eg. = for the equality sign. Please see [1] for a list of HTML replacements.

      Convention on Line Numbers

      Always start with line number 0. When using this template multiple times on a page, use continuous line numbers except there is a good reason to do different. (E.g. to emphasize a restart of ROOT.)

      Examples

      Example 1

      In this example, we display a blank input line that gets the default line number 0.

      Code

      {{ROOT/RootInputLine}}
      

      Result

      root [0]

      Example 2

      In this example, we display an input line that acts as a "hello world" program.

      Code

      {{ROOT/RootInputLine|0|cout << "hello world" << endl;}}
      

      Result

      root [0] cout << "hello world" << endl;

      See Also

      Last modified on 15 December 2010, at 04:40