Independent Submission                                          J. Touch
Request for Comments: 5385                                       USC/ISI
Obsoletes: 3285                                            February 2010
Category: Informational
ISSN: 2070-1721
        
Independent Submission                                          J. Touch
Request for Comments: 5385                                       USC/ISI
Obsoletes: 3285                                            February 2010
Category: Informational
ISSN: 2070-1721
        

Version 2.0 Microsoft Word Template for Creating Internet Drafts and RFCs

用于创建Internet草稿和RFC的2.0版Microsoft Word模板

Abstract

摘要

This document describes the properties and use of a revised Microsoft Word template (.dot) for writing Internet Drafts and RFCs. It replaces the initial template described in RFC 3285 to more fully support Word's outline modes and to be easier to use. This template can be direct-printed and direct-viewed, where either is line-for-line identical with RFC Editor-compliant ASCII output. This version obsoletes RFC 3285.

本文档介绍用于编写Internet草稿和RFC的修订版Microsoft Word模板(.dot)的属性和用法。它取代了RFC3285中描述的初始模板,以更全面地支持Word的大纲模式,并更易于使用。此模板可以直接打印和直接查看,其中任何一个都与RFC编辑器兼容的ASCII输出相同。此版本淘汰RFC 3285。

The most recent version of this template and post-processing scripts are available at http://www.isi.edu/touch/tools.

此模板和后处理脚本的最新版本可在http://www.isi.edu/touch/tools.

Status of This Memo

关于下段备忘

This document is not an Internet Standards Track specification; it is published for informational purposes.

本文件不是互联网标准跟踪规范;它是为了提供信息而发布的。

This is a contribution to the RFC Series, independently of any other RFC stream. The RFC Editor has chosen to publish this document at its discretion and makes no statement about its value for implementation or deployment. Documents approved for publication by the RFC Editor are not a candidate for any level of Internet Standard; see Section 2 of RFC 5741.

这是对RFC系列的贡献,独立于任何其他RFC流。RFC编辑器已选择自行发布此文档,并且未声明其对实现或部署的价值。RFC编辑批准发布的文件不适用于任何级别的互联网标准;见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc5385.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc5385.

Copyright Notice

版权公告

Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2010 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。

Table of Contents

目录

   1. Introduction ....................................................3
   2. Use .............................................................3
      2.1. Setting up Your Version of Word to Edit RFCs ...............4
      2.2. Editing ....................................................4
      2.3. Saving the File ............................................6
      2.4. Generating Output ..........................................6
           2.4.1. Printing Direct to a Printer ........................6
           2.4.2. Printing the Text File ..............................6
           2.4.3. XML Support .........................................7
   3. Changes from RFC 3285 ...........................................7
      3.1. Heading Styles .............................................7
      3.2. References Style ...........................................8
      3.3. Boilerplate ................................................9
      3.4. Simplification .............................................9
      3.5. Ability to Direct Print and Direct View ....................9
   4. Compatibility Issues ...........................................10
   5. Security Considerations ........................................10
   6. Acknowledgments ................................................10
   Appendix A. Template Configuration Details ........................11
      A.1. Configure Styles ..........................................11
           A.1.1. Redefine Existing Styles ...........................11
           A.1.2. Add New Styles .....................................12
           A.1.3. Hidden Styles ......................................13
      A.2. Define Page Layout ........................................13
      A.3. Insert Boilerplate ........................................14
      A.4. Automatic Fields ..........................................15
   Appendix B. Post-Processor Script (Perl) ..........................17
   Informative References ............................................20
        
   1. Introduction ....................................................3
   2. Use .............................................................3
      2.1. Setting up Your Version of Word to Edit RFCs ...............4
      2.2. Editing ....................................................4
      2.3. Saving the File ............................................6
      2.4. Generating Output ..........................................6
           2.4.1. Printing Direct to a Printer ........................6
           2.4.2. Printing the Text File ..............................6
           2.4.3. XML Support .........................................7
   3. Changes from RFC 3285 ...........................................7
      3.1. Heading Styles .............................................7
      3.2. References Style ...........................................8
      3.3. Boilerplate ................................................9
      3.4. Simplification .............................................9
      3.5. Ability to Direct Print and Direct View ....................9
   4. Compatibility Issues ...........................................10
   5. Security Considerations ........................................10
   6. Acknowledgments ................................................10
   Appendix A. Template Configuration Details ........................11
      A.1. Configure Styles ..........................................11
           A.1.1. Redefine Existing Styles ...........................11
           A.1.2. Add New Styles .....................................12
           A.1.3. Hidden Styles ......................................13
      A.2. Define Page Layout ........................................13
      A.3. Insert Boilerplate ........................................14
      A.4. Automatic Fields ..........................................15
   Appendix B. Post-Processor Script (Perl) ..........................17
   Informative References ............................................20
        
1. Introduction
1. 介绍

Internet Drafts and RFCs are predominantly written in embedded-text, compile-based formatting systems [1][4][5]. The primary and first such system is NROFF, a text-formatting utility based on manual entry of embedded configuration commands, such as ".p" for new paragraphs. XML is a more recent alternative that uses structure tags instead of explicit formatting commands to allow a single file (.xml) to be 'compiled' into ASCII output, HTML, or a variety of other formats as desired [7].

互联网草稿和RFC主要采用嵌入式文本、基于编译的格式系统编写[1][4][5]。主要的也是第一个这样的系统是NROFF,这是一个文本格式化实用程序,基于手动输入嵌入式配置命令,例如用于新段落的“.p”。XML是一种较新的替代方案,它使用结构标记而不是显式格式化命令,允许将单个文件(.XML)“编译”为ASCII输出、HTML或所需的各种其他格式[7]。

Although XML adds more modern semantic information to the structure tags, neither system supports modern WYSIWYG (what-you-see-is-what-you-get) editing. Editors such as Microsoft Word and Corel WordPerfect provide not only WYSIWYG editing, but also semantic tags as well as outline-mode capabilities. To that end, a Word template called 2-Word.template.rtf was created that supports authoring RFCs, as described in RFC 3285 [6]. That version succeeded in enabling Word-based RFC editing, but did not support Word's outline mode renumbering capabilities.

尽管XML为结构标记添加了更多现代语义信息,但两个系统都不支持现代所见即所得(WYSIWYG)编辑。Microsoft Word和Corel WordPerfect等编辑器不仅提供所见即所得编辑功能,还提供语义标记和大纲模式功能。为此,创建了一个名为2-Word.template.rtf的Word模板,该模板支持编写RFC,如RFC 3285[6]所述。该版本成功地启用了基于Word的RFC编辑,但不支持Word的大纲模式重新编号功能。

This document describes the properties and use of a revised Microsoft Word template (.dot) file that supports Internet Draft and RFC formatting, intended as an update to that of RFC 3285. This version, called 2-Word-v2.0.template.dot, addresses a number of issues with the preliminary version:

本文档介绍了修订版Microsoft Word模板(.dot)文件的属性和使用,该文件支持Internet草稿和RFC格式,旨在更新RFC 3285的格式。此版本称为2-Word-v2.0.template.dot,解决了初步版本的一些问题:

o redefines basic styles (Normal, Heading1, etc.) rather than creating new styles,

