此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)
Import/Export 导入/导出 格式

RTF (.rtf)

MIME type: application/rtf
RTF document file format.
Used for cross-platform exchange of formatted text documents.
Supported by most word processors.
RTF is an acronym for Rich Text Format.
7-bit ASCII format.
Stores formatted text using a human-readable document markup language.
Developed since 1987 by Microsoft.
  • Export["file.rtf", expr] exports a Notebook expression or elements of a notebook to RTF.
  • Import["file.rtf", elem] imports the specified element from an RTF file.
  • Import["file.rtf", {elem, suba, subb, ...}] imports a subelement.
  • Import["file.rtf", {{elem1, elem2, ...}}] imports multiple elements.
  • The import format can be specified with Import["file","RTF"] or Import["file", {"RTF", elem, ...}].
  • Export["file.rtf", expr, elem] creates an RTF file by treating expr as specifying element elem.
  • Export["file.rtf", {expr1, expr2, ...}, {{elem1, elem2, ...}}] treats each expri as specifying the corresponding elemi.
  • Export["file.rtf", expr, opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
  • Export["file.rtf", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
  • Save As exports the active notebook as an RTF file.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties and settings
  • Data representation elements:
"Notebook"a Notebook version of the RTF file
"NotebookObject"RTF file converted to NotebookObject
  • Import and Export use the "Notebook" element by default for RTF files.
Show the Import elements available in an RTF sample file:
In[1]:=
Click for copyable input
Out[1]=
Import this file as a Notebook expression:
In[2]:=
Click for copyable input
Out[2]=
 
Export a Cell expression containing typeset math to RTF:
In[1]:=
Click for copyable input
Out[1]=
Convert the generated file to a Notebook expression:
In[2]:=
Click for copyable input
Out[2]=