Template talk:R: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Larry Sanger
No edit summary
imported>J. Noel Chiappa
(Formatting limits)
Line 1: Line 1:
==Extra newline==
Can anyone explain to me why there is an extra newline after this template's contents?  Can anyone remove it, please?? --[[User:Larry Sanger|Larry Sanger]] 13:24, 6 May 2008 (CDT)
Can anyone explain to me why there is an extra newline after this template's contents?  Can anyone remove it, please?? --[[User:Larry Sanger|Larry Sanger]] 13:24, 6 May 2008 (CDT)


Line 22: Line 24:
which outputs:{{r|Biology}}{{r|Microbiology}}{{r|Cell Biology}}
which outputs:{{r|Biology}}{{r|Microbiology}}{{r|Cell Biology}}
--[[User:Larry Sanger|Larry Sanger]] 13:55, 6 May 2008 (CDT)
--[[User:Larry Sanger|Larry Sanger]] 13:55, 6 May 2008 (CDT)
==Formatting limits==
Note that even though both:
<pre>
{{r|Biology}}
{{r|Cell (biology)||**}}
</pre>
{{r|Biology}}
{{r|Cell (biology)||**}}
and:
<pre>
{{r|Biology}}
**{{r|Cell (biology)||}}
</pre>
{{r|Biology}}
**{{r|Cell (biology)||}}
work, however:
<pre>
{{r|Biology}}
*{{r|Cell (biology)||*}}
</pre>
{{r|Biology}}
*{{r|Cell (biology)||*}}
doesn't. The best theory about why is that it must be that thing with an extra newline being emitted - it must be coming out after the leading '*' and before the second '*' (in the no-working cases), i.e. right at the start of the template invocation. That's why the ones with the '**' (at either end) work, that new line is not splitting the two '*'s apart. In those middle ones, the reason the naked bullet is coming out right up on the left margin is that it sees:
<pre>
*
*[[link]]
</pre>
not:
<pre>
**[[link]]
</pre>
and of course then we get two separate bullets, fully left-justified. Dont ask me why the <nowiki>**{{r|link||}}</nowiki> case works, because it should be seeing:
<pre>
**
[[link]]
</pre>
if my theory about when the 'rogue' new line is appearing is correct, but clearly it's not appearing then! [[User:J. Noel Chiappa|J. Noel Chiappa]] 11:47, 20 May 2008 (CDT)

Revision as of 11:47, 20 May 2008

Extra newline

Can anyone explain to me why there is an extra newline after this template's contents? Can anyone remove it, please?? --Larry Sanger 13:24, 6 May 2008 (CDT)

To answer my own question, it's caused by the fact that we place newlines between each use of the template, like this:

{{r|Biology}}
{{r|Microbiology}}
{{r|Cell Biology}}

That outputs:

But the r template itself adds an asterisk, which adds its own newline (before the asterisk). That's two newlines. To eliminate extra newlines, you could do this:

{{r|Biology}}{{r|Microbiology}}{{r|Cell Biology}}

which outputs:

--Larry Sanger 13:55, 6 May 2008 (CDT)

Formatting limits

Note that even though both:

{{r|Biology}}
{{r|Cell (biology)||**}}

and:

{{r|Biology}}
**{{r|Cell (biology)||}}

work, however:

{{r|Biology}}
*{{r|Cell (biology)||*}}

doesn't. The best theory about why is that it must be that thing with an extra newline being emitted - it must be coming out after the leading '*' and before the second '*' (in the no-working cases), i.e. right at the start of the template invocation. That's why the ones with the '**' (at either end) work, that new line is not splitting the two '*'s apart. In those middle ones, the reason the naked bullet is coming out right up on the left margin is that it sees:

*
*[[link]]

not:

**[[link]]

and of course then we get two separate bullets, fully left-justified. Dont ask me why the **{{r|link||}} case works, because it should be seeing:

**
[[link]]

if my theory about when the 'rogue' new line is appearing is correct, but clearly it's not appearing then! J. Noel Chiappa 11:47, 20 May 2008 (CDT)