o 重新定义基本样式(普通、标题1等),而不是创建新样式,

o updates the boilerplate according to BCP 78,

o 根据BCP 78更新样板文件,

o uses more conventional methods for autonumbered references and figures, including support for name-based references (e.g., "[Tou2005]"), and

o 对自动编号的引用和图形使用更传统的方法,包括支持基于名称的引用(例如“[Tou2005]”),以及

o supports direct output to a printer from the .doc source, as well as RFC-3285-style 'print to text' with post-processing on Windows-based PCs.

o 支持从.doc源直接输出到打印机,以及在基于Windows的PC上进行后处理的RFC-3285样式的“打印到文本”。

This document assumes familiarity with Microsoft Windows operating systems and the Word application.

本文档假定您熟悉Microsoft Windows操作系统和Word应用程序。

2. Use
2. 使用

To use this template, double-click on it in Windows (it may work in MacOS and/or OpenOffice, but this has not been confirmed). The result should be a 'new' document. Do NOT open this document from

要使用此模板,请在Windows中双击它(它可能在MacOS和/或OpenOffice中工作,但尚未确认)。结果应该是一个“新”文档。不要从中打开此文档

within Word, e.g., via the File->Open menu; this will edit the template, rather than using the template to create a new template-based document.

在Word中,例如通过文件->打开菜单;这将编辑模板,而不是使用模板创建新的基于模板的文档。

2.1. Setting up Your Version of Word to Edit RFCs
2.1. 设置Word版本以编辑RFC

Unfortunately, Word does not have a way to save some useful settings in a template. It may be useful to configure autoformatting to avoid using smart quotes or hyphens. However, this template is compatible with these features as its post-processor script translates such non-standard character codes into their RFC-compatible ASCII equivalents.

不幸的是,Word无法在模板中保存一些有用的设置。配置自动格式化以避免使用智能引号或连字符可能很有用。但是,此模板与这些功能兼容,因为它的后处理器脚本将此类非标准字符代码转换为与RFC兼容的ASCII等价物。

2.2. Editing
2.2. 编辑

The template provides a number of styles for use (for details, see Appendix A). Some are redefined internal styles and some are new, as follows. Throughout the document, avoid the use of bold, italics, or any other character formatting, as well as any graphics or paragraph or table borders. Smart hyphens and quotes need not be avoided and will be translated during post-processing.

该模板提供了许多可供使用的样式(有关详细信息,请参见附录a)。有些是重新定义的内部样式,有些是新样式,如下所示。在整个文档中,避免使用粗体、斜体或任何其他字符格式,以及任何图形、段落或表格边框。不需要避免使用智能连字符和引号,它们将在后处理过程中进行翻译。

The current styles allow existing hyphens to break (wrap) across lines, but do not add hyphenation. To insert a non-breaking hyphen, type <CTL-_> (control-underscore); this is particularly useful in URLs, which are more readable if not line-wrapped.

当前样式允许现有连字符跨行断开(换行),但不添加连字符。要插入不间断连字符,请键入<CTL-\uu>(控制下划线);这在URL中特别有用,如果不进行换行,URL的可读性更高。

Note that it is critical NOT to use any styles other than those provided by this template.

请注意,不要使用此模板提供的样式以外的任何样式,这一点至关重要。

o Redefined internal styles for general use:

o 重新定义的通用内部样式:

Normal, Heading1-9, Caption, Header, Footer:

正常,标题1-9,标题,页眉,页脚:

Use in the normal fashion. Tabs can be used as desired.

以正常方式使用。可以根据需要使用选项卡。

o New styles:

o 新样式:

RFC Title:

RFC标题:

For the document title only.

仅适用于文档标题。

RFC Figure:

RFC图:

For ASCII-art figures. Single spaced, kept together.

用于ASCII艺术图形。单间隔,保持在一起。

RFC List Bullet:

RFC列表项目符号:

For bulleted lists.

用于项目符号列表。

RFC List Numbered:

RFC列表编号:

For numbered lists. Use 'restart numbering' as desired for new list sequences.

用于编号列表。对于新列表序列,根据需要使用“重新开始编号”。

RFC References:

RFC参考资料:

For normative and informative references. Do not restart numbering for informative references.

用于规范性和信息性参考。不要为信息性参考重新开始编号。

NOTE: references can use an alternate unnumbered style that relies on use of Word's bookmark feature to set cross-reference tags.

注意:引用可以使用另一种无编号样式,该样式依赖于使用Word的书签功能来设置交叉引用标记。

RFC App:

RFC应用程序:

For appendix titles, using "Appendix A." format. Starts at the top of a new page. If appendices are used, start the references (after appendices) at the top of a new page (insert 'page break').

对于附录标题,使用“附录A”格式。从新页面的顶部开始。如果使用附录,则在新页面顶部开始引用(在附录之后)(插入“分页符”)。

RFC App H1-5:

RFC App H1-5:

For appendix headings ("A.1." format).

附录标题(“A.1.”格式)。

NOTE: these headings will NOT auto-renumber when promoted/demoted in outline mode.

注意:在大纲模式下升级/降级时,这些标题不会自动重新编号。

o Redefined internal styles not generally accessed by users:

o 用户通常无法访问的重新定义的内部样式:

TOC1-9:

TOC1-9:

For table of contents entries.

用于目录条目。

RFC Instructions:

RFC说明:

For instructions to authors. These notes must be deleted.

为作者提供指导。必须删除这些注释。

RFC H1 - no num:

RFC H1-无编号:

For unnumbered headings in end boilerplate text.

用于结尾样板文本中未编号的标题。

RFC H1 - no TOC no num:

RFC H1-无目录编号:

For unnumbered, unlisted (in TOC) headings in front boilerplate text.

对于前模板文本中未编号、未列出(TOC)的标题。

2.3. Saving the File
2.3. 保存文件

The template is provided as a Word 97-2003 ".dot" template; Word 2007 uses an XML-based variant called ".dotx". Word 2007 can use ".dot" templates in "Compatibility Mode". If the file is saved in that mode, it has a ".doc" suffix; if saved in native Word 2007 mode, it has a ".docx" format. It does not matter which saved file format is used.

模板以Word 97-2003“.dot”模板提供;Word 2007使用了一个名为“.dotx”的基于XML的变体。Word 2007可以在“兼容模式”中使用“.dot”模板。如果文件以该模式保存,则其后缀为“.doc”;如果以原生Word 2007模式保存,则其格式为“.docx”。使用哪种保存的文件格式并不重要。

2.4. Generating Output
2.4. 发电量

This template supports printing similar output both to regular printers (8.5 x 11 inch paper) and as Internet-Draft/RFC-compatible text files. Printing to a printer is designed for Windows XP and Vista and may work with earlier versions of Windows; it has not been tested with other OS's. The template is currently in a Word 97-2003 format (.dot); this can be used in "Compatibility Mode" in Word 2007.

此模板支持将类似输出打印到常规打印机(8.5 x 11英寸纸张)和与Internet草稿/RFC兼容的文本文件。打印到打印机是为Windows XP和Vista设计的,可以与早期版本的Windows一起使用;它还没有被其他操作系统测试过。模板当前为Word 97-2003格式(.dot);这可以在Word 2007的“兼容模式”中使用。

