模板:Hanging indent
本模板使用以下模板样式: |
This template uses block elements, e.g. See H:DIVSPAN for details. |
Usage
[编辑]Hanging indent template. (That is, all lines except the first are indented.) The default inset is 2em when one parameter is used with single pipe | to separate the template name and the text. (The expression {{lorem ipsum}} is simply used below to generate some arbitrary text.)
- one parameter
{{hanging indent|{{lorem ipsum}}}}
produces
- shorthand version
{{hi|{{lorem ipsum}}}}
produces
- To specify the amount of indent, use the width first
E.g. for an indent of 1em:
{{hanging indent|1em|{{lorem ipsum}}}}
produces
Spanning multiple pages
[编辑]You can also use {{hanging indent/s}} to open and {{hanging indent/e}} and close the paragraph. But if you need to span the paragraph across pages, you should use the footer and header to create two separate paragraphs, each with hanging-indents, which will not be transcluded to the main namespace. /m can be used instead of /s for a paragraph with no hanging first line. Every page must have one of each, one at the start and one at the end. When the pages are all transcluded, you will end up with just one {{hanging indent/s}} and just one {{hanging indent/e}} at the start and end of the section, respectively. In this way an indented paragraph may span over two or more pages. In the schema below, omit the middle page if it only spans two pages.
First page
[编辑]- Body
- {{hanging indent/s}}
- Start of the hanging indent text.
- Footer
- {{hanging indent/e}}
Middle pages
[编辑]- Header
- {{hanging indent/m}}
- Body
- continuation of the paragraph goes here.
- Footer
- {{hanging indent/e}}
Last page
[编辑]- Header
- {{hanging indent/m}}
- Body
- The last part of the paragaph is here.
- {{hanging indent/e}}
See also
[编辑]- {{hanging indent inherit}}
- {{text-indent}} for a indented first line.
- {{floating quotation mark}} for floating a leading quote mark slightly outside the left margin
- {{center or HI}}: for a heading that's centered when the text is one one line, and has a hanging indent when it wraps to multiple lines.
上述文档嵌入自Template:Hanging indent/doc。 (编辑 | 历史) 编者可以在本模板的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。 本模板的子页面。 |