Template talk:Indent

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

This is the discussion/talk page for: Template:Indent.

Talk-page subpages:
Template subpages:

Demonstration Vs. {{space}}[edit]

Source 'test lines'[edit]

  1. I think that the end is near{{indent|15}} but not yet...{{space|10}} but coming soon!
  2. Second test line merely reverses the words {indent} with {space}.
  3. Line 3: I think that the end is near<br>but not yet.
  4. Line 4: Without a #-number or asterisk bullet, the end is near{{indent|15}} but not yet..(etc.).

Results for the End is near[edit]

  1. I think that the end is near
                    but not yet...           but coming soon!
  2. I think that the end is near                but not yet...
               but coming soon!
  3. Line 3: I think that the end is near
    but not yet.

Line 4: Without a #-number or asterisk bullet, the end is near
                but not yet...          but coming soon!

Demonstration: Table in a bullet[edit]

The templates {{indent}} & {{space}} were created to align text in places where wikitables seemed excessive, such as within a bullet-entry:

* America has several car manufacturers, making cars:{{indent|5}}GM, Ford & Chrysler-Dodge{{space|3}}- The "Big 3"{{indent|5}}Toyota (world's biggest){{space|7}}- In Tennessee{{indent|5}}Mercedes (German){{space|11}}- Also in Alabama & other states.<br>There are many other auto makers in America.


  • America has several car manufacturers, making cars:
         GM, Ford & Chrysler-Dodge   - The "Big 3"
         Toyota (world's biggest)       - In Tennessee
         Mercedes (German)           - Also in Alabama & other states.
    There are many other auto makers in America.

Note that the spacing doesn't always align evenly, due to template {{space}} generating a mixture of en-size & em-size spaces, so instead use template {{in}} to generate equal-size spaces:

Coding: * America has manufacturers:{{indent|5}}GM, Ford & Chrysler-Dodge{{in|5}}- "Big 3"{{indent|5}}Toyota (world's biggest){{in|12}}- Tennessee{{indent|5}}Mercedes (German){{in|17}}- Also.


  • America has manufacturers:
         GM, Ford & Chrysler-Dodge∈- "Big 3"
         Toyota (world's biggest)∈- Tennessee
         Mercedes (German)∈- Also.

Using {{in|17}} allowed the Mercedes-text to better align with the others. In general, usage of {{space}} requires more effort than {{in}} to align the spacing. -Wikid77 (talk) 10:46, 3 May 2009 (UTC)

Genesis History[edit]

I ported this over from wikisource. Seems useful for when a wikitable is contraindicated, yet one wants to line up several short columns of material. That makes the assumption that it can be used in-line, and does not generate a linefeed. (I'm acting boldly, as it displays poorly as you can see below! FrankB (User:Fabartus at 21:33, 26 May 2006)

  • 03-May-2009: After dealing with the newline issue, User:Fabartus created {{space}} in June 2006, to allow the in-line spacing needed to align text outside a wikitable. After that, quick templates were added for: {{sp2}}, {{sp3}}, {{sp4}}, {{sp5}} plus {{i2}} & {{i5}}. -Wikid77 (talk) 09:46, 3 May 2009 (UTC)

If it's just <br>{{space}}[edit]

If the only difference between this and the template space is the line break, then replace the current code with <br>{{space|{{{1}}}}}. Jɪmp 07:15, 21 June 2007 (UTC)

  • 03-May-09: (2 years later) The coding has remained separate, and for 3 important reasons: redundancy, variation, and tracking. Many people often think that reducing any duplication to just one copy is undeniably better; however, here in the real world, "redundancy is good redundancy" because having only a single, central copy would mean that any coding error (or vandalism) could disable all functionality, everywhere. Instead of using Template:space as the basis of all these templates, the duplication of coding has extended beyond mere redundancy to even allow variation, so that each template is independent of hacking to others, and each can offer separate options, such as different default values within the similar coding sections. Also, usage problems could be better tracked to the specific template, rather than use {{indent}} and have error messages reporting the problem from "{{space}}" which the user did not use, or used elsewhere, leading to possible confusion as to where the coding problem actually started. Plus, tracking could count the use of {{indent}} without implicitly using {{space}}. Those 3 reasons (redundancy, variation, and tracking) are why the coding should remain separate. -Wikid77 (talk) 08:50, 3 May 2009 (UTC)

Fixed double-space bug from August 2006[edit]

03-May-09: I have fixed the 3-year coding bug in Template:Indent that caused numbered or asterisk-bullet lines to double-space, and caused auto-numbering to reset to 1. The bug was introduced in the revision of 16:09 on August 22, 2006. The problem was fixed by adding an HTML comment to prevent the implicit newline after the ending tag "</includeonly>" as follows:

<includeonly>{{#if:{{{2|}}}|<br />}}</includeonly><!-- This
-- comment (after an "includeonly") prevents an implicit newline.
--><br />{{#switch: {{{1}}}

The problem was fixed (after nearly 3 years) as version Ver F.1 of the {{indent}} template on English Wikipedia. -Wikid77 (talk) 08:50, 3 May 2009 (UTC)

Retrofit talk-page year headers/subpages[edit]

03-May-2009: I have added subheaders above as "Topics from 2006" (etc.) to emphasize the dates of topics in the talk-page. Older topics might still apply, but using the year headers helps to focus on more current issues as well. Afterward, I dated/named unsigned comments.
Then I added "Talk-page subpages" beside the TOC. -Wikid77 (talk) 09:46, 3 May 2009 (UTC)

Archived old topics to Archive_1[edit]

I have created the talk-page archive subpage: Template_talk:Indent/Archive_1 for topics from 2006 to May 2007. -Wikid77 (talk) 09:46, 3 May 2009 (UTC)

Attempting to clarify the confusing part[edit]

Hey, nerd passing by and saw this (same as below):

The non-breaking "&nbsp;" is exactly the same size as a space (by definition, it must be the same), so it can be alternated with spaces to skip a wider area[clarify]. Notice that neither {{indent}} nor {{space}} use true space-size, but rather mix en+em spaces, whereas "{{in5|n}}" will actually skip n count of spaces, as if inserting n repetitions of an "&nbsp;" space.

I did my best to clarify it here, but may have introduced more confusion:

 Editor note This was formerly marked as unclear. If it remains unclear, tag it and/or discuss on talk:

As computers optimize code, they occasionally risk displaying unsavory results after condensing monotonous strings of characters (such as spaces). Thus, many templates around Wiki choose to avoid this hurdle by alternating different types of spaces (with the intention of displaying no differently than regular spaces).[note 1]

Spaces come in two main size varieties: em spaces and en spaces. Em spaces are generally defined as the width of one character, and en spaces exactly half that size. However, there is no requirement that browsers must conform to this standard, and so templates[note 2] that code in en spaces may not display uniformly across all browsers.[note 3] Neither {{indent}} nor {{space}} use true space-size (that is, em-size spaces), but rather mix en and em spaces, whereas {{in5|n}} avoids en spaces altogether and will actually skip n count of spaces, as if inserting n repetitions of an em space. This is done by alternating em spaces with an em-size non-breaking "&nbsp;"—by definition, it must be the same—in order to skip a wide area.

I took a peek at the module, looked up en and em spaces, looked at the talk pages of all the different modules, and began working on this.

  1. ^ From Template:In5/doc
  2. ^ Why more than one template? See Template talk:Indent#If it's just <br>{{space}}
  3. ^ I'm making an assumption here

Honestly, I question whether people who use this template need to know this stuff. Should I just take this out, or archive this, or something? meteor_sandwich_yum (talk) 05:32, 12 March 2014 (UTC)

Equivalence to ":"[edit]

The template's documentation states that |indent=5 matches indentation of a colon-shift (":"), but on my browser (firefox 57.0), this results in a bigger indentation. The value that seems to match the colon-shift is not 5, but 3. Any thoughts as to why this might be happening? – Uanfala (talk) 20:04, 7 December 2017 (UTC)

Uanfala: I believe this has to do with the way Module:Indent is implemented in code vs how ":" is implemented in code and how your browser treats those underlying implementations compared to how other browsers do. I believe the module indentations are implemented in terms of &nbsp and &emsp but regarding ":", I have no clue. Maybe try asking at WT:LUA? Someone there should know more. - Vanstrat ((🗼)) 07:36, 10 December 2017 (UTC)