Printing to text is supported only for Windows at this time. There is no current support for XML. Details are provided as follows.

此时仅Windows支持打印为文本。目前不支持XML。详情如下。

2.4.1. Printing Direct to a Printer
2.4.1. 直接打印到打印机

The template produces output direct to a printer that is line-for-line, page-for-page identical with the text-only version, with a few minor exceptions:

该模板直接向打印机输出与纯文本版本完全相同的逐行逐页输出,但有几个小的例外:

o Single and double quotes may be angled (left quote, right quote), rather than straight, depending on whether 'smart quotes' are enabled in Tools->Autocorrect options.

o 单引号和双引号可能是有角度的(左引号、右引号),而不是直引号,这取决于是否在工具->自动更正选项中启用了“智能引号”。

o Hyphens may print as an em dash or en dash, depending on whether 'smart hyphens' are enabled in Tools->Autocorrect options.

o 连字符可以打印为em破折号或en破折号,具体取决于是否在工具->自动更正选项中启用了“智能连字符”。

2.4.2. Printing the Text File
2.4.2. 打印文本文件

Printing to an ASCII text file is currently known to work only on Windows-XP and Windows-Vista PCs; appropriate ASCII-output drivers for MacOS or Unix boxes running OpenOffice are not currently known.

目前已知,打印到ASCII文本文件只能在Windows XP和Windows Vista PC上工作;目前还不知道运行OpenOffice的MacOS或Unix设备的相应ASCII输出驱动程序。

To generate .txt output on a Windows-XP or Windows Vista PC, use a two-step process. First, generate a .prn file by printing the document to a text-only printer. Second, apply post-processing to clean up the text and apply 'new page' characters.

要在Windows XP或Windows Vista PC上生成.txt输出,请使用两步过程。首先,通过将文档打印到纯文本打印机生成.prn文件。其次,应用后处理来清理文本并应用“新页面”字符。

Install the "Generic/Text Only" printer, as found under "Generic" in the available print drivers list. Configure the printer to save to a file or click 'save to file' when printing. A printed file will have a .prn file suffix.

安装“通用/纯文本”打印机,如“可用打印驱动程序”列表中的“通用”下所示。将打印机配置为保存到文件,或在打印时单击“保存到文件”。打印文件将具有.prn文件后缀。

The printed output needs to be run through a post-processor to generate valid Internet-Draft or RFC formatted text. Run the .prn file through the post-processing as described in Appendix B. This performs the following operations:

打印输出需要通过后处理器运行,以生成有效的Internet草稿或RFC格式的文本。如附录B所述,通过后处理运行.prn文件。这将执行以下操作:

o Omits <CR>s (converts <CR><LF> to <LF> and omits bare <CR>s).

o 省略<CR>s(将<CR><LF>转换为<LF>并省略裸<CR>s)。

o Converts smart quotes and hyphens to their ASCII counterparts.

o 将智能引号和连字符转换为ASCII对应项。

o Omits blank lines between the footer of one page and the header of the next, and inserts a <CTL-L> (form-feed) between the two.

o 省略一页页脚和下一页页眉之间的空行,并在两者之间插入一个<CTL-L>(表单提要)。

o Checks for remaining illegal characters (not printable ASCII, CR, LF), as required.

o 根据需要检查剩余的非法字符(不可打印的ASCII、CR、LF)。

2.4.3. XML Support
2.4.3. XML支持

There is no current support for XML in this template. Although Word 2003 provides XML support, its use is counterintuitive to most Word users. XML fields are edited using a separate database editor, rather than in the native Word input screen. Future support for XML is being considered for a future revision of this template.

此模板中当前不支持XML。尽管Word 2003提供XML支持,但它的使用对大多数Word用户来说是违反直觉的。XML字段使用单独的数据库编辑器进行编辑,而不是在本机Word输入屏幕中进行编辑。该模板的未来修订版正在考虑将来对XML的支持。

3. Changes from RFC 3285
3. RFC 3285的变更

This document and the ".dot" template borrow heavily from RFC 3285 [6]. Notably, all specifics of point sizes, tab locations, and the automatic date fields are directly from that template. This document builds on that information as follows.

本文件和“.dot”模板大量借用了RFC 3285[6]。值得注意的是,点大小、选项卡位置和自动日期字段的所有细节都直接来自该模板。本文件以该信息为基础,如下所示。

3.1. Heading Styles
3.1. 标题样式

This document redefines Normal, Heading1-9, Header, Footer, and Caption, rather than defining new RFC-named styles as in RFC 3285. The use of internal style names is required for proper operation of outline mode, notably when promoting/demoting sections of text with subsequent renumbering of headings therein.

本文档重新定义了普通、标题1-9、页眉、页脚和标题,而不是像RFC 3285中那样定义新的RFC命名样式。为了正确操作大纲模式,需要使用内部样式名称,尤其是在提升/降级文本部分以及随后对其中的标题重新编号时。

Note that this use of redefined standard styles is the common practice, both in Microsoft-supplied templates as well as templates from the IEEE and ACM, among others.

请注意,在Microsoft提供的模板以及IEEE和ACM等提供的模板中,使用重新定义的标准样式是常见的做法。

Additional heading styles RFC App and RFC App H1-9 were added to support alternate numbering used in appendices, although these styles exhibit the previous deficiency of custom styles in outline mode (will not auto-renumber on promote/demote).

添加了其他标题样式RFC App和RFC App H1-9,以支持附录中使用的备用编号,尽管这些样式在大纲模式下显示了以前自定义样式的不足(升级/降级时不会自动重新编号)。

3.2. References Style
3.2. 引用样式

There are two different reference styles -- RFC References, and RFC References Bookmark. The former cross-references using numbers (e.g., [1]); the latter uses Word's bookmarking cross-reference features to support name/year cross-references (e.g., [Tou2005]). The latter is expected to be the preferred format for future I-Ds and RFCs.

有两种不同的引用样式——RFC引用和RFC引用书签。前者使用数字(如[1])进行交叉引用;后者使用Word的书签交叉引用功能来支持名称/年份交叉引用(例如[Tou2005])。后者有望成为未来I-D和RFC的首选格式。

RFC References is a body text paragraph style that autonumbers based on the "[1]" format. Again, it is common practice, both among Microsoft-supplied templates as well as templates from the IEEE and ACM, to use autonumbered paragraphs in the body text for references. This differs from RFC 3285, in which references were inserted as endnotes, rather than as main body text.

RFC References是一种基于“[1]”格式自动编号的正文段落样式。同样,在Microsoft提供的模板以及IEEE和ACM提供的模板中,通常使用正文中的自动编号段落作为参考。这与RFC 3285不同,在RFC 3285中,引用作为尾注插入,而不是作为正文文本插入。

Putting references in endnotes has unexpected behavior. In particular, the reference is defined by its first use as a citation and is cross-referenced by subsequent citations. Removing the first citation removes the reference entirely, despite other cross-references. This is not the case with body text autonumbered paragraphs, which persist regardless of which cross-references are deleted.

在尾注中放置引用具有意外行为。特别是,参考文献的定义是首次作为引文使用,并由后续引文交叉引用。删除第一条引文将完全删除引用,尽管存在其他交叉引用。正文文本自动编号段落的情况并非如此,无论删除了哪些交叉引用,这些段落都会保持不变。

