Template:TOC row 1-r-1

From Wikisource
Jump to navigation Jump to search
Documentation icon Template documentation[view] [edit] [history] [purge]


Usage[edit]

These templates are designed to aid in producing tables of contents (TOCs) using a standardised set of table sections. They are begun with a {{TOC begin}} and are ended with {{TOC end}}.

The aim of these templates is to divorce the TOC from the underlying code. If you have a new circumstance to format, perhaps the best option is to make a new template, rather than hack an old one to fit.

TOC begin[edit]

Parameters
  • align: alignment of the table on the page, defaults to central (optional)
  • width: table width (optional, any CSS units), | width = 100%
  • max-width: table max-width (optional, any CSS units), | max-width = 600px
  • sc: applies small-caps to the entire table (optional), | sc = yes
  • style: applies any other free-form style to the entire table (optional/no default), | style = line-height:1
  • plus: allows addition of separate code (optional), eg. to set table attributes | plus = cellpadding {{=}} 5 ( refer Template:= )

Naming convention[edit]

Template are named by the colspan of their cells (in order) and the salient feature of any cells that are not "normal".

For example, a row of three single cells is {{TOC row 1-1-1}}, and a row with a colspan-2 cell followed by a single cell is {{TOC row 2-1}}. If a cell has no colspan but a salient feature, the "1" from that cell is omitted: {{TOC row 1-out-1}}

Special cases[edit]

  • {{TOC row c}}: a single cell, text centred, with a colspan given in the first parameter, and contents in the second.
  • {{TOC row r}}: a single cell, text right-aligned, with a colspan given in the first parameter, and contents in the second.

3-column tables[edit]

3-column tables are perhaps the most common type. The "normal" condition is for the first and last columns to be right-aligned, and the middle column to be left aligned.

  • {{TOC row 1-1-1}}: three single cells, right-left-right aligned, respectively
  • {{TOC row 2-1}}: a colspan=2 cell and a normal cell. Left and right aligned respectively.
Hanging indents
  • {{TOC row 1-out-1}}: three single cells, but the middle cell has a {{hanging indent}} applied.
  • {{TOC row 2out-1}}: same as "2-1", but the first cell has a hanging indent.
  • {{TOC row 1-dot-1}}: same as "1-out-1", but the middle cell also has a dot-trailer appended.
    • Optional: use symbol= to set dot character(s), space= to set number of spaces (default: one dot and 5 spaces)
      • Use spaces= to set spaces between (symbols.)
  • {{TOC row 2dot-1}}: same as "2out-1", but the first cell also has a dot-trailer appended.
Different alignment
  • {{TOC row 1-r-1}}: three single cells, left-right-right aligned, respectively.
  • {{TOC row 1-c-1}}: three single cells, left-center-right aligned, respectively.

Example[edit]

Table of Contents: {{TOC row c}}
Introduction, Preface and Other Front Matter : {{TOC row 2-1}} 1
1 Chapter 1: {{TOC row 1-1-1}} 2
2 Chapter 2: {{TOC row 1-1-1}} Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 3
{{TOC row r}} Plates illustrating various things
3
Chapter 3: {{TOC row 1-out-1}} Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
4
{{TOC row 2out-1}} Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
5
4
Chapter 4: {{TOC row 1-dot-1}} Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
.  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
6
{{TOC row 2dot-1}} Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
.  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
7

4-column tables[edit]

The "normal" condition if for the first, second and last columns to be right-aligned, and the third column to be left aligned.


Table of Contents: {{TOC row c}}
Introduction {{TOC row 2-1-1}} 1
1 a Section 1: {{TOC row 1-1-1-1}} 2
b Section 2: {{TOC row 1-1-1-1}} Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 3

Ragged-row tables[edit]

Some works have TOCs which have a variably-sized right column, with the left column of other rows sometimes overlapping it. This is often found in periodicals where multiple parts of a serial work are listed on the same line.

  • {{TOC row ragged}}:
    • 1 is the left-aligned main content
    • 2 is the right "column".
    • colspan is the colspan of the whole row to allow it to work with other row templates. Default is 3 (so it will work by default with {{TOC row 1-1-1}}, for example).


Letter to the Editor respecting the New Monthly Magazine1
Grimm's Ghost, Letter X.38, XI. 199, XII. 365

Page breaking[edit]

If a table is broken across multiple, as is common for long TOCs, you need to add a {{nop}} to the top of every page body, to prevent the transclusion running the last line of the previous page into the first line of that page. You also need to put a {{TOC begin}} in the header of the page to make it render properly in the Page: namespace, and you should close the table in the footer of every page except the last:

First page body
{{TOC begin}}
{{TOC row.....}}
First page footer
{{TOC end}}
Middle page header
{{TOC begin}}
Middle pages body
{{nop}}
{{TOC row.......}}
{{TOC row.......}}
Middle pages footer
{{TOC end}}
Last page header
{{TOC begin}}
Last page body
{{nop}}
{{TOC row....}}
{{TOC end}}


See also[edit]

Navigation templates are used to help a reader navigate through or between texts.

Template You type You get Notes
{{TOC}} {{TOC}}


Table of contents A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Used to provide a compact TOC to an alphabetical listing.
{{AuxTOC}} {{AuxTOC|

* [[/Chapter 1/]]}}

Chapters(not individually listed)
Used when the work does not include an original Table of Contents.
{{TOC begin}},
{{TOC end}} and
all {{TOC row....}}'s

{{TOC begin}}
{{TOC row 1-1-1|...}}
{{TOC end}}

Preface i
I. Introduction xii
II. Chapter 1 1
Used to easily format existing TOCs in the original.
https://en.wikisource.org/wiki/Template:TOC_row_1-r-1
en.wikisource.org
crawl=CC-MAIN-2018-43
48729
application/http; msgtype=response
sha1:6NU7CSUDG5P7LFBRO6ZXVJJC5YOSHBYX
<urn:uuid:06aa1ff9-5325-4036-a151-42d5304228cb>
2018-10-17T16:15:15Z
208.80.154.224
text/html
sha1:72POQX5OCQ76M3QAGR2OSQ52NXLUKLWN
<urn:uuid:a3f75c0c-39a1-48da-9846-9428e129769d>
https://en.wikisource.org/wiki/Template:TOC_row_1-r-1
response
<urn:uuid:46d8c7c3-dd78-4e80-b6e4-016c1f7532b6>
isPartOf: CC-MAIN-2018-43
publisher: Common Crawl
description: Wide crawl of the web for October 2018
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-43-199-9.ec2.internal
software: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 0.11-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/