This site is supported by donations to The OEIS Foundation.

Template:Nl

From OeisWiki
Jump to: navigation, search

The {{nl}} (newline) typographical template inserts newlines.

Usage

To get a single new line:

{{nl}} or {{nl|htm}} (default)

or

{{nl|tex}}

where the parameter is taken from

  • htm (default): to get the HTML+CSS <br /> (line break);
  • tex: to get the TeX/LaTeX \\ command (you may use this template within the {{math}} template, but not within the <math>...</math> element).

To get a specified number of new lines:

{{nl|nonnegative integer}} or {{nl|nonnegative integer|htm}} (default)

or

{{nl|nonnegative integer|tex}}

where the first parameter (nonnegative integer) is the number of new lines wanted; and the second parameter is taken from

  • htm (default): to get the HTML+CSS <br /> (line break);
  • tex: to get the TeX/LaTeX \\ command (you may use this template within the {{math}} template, but not within the <math>...</math> element).

Examples

Examples with valid input

The code

<span style="background: #f2f2f2;">Read on {{nl|0}} the same line.</span>

yields

Read on the same line.

The code

<span style="background: #f2f2f2;">Read on {{nl}} the next line.</span>

yields

Read on
the next line.

The code

<span style="background: #f2f2f2;">Read on {{nl|htm}} the next line.</span>

yields

Read on
the next line.

The code

<span style="background: #f2f2f2;">Read on {{nl|1}} the next line.</span>

yields

Read on
the next line.

The code

<span style="background: #f2f2f2;">Read on {{nl|2}} 2 lines below.</span>

yields

Read on

2 lines below.

The code

<span style="background: #f2f2f2;">Read on {{nl|3|htm}} 3 lines below.</span>

yields

Read on


3 lines below.

The code

<span style="background: #f2f2f2;">Read on {{nl|4}} 4 lines below.</span>

yields

Read on



4 lines below.

The code

: {{math|

\sgn(x) {{sym|def|tex}}
\begin{cases}
  -1 & \text{if } x < 0, {{nl|tex}}
   0 & \text{if } x {{=}} 0, {{nl|tex}}
  +1 & \text{if } x > 0. 
\end{cases}

|$$}}

yields

The code

: {{math|

\sgn(x) {{sym|def|tex}}
\begin{cases}
  -1 & \text{if } x < 0, {{nl|2|tex}}
   0 & \text{if } x {{=}} 0, {{nl|2|tex}}
  +1 & \text{if } x > 0. 
\end{cases}

|$$}}

yields

Examples with invalid input

<span style="background: #f2f2f2;">Read on {{nl|-1}} -1 lines below.</span>

yields

Read on Repeat error: First argument must be a nonnegative integer -1 lines below.

<span style="background: #f2f2f2;">Read on {{nl|four}} four lines below.</span>

yields

Read on Repeat error: First argument must be a nonnegative integer four lines below.

Code


<noinclude>{{Documentation}}<!--

  HTML+CSS: use htm option (default) 

  &#x000D; is 'carriage return' and &#x000A; is 'line feed' 

  TeX/LaTeX: use tex option (you may use this template within the {{math}} template, but not within the <math>...</math> element)

--></noinclude><includeonly>{{#switch: {{lc: {{{1|}}} }}
| htm = <br />
| tex = \\
| {{#switch: {{lc: {{#if: {{{2|}}} | {{{2}}} | htm }} }}
  | htm = {{repeat| {{#if: {{{1|}}} | {{{1}}} | 1 }} |<br />}}
  | tex = {{repeat| {{#if: {{{1|}}} | {{{1}}} | 1 }} |\\}} 
  }}
}}</includeonly>

See also

  • {{nbsp}} (6 mu no-break space, i.e. 6/18 of a quad space, or 1/3 em @opsp@@opsp@≈@opsp@@opsp@ 0.33333em) (formally known as: non-breaking space)
  • {{thinsp}} (3mu space, i.e. 3/18 of a quad space, or 1/6 em @opsp@@opsp@≈@opsp@@opsp@ 0.16667em)
  • {{sp}} (to get a space of a specified width)


  • {{nl}} (new line)