Note that Word does not provide a way to ensure that all RFC Reference paragraphs are cross-referenced, i.e., users can insert references that are not cited. This can be desired, however, e.g., for bibliographies of supplemental material.

请注意,Word并没有提供一种方法来确保所有RFC参考段落都是交叉引用的,即用户可以插入未引用的参考。然而,这是需要的,例如补充材料的参考书目。

RFC References Bookmark is a body text paragraph style that does not use autonumbering. Currently, authors are expected to manually format their references using name-based tags between square brackets ("[]"). There is no required format, but a suggested format would use the first three letters of the first author, together with the four numbers of the document year, e.g., for this document's reference "[2]", the reference would now appear as:

RFC引用书签是不使用自动编号的正文段落样式。目前,希望作者使用方括号(“[]”)之间基于名称的标记手动格式化其引用。没有要求的格式,但建议的格式将使用第一作者的前三个字母以及文件年份的四个数字,例如,对于本文件的参考“[2]”,参考现在显示为:

[Bra2004] Bradner, S., "IETF Rights..."

[Bra2004]Bradner,S.,“IETF权利…”

The author is expected to select the text of the reference "[Bra2004]" and insert a bookmark at that point with whatever name is convenient for the author. It can then be cited as usual as a cross-reference to the bookmark: [Bra2004]. Note that Word bookmark names must start with a letter, and may include numbers but not spaces.

作者应选择参考文献“[Bra2004]”的文本,并在该点插入一个书签,该书签的名称对作者来说是方便的。然后可以像往常一样引用它作为书签的交叉引用:[Bra2004]。请注意,单词书签名称必须以字母开头,可以包含数字,但不能包含空格。

When two references collide, e.g., for two papers written by Bradner in 2004, a trailing lowercase letter should be used to distinguish them, e.g., [Bra2004a] and [Bra2004b].

当两个参考文献发生冲突时,例如,对于Bradner在2004年撰写的两篇论文,应使用尾随的小写字母来区分它们,例如[Bra2004a]和[Bra2004b]。

3.3. Boilerplate
3.3. 样板

The boilerplate in this template was updated to conform with current RFC Editor requirements, notably BCP 78 rights statements, as well as pending guidelines for Internet Draft and RFC authors [2][3][5].

此模板中的样板文件已更新,以符合当前的RFC编辑器要求,尤其是BCP 78权利声明,以及互联网草稿和RFC作者的待定指南[2][3][5]。

The boilerplate is written in regular text, and can be easily edited by authors to keep the template up-to-date as BCP 78 is revised.

样板文件是以常规文本编写的,作者可以轻松编辑,以便在修订BCP 78时使模板保持最新。

3.4. Simplification
3.4. 简化

Headers and footers use more conventional tabbing to control formatting, rather than tables.

页眉和页脚使用更传统的制表符来控制格式,而不是表格。

Users no longer need to avoid the use of smart quotes or hyphens; these are automatically translated to RFC-compliant ASCII characters during post-processing.

用户不再需要避免使用智能引号或连字符;在后处理过程中,这些字符会自动转换为符合RFC的ASCII字符。

A number of styles include grouping configuration, designed to provide more readable output. In particular, all headings are "keep with next" to avoid widowed heading lines, and all list items, references, and figure lines are "keep together" to avoid inadvertent splitting across page boundaries.

许多样式包括分组配置,旨在提供更可读的输出。特别是,所有标题都是“与下一个保持一致”,以避免标题行过宽,所有列表项、引用和图形行都是“保持一致”,以避免无意中跨页面边界拆分。

3.5. Ability to Direct Print and Direct View
3.5. 能够直接打印和直接查看

This template can print directly to a printer, generating output that is line-for-line, page-for-page identical with the compliant ASCII text output, excepting minor formatting of hyphens and quotes.

此模板可以直接打印到打印机,生成与符合ASCII标准的文本输出完全相同的逐行、逐页输出,连字符和引号的次要格式除外。

Further, this template can be previewed in File->Print Preview or View->Print Layout, again generating screen images that are line-for-line, page-for-page identical with the compliant ASCII text output. This allows true WYSIWYG (what-you-see-is-what-you-get) editing and printing.

此外,可以在文件->打印预览或视图->打印布局中预览此模板,再次生成与符合ASCII文本输出相同的逐行、逐页屏幕图像。这允许真正的所见即所得(WYSIWYG)编辑和打印。

4. Compatibility Issues
4. 兼容性问题

There are no known compatibility issues at this time. This version of the template was designed under Windows XP and Word 2002, and has also been tested under Windows Vista and Word 2007. It is not yet known whether previous versions of Windows/Word are supported using this template.

目前没有已知的兼容性问题。此版本的模板是在Windows XP和Word 2002下设计的,并在Windows Vista和Word 2007下进行了测试。目前还不知道使用此模板是否支持Windows/Word的早期版本。

As noted in Sec. 3.1, this template redefines predefined styles, which is common practice.

如第。3.1,此模板重新定义预定义样式,这是常见做法。

5. Security Considerations
5. 安全考虑

There are many security issues in the general use of Microsoft operating systems and applications. This template is not known to expose any new security issues; it contains no macros as developed and deployed. The author considered including the MD5 signatures of the current versions of the .dot template and .pl post-processor files. The current processor .pl file is included in this document as an appendix. The .dot file is updated to track the current requirements of the IETF boilerplate, so its MD5 signature cannot be included here, but is posted on our website for verification.

在Microsoft操作系统和应用程序的一般使用中存在许多安全问题。已知此模板不会暴露任何新的安全问题;它不包含已开发和部署的宏。作者考虑了包含当前版本的.dot模板和.pl后处理器文件的MD5签名。当前processor.pl文件作为附录包含在本文档中。.dot文件已更新以跟踪IETF样板文件的当前要求,因此其MD5签名不能包含在此处,而是发布在我们的网站上以供验证。

6. Acknowledgments
6. 致谢

The author acknowledges the substantial efforts of the authors of the previous version of the Word template, Mike Gahrns and Tony Hain [6]. This document is intended to build upon their work. Thanks also to Lars-Erik Jonsson for feedback on this template and post-processor script, as well as suggestions on making it more generic to support earlier versions of Windows, and to Jixiong Dong for finding an obscure bug in the formatting.

作者承认单词模板前一版本的作者Mike Gahrns和Tony Hain[6]所做的大量努力。本文件旨在以他们的工作为基础。还感谢Lars Erik Jonsson对该模板和后处理器脚本的反馈,以及使其更通用以支持早期版本的Windows的建议,并感谢Jixiong Dong在格式中发现了一个模糊的错误。

This document was prepared using 2-Word-v2.0.template.dot.

本文件使用2-Word-v2.0.template.dot编制。

Appendix A. Template Configuration Details
附录A.模板配置详细信息

The Word 97-2003 ".dot" template, compatible with Word 2007, consists of a set of default configuration settings, a set of modified and newly-defined styles, and an initial template of text. This section in particular assumes familiarity with Microsoft Word configuration and modification of styles. Note that use of the template does not require understanding this section; this merely documents the settings already in the ".dot" file.

Word 97-2003“.dot”模板与Word 2007兼容,由一组默认配置设置、一组修改的和新定义的样式以及文本的初始模板组成。本节特别假设您熟悉Microsoft Word配置和样式修改。注意,使用模板不需要理解本节;这仅仅记录了“.dot”文件中已有的设置。

A.1. Configure Styles
A.1. 配置样式

Modify paragraph styles as indicated. In general use, only the redefined existing styles Normal, Heading1-9, Header, Footer, and Caption, and new styles RFC Figure, RFC References, RFC List Bullet, RFC List Numbered, RFC App, and RFC App H1-5 need be used by authors.

如图所示修改段落样式。通常情况下,作者只需使用重新定义的现有样式普通、标题1-9、页眉、页脚和标题,以及新样式RFC图、RFC参考、RFC列表项目符号、RFC列表编号、RFC应用和RFC应用H1-5。

Other styles, such as redefined TOC1-9, RFC Hidden, RFC H1 - no num, and RFC H1 - no TOC no num are used by the template, but are typically hidden in the styles list, and need not be explicitly applied by authors.

模板使用了其他样式,例如重定义的TOC1-9、RFC HINDED、RFC H1-no num和RFC H1-no TOC no num,但这些样式通常隐藏在样式列表中,作者无需显式应用。

All measurement units below are in points. Change measurement units to points to set.

以下所有测量单位均以点为单位。将测量单位更改为要设置的点。

A.1.1. Redefine Existing Styles
A.1.1. 重新定义现有样式

Redefine the Normal style first; all others are based on Normal, except as noted.

首先重新定义法线样式;除另有说明外,所有其他均以正常为基础。

1. Normal: font Courier New, font size 12 point, next style Normal, line spacing EXACTLY 12 point, spacing before 0 pt, spacing after 12 pt, indent left 21.6 pts, widow/orphan control, left tabs at every 3 spaces (1 space = 7.2 points, given 72 points/inch and 10 characters/inch): 21.6, 43.2, 64.8, 86.4, 108, 129.6, 151.2,172.8, 194.4, 216, 237.6, 259.2, 280.8, 302.4, 324, 345.6,367.2, 388.8, 410.4, 432, 453.6, 475.2, 496.8.

1. 正常:字体信使新,字体大小12点,下一个样式正常,行距正好12点,0点之前的间距,12点之后的间距,左缩进21.6点,寡妇/孤儿控件,左制表符每3个空格(1个空格=7.2点,给定72点/英寸和10个字符/英寸):21.6,43.2,64.8,86.4,108,129.6,151.2172.8,194.4,216,237.6, 259.2, 280.8, 302.4, 324, 345.6,367.2, 388.8, 410.4, 432, 453.6, 475.2, 496.8.

NOTE: 12 point fonts are 12 points tall, i.e., 6 lines/inch vertically; 12-point Courier is 10 characters/inch horizontally.

注:12点字体为12点高,即垂直6行/英寸;12点信使水平方向为10个字符/英寸。

2. Heading 1-9: Normal + indent left 0 pt, hanging 21.6 pts, keep with next, set autonumbering as "1. ", "1.1. ", "1.1.1. ", etc. Note the space after the right-most period; type this in the

2. 标题1-9:正常+缩进左0磅,悬挂21.6磅,与下一个保持一致,将自动编号设置为“1.”、“1.1.”、“1.1.1.”等。注意最右边句点后的空格;请在

"number format" field, and leave the "follow number with" field as 'nothing' (click on the 'more' button to see this field if it is not already visible).

“数字格式”字段,并将“跟随数字”字段保留为“无”(如果该字段不可见,请单击“更多”按钮查看该字段)。

NOTE: change the autonumbering ONCE and in ONE format; in that format, change all subsequent levels.

注:更改自动编号一次,格式为一种;在该格式中,更改所有后续级别。

3. TOC 1-9: Normal + paragraph flush, clear tabs, add new Right tab at 504 pts that includes a "..." leader. Add indent left as follows: TOC 1: 21.6, TOC 2: 43.2, TOC 3: 64.8, TOC 4: 86.4, TOC 5: 108, TOC 6: 129.6, TOC 7: 151.2, TOC 8: 172.8, TOC 9: 194.4.

3. TOC 1-9:正常+段落刷新,清除制表符,在504点处添加新的右制表符,包括“…”引线。按如下方式添加左缩进:TOC 1:21.6、TOC 2:43.2、TOC 3:64.8、TOC 4:86.4、TOC 5:108、TOC 6:129.6、TOC 7:151.2、TOC 8:172.8、TOC 9:194.4。

4. Header: Normal + space after 0 pts, next style Header, clear tabs, and add centered tab at 252 pts, tab right at 504 pts.

4. 标题:0点后的普通+空格,下一个样式标题,清除制表符,并在252点处添加居中制表符,在504点处添加制表符。

5. Footer: Header + next style Footer.

5. 页脚:页眉+下一样式页脚。

6. Caption: Normal + centered, autonumbered "Figure #".

6. 描述:正常+居中,自动编号“Figure#”。

A.1.2. Add New Styles
A.1.2. 添加新样式

NOTE: "keep lines together" is optional for lists and references; it helps avoid breaking individual items across pages.

注意:列表和参考中的“保持行在一起”是可选的;它有助于避免在页面上打断单个项目。

1. RFC Figure: Normal + space after 0 pts, keep with next, keep lines together, next style RFC figure (also used for authors' addresses).

1. RFC图:0点后的普通+空格,与下一个保持一致,将行保持在一起,下一个样式RFC图(也用于作者地址)。

2. RFC List Bullet: Normal + custom bulleted, "o" bullet style, aligned at 21.6 pts, bullet tab after 43.2 pts, bullet indent at 43.2 pts, next style RFC List Bullet, keep lines together.

2. RFC列表项目符号:普通+自定义项目符号,“o”项目符号样式,在21.6点对齐,在43.2点后对齐项目符号选项卡,在43.2点缩进项目符号,下一个样式RFC列表项目符号,保持行在一起。

3. RFC List Numbered: Normal + custom numbered, "1. " number format, aligned at 21.6 pts, bullet tab after 43.2 pts, bullet indent at 43.2 pts, next style RFC List Numbered, keep lines together.

3. RFC列表编号:普通+自定义编号,“1.”编号格式,在21.6点对齐,在43.2点后为项目符号制表符,在43.2点处为项目符号缩进,下一样式RFC列表编号,保持行在一起。

4. RFC References: Normal + hanging 43.2 pts, outline level body text, remove tabs at 21.6 and 43.2 pts, custom numbering with format "[1]", numbering left aligned 21.6 pts, number tab space after at 64.8 pts, number text indent at 64.8 pts, next style RFC References, keep lines together (used for both normative and informative references).

4. RFC参考:标准+悬挂43.2分,大纲级别正文,删除21.6和43.2分处的制表符,使用格式“[1]”自定义编号,左对齐21.6分编号,在64.8分处为制表符空格编号,在64.8分处为文本缩进编号,下一样式RFC参考,将行保持在一起(用于规范性参考和信息性参考)。

5. RFC References Bookmark: Normal + hanging 72 pts, no num, remove tabs less than 72 pts, keep lines together (used for both normative and informative references).

5. RFC参考书签:正常+悬挂72分,无数字,移除小于72分的标签,保持行在一起(用于规范性参考和信息性参考)。

6. RFC Title: Normal + space after 24 pts, centered (used for document title).

6. RFC标题:正常+24点后的空格,居中(用于文档标题)。

7. RFC App: RFC H1 - no num + page break before, custom outline numbered, outline number style "Appendix A.", outline level 1, follow number with nothing, outline number at 0 pts, outline indent text at 0 pts, (used for Appendix titles).

7. RFC应用程序:RFC H1-前无数字+分页符,自定义大纲编号,大纲编号样式“附录A.”,大纲级别1,后跟编号不带任何内容,大纲编号为0分,大纲缩进文本为0分(用于附录标题)。

8. RFC App H1-5: RFC H1 - no num + paragraph level 2-6, custom outline numbered, outline number style "A.1." - "A.1.1.1.1.1.", follow number with nothing, outline number at 0 pts, outline indent text at 0 pts, (link with RFC App at level 2-6), (used for Appendix heading levels).

8. RFC App H1-5:RFC H1-无编号+段落级别2-6,自定义大纲编号,大纲编号样式为“A.1.”-“A.1.1.1.1.”,编号后无任何内容,大纲编号为0分,大纲缩进文本为0分,(与RFC App链接,级别2-6),(用于附录标题级别)。

A.1.3. Hidden Styles
A.1.3. 隐藏样式

These are used for pre-formatted components or instructions and are configured to be hidden from the list of available styles.

这些用于预先格式化的组件或指令,并配置为从可用样式列表中隐藏。

1. RFC H1 - no num: Normal + indent left 0 pts, outline Level 1, keep with next (used for base template trailer headers -- Copyright, etc.).

1. RFC H1-无编号:正常+左缩进0分,大纲级别1,保留下一个(用于基本模板尾部标题-版权等)。

2. RFC H1 - no TOC nonum: Normal + indent left 0 pts, (outline level body text, as with Normal), keep with next (used for base template front matter headers -- Abstract, Status, TOC header, etc.).

2. RFC H1-无TOC nonum:Normal+缩进左0分(大纲级正文,与Normal一样),保留next(用于基本模板的前端标题——摘要、状态、TOC标题等)。

3. RFC Instructions: Normal, character bold. This style is not normally shown and is used for instructions that should be removed before publication.

3. RFC说明:正常,字符粗体。此样式通常不显示,用于发布前应删除的说明。

A.2. Define Page Layout
A.2. 定义页面布局

Configure Page Setup as follows:

按如下方式配置页面设置:

1. Margins:

1. 利润:

Portrait orientation.

纵向定位。

         Top:    72   pts
         Bottom: 60   pts (72 + 60 +_660 [55 lines] = 792 [11 in])
         Left:   36   pts (5 characters at 7.2 pts/char)
         Right:  57.6 pts (8.5"-7.2" = 1.3in = 93.6 pts - 36 for left)
         Gutter:  0   pts
         Header:  0   pts
         Footer:  0   pts
        
         Top:    72   pts
         Bottom: 60   pts (72 + 60 +_660 [55 lines] = 792 [11 in])
         Left:   36   pts (5 characters at 7.2 pts/char)
         Right:  57.6 pts (8.5"-7.2" = 1.3in = 93.6 pts - 36 for left)
         Gutter:  0   pts
         Header:  0   pts
         Footer:  0   pts
        

If the error message "One or more margins are outside the printable area" appears, select Ignore. This may depend on the printer currently selected.

如果出现错误消息“一个或多个页边距超出可打印区域”,请选择“忽略”。这可能取决于当前选择的打印机。

2. Paper size:

2. 纸张尺寸:

Paper size "letter".

纸张大小为“字母”。

      Width:   612 pts
      Height:  792 pts (55 lines/page + 132 for top and bottom margins)
        
      Width:   612 pts
      Height:  792 pts (55 lines/page + 132 for top and bottom margins)
        

3. Layout:

3. 布局:

Different headers and footers on the first page.

第一页上有不同的页眉和页脚。

Header: 72 pts from edge Footer: 60 pts from edge

页眉:距边缘72分页脚:距边缘60分

A.3. Insert Boilerplate
A.3. 插入样板

See below for definitions of {ACDt}, {ACDy}, {AEM}, {AEY}, {AP}.

有关{ACDt}、{ACDy}、{AEM}、{AEY}、{AP}的定义,请参见下文。

First page header:

第一页页眉:

      {blank line}
      {blank line}
      <Working Group Name>{tab}<Initial.  Lastname>
      Internet Draft{tab}<Affiliation>
      Intended status: <e.g., Informational>{tab}{ACDy}
      Expires: {AEM}{AEY}
      {blank line}
      {blank line}
        
      {blank line}
      {blank line}
      <Working Group Name>{tab}<Initial.  Lastname>
      Internet Draft{tab}<Affiliation>
      Intended status: <e.g., Informational>{tab}{ACDy}
      Expires: {AEM}{AEY}
      {blank line}
      {blank line}
        

Footer (same on first and subsequent pages):

页脚(第一页和后续页相同):

      {blank line}
      {blank line}
      {blank line}
      <Lastname>{tab}Expires: {AEM} {ACDy}, {AEY}{tab}[Page {AP}]
      {blank line}
        
      {blank line}
      {blank line}
      {blank line}
      <Lastname>{tab}Expires: {AEM} {ACDy}, {AEY}{tab}[Page {AP}]
      {blank line}
        

The front text and end text are as specified in BCP 78 [2]. For Internet Drafts, the sentence declaring the expiration dates uses automatic fields as needed, as with the headers and footers. Note that some of these fields will not be updated properly until the document has been saved and/or printed.

前文本和后文本如BCP 78[2]所述。对于Internet草稿,声明到期日期的句子根据需要使用自动字段,如页眉和页脚。请注意,在保存和/或打印文档之前,这些字段中的某些字段不会正确更新。

A basic document outline with examples is provided in the Word template to demonstrate the use of automatic fields, including a table of contents.

Word模板中提供了带有示例的基本文档大纲,以演示自动字段的使用,包括目录。

A.4. Automatic Fields
A.4. 自动字段

Most of these are self-explanatory; the expiry month is set 6 months in advance. The expiry year rolls-over (+1), if needed. The expiry day is a copy of the current date.

其中大多数是不言自明的;到期月份提前6个月设置。如果需要,到期年将顺延(+1)。到期日是当前日期的副本。

NOTE: expiry date can generate invalid dates, e.g., April 31, February 30, etc.

注意:到期日期可能会生成无效日期,例如4月31日、2月30日等。

   o  {AEM} means auto expiry month, and is a field code =
        
   o  {AEM} means auto expiry month, and is a field code =
        
      { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 1
      July
        { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 2
        August
        { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 3
          September
          { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 4
            October
            { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 5
              November
              { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 6
                December
                { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 7
                  January
                  { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 8
                    February
                    { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 9
                      March
                      { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 10
                        April
                        { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 11
                          May
                          { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 12
                            June
                            "Fail" *\ MERGEFORMAT
   } *\ MERGEFORMAT } *\ MERGEFORMAT } *\ MERGEFORMAT } *\ MERGEFORMAT }
   *\ MERGEFORMAT } *\ MERGEFORMAT } *\ MERGEFORMAT } *\ MERGEFORMAT
   } *\ MERGEFORMAT } *\ MERGEFORMAT } *\ MERGEFORMAT }
        
      { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 1
      July
        { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 2
        August
        { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 3
          September
          { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 4
            October
            { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 5
              November
              { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 6
                December
                { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 7
                  January
                  { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 8
                    February
                    { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 9
                      March
                      { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 10
                        April
                        { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 11
                          May
                          { IF { SAVEDATE \@ "M" \* MERGEFORMAT } = 12
                            June
                            "Fail" *\ MERGEFORMAT
   } *\ MERGEFORMAT } *\ MERGEFORMAT } *\ MERGEFORMAT } *\ MERGEFORMAT }
   *\ MERGEFORMAT } *\ MERGEFORMAT } *\ MERGEFORMAT } *\ MERGEFORMAT
   } *\ MERGEFORMAT } *\ MERGEFORMAT } *\ MERGEFORMAT }
        
   o  {ACDt} means auto current date, and is a field code =
        
   o  {ACDt} means auto current date, and is a field code =
        
      { SAVEDATE \@ "MMMM d, yyyy" }
        
      { SAVEDATE \@ "MMMM d, yyyy" }
        
   o  {ACDy} means auto current day, and is a field code =
        
   o  {ACDy} means auto current day, and is a field code =
        
      { SAVEDATE \@ "d " }
        
      { SAVEDATE \@ "d " }
        
   o  {AEY} means auto expiry year, and is a field code =
        
   o  {AEY} means auto expiry year, and is a field code =
        
      { IF { SAVEDATE \@ "M" \* MERGEFORMAT } < 7
           { SAVEDATE \@ "YYYY" \* MERGEFORMAT }
           { IF { SAVEDATE \@ "M" \* MERGEFORMAT } > 6
                { = { SAVEDATE \@ "YYYY" \* MERGEFORMAT } + 1
                \* MERGEFORMAT }
              "FAIL" \* MERGEFORMAT \* MERGEFORMAT
         } \* MERGEFORMAT
    }
        
      { IF { SAVEDATE \@ "M" \* MERGEFORMAT } < 7
           { SAVEDATE \@ "YYYY" \* MERGEFORMAT }
           { IF { SAVEDATE \@ "M" \* MERGEFORMAT } > 6
                { = { SAVEDATE \@ "YYYY" \* MERGEFORMAT } + 1
                \* MERGEFORMAT }
              "FAIL" \* MERGEFORMAT \* MERGEFORMAT
         } \* MERGEFORMAT
    }
        
   o  {AP} means auto page, and is a field code =
        
   o  {AP} means auto page, and is a field code =
        

{ Page }

{Page}

Appendix B. Post-Processor Script (Perl)

附录B.后处理器脚本(Perl)

   #!/local/bin/perl
   # ------------------------------------------------------------------
   #                          2-Word-post-v2.0
   # Perl post-processor for MS Word RFC/Internet-draft template output
   #
   #                              J. Touch
   #                           touch@isi.edu
   #                      http://www.isi.edu/touch
   #
   #            USC Information Sciences Institute (USC/ISI)
   #               Marina del Rey, California 90292, USA
   #                         Copyright (c) 2004-2009
   #
   # Revision date: May 5, 2009
   # ------------------------------------------------------------------
   #
   # usage:
   #        2-Word-post-v2.0.pl [inputfile.txt] > [outputfile.txt]
   #
   # function:
   #     removes indent on each line (blank print margin, typ. 5 chars)
   #        converts cr/lf to cr
   #     converts 'smart quotes' to regular quotes (single and double)
   #     converts 'smart hyphens' (em dash, en dash) to regular hyphen
   #     omits blank lines between footer and next-page header
   #     inserts formfeed (ff) between footer and next-page header
   #     removes end-of-line whitespace
   #     checks for illegal chars (not printable ASCII, cr, lf, ff)
   #     checks for page lengths exceeded
   #     checks for line lengths exceeded
   #     prints errors indicating page and line on that page
   #
   #        illegal character errors are posted to STDERR
   #
   #        returns the logical OR of codes indicating errors found:
   #                0x00 no error
   #                0x01 if any illegal characters found
   #                0x02 if any page length exceeds $maxpagelen
   #                0x04 if any line length exceeds $maxlinelen
   #
   # ------------------------------------------------------------------
        
   #!/local/bin/perl
   # ------------------------------------------------------------------
   #                          2-Word-post-v2.0
   # Perl post-processor for MS Word RFC/Internet-draft template output
   #
   #                              J. Touch
   #                           touch@isi.edu
   #                      http://www.isi.edu/touch
   #
   #            USC Information Sciences Institute (USC/ISI)
   #               Marina del Rey, California 90292, USA
   #                         Copyright (c) 2004-2009
   #
   # Revision date: May 5, 2009
   # ------------------------------------------------------------------
   #
   # usage:
   #        2-Word-post-v2.0.pl [inputfile.txt] > [outputfile.txt]
   #
   # function:
   #     removes indent on each line (blank print margin, typ. 5 chars)
   #        converts cr/lf to cr
   #     converts 'smart quotes' to regular quotes (single and double)
   #     converts 'smart hyphens' (em dash, en dash) to regular hyphen
   #     omits blank lines between footer and next-page header
   #     inserts formfeed (ff) between footer and next-page header
   #     removes end-of-line whitespace
   #     checks for illegal chars (not printable ASCII, cr, lf, ff)
   #     checks for page lengths exceeded
   #     checks for line lengths exceeded
   #     prints errors indicating page and line on that page
   #
   #        illegal character errors are posted to STDERR
   #
   #        returns the logical OR of codes indicating errors found:
   #                0x00 no error
   #                0x01 if any illegal characters found
   #                0x02 if any page length exceeds $maxpagelen
   #                0x04 if any line length exceeds $maxlinelen
   #
   # ------------------------------------------------------------------
        
   # ------------------------------------------------------------------
   # VARIABLES
   # ------------------------------------------------------------------
        
   # ------------------------------------------------------------------
   # VARIABLES
   # ------------------------------------------------------------------
        
   $pagenum = 1;          # start on page 1, not 0
        
   $pagenum = 1;          # start on page 1, not 0
        
   $maxpagelen = 66;      # max lines per page
        
   $maxpagelen = 66;      # max lines per page
        
   $maxlinelen = 72;      # max chars per line
        
   $maxlinelen = 72;      # max chars per line
        
                          # specific error codes
   %codes = (
              'none' => 0x00,
              'char' => 0x01,
              'page' => 0x02,
              'line' => 0x04,
            );
        
                          # specific error codes
   %codes = (
              'none' => 0x00,
              'char' => 0x01,
              'page' => 0x02,
              'line' => 0x04,
            );
        
   %codestrings = (
                    'none' => '(no error)',
                    'char' => 'invalid character code',
                    'line' => 'exceeded $maxpagelen lines per page',
                    'page' => 'exceeded $maxlinelen chars per line',
                  );
        
   %codestrings = (
                    'none' => '(no error)',
                    'char' => 'invalid character code',
                    'line' => 'exceeded $maxpagelen lines per page',
                    'page' => 'exceeded $maxlinelen chars per line',
                  );
        
   $errorcode = $codes{'none'};
        
   $errorcode = $codes{'none'};
        
   $indentlen = -1;       # how many spaces to eat from the beginning
                          # of each line; ought to be 5. negative flag
                          # means it is not yet initialized
        
   $indentlen = -1;       # how many spaces to eat from the beginning
                          # of each line; ought to be 5. negative flag
                          # means it is not yet initialized
        
   $indentstr = "     ";  # until known otherwise, assume 5 spaces
        
   $indentstr = "     ";  # until known otherwise, assume 5 spaces
        
   $killwhite = 1;        # flag kills space between footer, header
                          # start in 'between footer and header' mode,
                          # so eats all whitespace before the first line
        
   $killwhite = 1;        # flag kills space between footer, header
                          # start in 'between footer and header' mode,
                          # so eats all whitespace before the first line
        
   # ------------------------------------------------------------------
   # ERROR SUBROUTINE
   # ------------------------------------------------------------------
   sub printerr ($) {
     my ($errstring) = shift;
        
   # ------------------------------------------------------------------
   # ERROR SUBROUTINE
   # ------------------------------------------------------------------
   sub printerr ($) {
     my ($errstring) = shift;
        
     print STDERR "ERROR: $codestrings{$errstring} ",
       "on line $linenum on page $pagenum of text input file\n";
     $errorcode |= $codes{$errstring};
     return;
   }
        
     print STDERR "ERROR: $codestrings{$errstring} ",
       "on line $linenum on page $pagenum of text input file\n";
     $errorcode |= $codes{$errstring};
     return;
   }
        
   # ------------------------------------------------------------------
   # MAIN
   # ------------------------------------------------------------------
        
   # ------------------------------------------------------------------
   # MAIN
   # ------------------------------------------------------------------
        
   while ($line = <>) {
     $line =~ s/\r//g;         # remove Unix-style end-of-line
     # if this line is NOT empty, start printing again (see below)
     if ($line !~ /^\s*$/) {
       $killwhite = 0;
       if ($indentlen < 0) {
         # discover margin indent
         $line =~ /^((\s)*)/;
         $indentstr = $1;
         $indentlen = length($indentstr);
       }
     }
     # remove the margin indent
     $line =~ s/^($indentstr)//;
     # change special hyphens, quotes to regular ones
     $line =~ tr/\221\222\223\224\226\227/\'\'\"\"\-\-/;
     # omit end-of-line whitespace
     $line =~ s/\s+\n/\n/g;
     # print unless we're between the end of one page
     # and the beginning of the next
     if ($killwhite != 1) {
       # check to see if we have any invalid characters left
       # 012 = new line, 014 = form feed, 015 = carriage return
       # 040-176 = printable ASCIIs
       if ($line !~ /^([\012\014\015\040-\176])*$/) {
         printerr('char');
         # note -- we don't stop here, so we can find all the
         # unprintable characters in one pass
       }
       $linenum++;
       if ($linenum > $maxpagelen) {
         printerr('page');
       }
       if ($#line > $maxlinelen) {
         printerr('line');
       }
       print $line;
     }
     # check to see if this is the end of a page;
     # if so, then print a form feed (ctl-L), and
     # kill the printing of subsequent empty lines
     if ($line =~ /\[Page \d+\]\s+$/) {
       print "\f\n";
       $killwhite = 1;
        
   while ($line = <>) {
     $line =~ s/\r//g;         # remove Unix-style end-of-line
     # if this line is NOT empty, start printing again (see below)
     if ($line !~ /^\s*$/) {
       $killwhite = 0;
       if ($indentlen < 0) {
         # discover margin indent
         $line =~ /^((\s)*)/;
         $indentstr = $1;
         $indentlen = length($indentstr);
       }
     }
     # remove the margin indent
     $line =~ s/^($indentstr)//;
     # change special hyphens, quotes to regular ones
     $line =~ tr/\221\222\223\224\226\227/\'\'\"\"\-\-/;
     # omit end-of-line whitespace
     $line =~ s/\s+\n/\n/g;
     # print unless we're between the end of one page
     # and the beginning of the next
     if ($killwhite != 1) {
       # check to see if we have any invalid characters left
       # 012 = new line, 014 = form feed, 015 = carriage return
       # 040-176 = printable ASCIIs
       if ($line !~ /^([\012\014\015\040-\176])*$/) {
         printerr('char');
         # note -- we don't stop here, so we can find all the
         # unprintable characters in one pass
       }
       $linenum++;
       if ($linenum > $maxpagelen) {
         printerr('page');
       }
       if ($#line > $maxlinelen) {
         printerr('line');
       }
       print $line;
     }
     # check to see if this is the end of a page;
     # if so, then print a form feed (ctl-L), and
     # kill the printing of subsequent empty lines
     if ($line =~ /\[Page \d+\]\s+$/) {
       print "\f\n";
       $killwhite = 1;
        
       $linenum = 0;
       $pagenum++;
     }
   }
   exit($errorcode);
        
       $linenum = 0;
       $pagenum++;
     }
   }
   exit($errorcode);
        

Informative References

资料性引用

[1] Reynolds, J., Ed., and R. Braden, Ed., "Instructions to Request for Comments (RFC) Authors", Work in Progress, August 2004.

[1] Reynolds,J.,Ed.,和R.Braden,Ed.,“征求意见书(RFC)作者须知”,进展中的工作,2004年8月。

[2] Bradner, S., Ed., and J. Contreras, Ed., "Rights Contributors Provide to the IETF Trust", BCP 78, RFC 5378, November 2008.

[2] Bradner,S.,Ed.,和J.Contreras,Ed.,“向IETF信托提供的权利贡献者”,BCP 78,RFC 5378,2008年11月。

[3] Bradner, S., Ed., "Intellectual Property Rights in IETF Technology", BCP 79, RFC 3979, March 2005.

[3] Bradner,S.,编辑,“IETF技术中的知识产权”,BCP 79,RFC 3979,2005年3月。

[4] RFC Editor, "Formatting RFCS", http://www.rfc-editor.org/formatting.html.

[4] RFC编辑器,“格式化RFC”,http://www.rfc-editor.org/formatting.html.

[5] IETF, "Guidelines to Authors of Internet Drafts". Available as 1id-guidelines.txt at http://www.ietf.org.

[5] IETF,“互联网草案作者指南”。以1id-guidelines.txt的形式提供,网址为http://www.ietf.org.

[6] Gahrns, M. and T. Hain, "Using Microsoft Word to create Internet Drafts and RFCs", RFC 3285, May 2002.

[6] Gahrns,M.和T.Hain,“使用Microsoft Word创建互联网草稿和RFC”,RFC 3285,2002年5月。

[7] Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629, June 1999.

[7] Rose,M.“使用XML编写I-D和RFC”,RFC 2629,1999年6月。

Author's Address

作者地址

Joe Touch USC/ISI 4676 Admiralty Way Marina del Rey, CA 90292-6695 U.S.A.

Joe Touch USC/ISI 4676美国加利福尼亚州玛丽娜·德雷海军部路90292-6695号。

   Phone: +1 (310) 448-9151
   Fax:   +1 (310) 448-9300
   EMail: touch@isi.edu
        
   Phone: +1 (310) 448-9151
   Fax:   +1 (310) 448-9300
   EMail: touch@isi.edu