-
参见
- 函 数
- PasteBoxFormInlineCells
-
- 菜单项
- Picture
-
-
参见
- 函 数
- PasteBoxFormInlineCells
-
- 菜单项
- Picture
-
参见
AllowInlineCells
是 SelectedCells、Cell 及相关结构的一个选项,指定是否允许内嵌单元.
更多信息
- AllowInlineCells 用于 SelectedCells,以确定是否内嵌单元是否可以作为 CellObject 返回. 如果选项为 False,并且选定了一个内嵌单元,则 SelectedCells 将返回含有选定内嵌单元的顶层单元.
- AllowInlineCells 控制 Cell 或相关结构是否允许内嵌单元的交互式创建. 在缺省设置 AllowInlineCells->True 时,可以生成单元内嵌套单元. 例如,内嵌单元对于在同一单元中显示排版表达式或连带文本的图形非常有用.
- 在设置 AllowInlineCells->False 时,不能在一个单元中生成内嵌单元. 例如 InputForm 输入单元就属于这种情况.
范例
打开所有单元 关闭所有单元基本范例 (1)
CellPrint[Cell[BoxData[
RowBox[{"123", " ", Cell["Sample inline cell", "InlineFormula"]}]], "Text", CellTags -> "SelectedCellsDemo"]]通过设定 AllowInlineCellsTrue,这将选择内嵌单元:
NotebookFind[SelectedNotebook[], "SelectedCellsDemo", Previous, CellTags];
SelectionMove[SelectedNotebook[], Before, Cell];
NotebookFind[SelectedNotebook[], "Sample inline cell"];
sel = SelectedCells[AllowInlineCells -> True]NotebookRead[sel]通过设定 AllowInlineCellsFalse,选择将自动扩展到含有内嵌单元的单元:
NotebookFind[SelectedNotebook[], "SelectedCellsDemo", Previous, CellTags];
SelectionMove[SelectedNotebook[], Before, Cell];
NotebookFind[SelectedNotebook[], "Sample inline cell"];
sel = SelectedCells[AllowInlineCells -> False]NotebookRead[sel]范围 (1)
这里生成一个 InputForm 单元,其中 AllowInlineCells->False 为默认设置:
NotebookWrite[SelectedNotebook[], Cell[BoxData[RowBox[{"AllowInlineCells", " ", "->", " ", "False"}]], "Input", CellTags -> "AllowInlineCellsFalse"], All];FrontEndExecute[FrontEndToken[FrontEnd`SelectedNotebook[], "SelectionConvert", "InputForm"]]AllowInlineCells -> False通常不允许尝试在 InputForm 单元内插入一个内嵌单元. 期望的结果是一个错误提示音,单元内没有变化:
NotebookFind[SelectedNotebook[], "AllowInlineCellsFalse", Previous, CellTags];SelectionMove[SelectedNotebook[], After, CellContents];
FrontEndTokenExecute["CreateInlineCell"]这里生成一个 InputForm 单元,其中 AllowInlineCells->True:
NotebookWrite[SelectedNotebook[], Cell[BoxData[RowBox[{"AllowInlineCells", " ", "->", " ", "True"}]], "Input", CellTags -> "AllowInlineCellsTrue", AllowInlineCells -> True], All];FrontEndExecute[FrontEndToken[FrontEnd`SelectedNotebook[], "SelectionConvert", "InputForm"]]AllowInlineCells -> True``inline cell``NotebookFind[SelectedNotebook[], "AllowInlineCellsTrue", Previous, CellTags];SelectionMove[SelectedNotebook[], After, CellContents];
FrontEndTokenExecute["CreateInlineCell"];
NotebookWrite[SelectedNotebook[], "inline cell"]历史
1999年引入 (4.0)
文本
Wolfram Research (1999),AllowInlineCells,Wolfram 语言函数,https://reference.wolfram.com/language/ref/AllowInlineCells.html.
CMS
Wolfram 语言. 1999. "AllowInlineCells." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/AllowInlineCells.html.
APA
Wolfram 语言. (1999). AllowInlineCells. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/AllowInlineCells.html 年
BibTeX
@misc{reference.wolfram_2026_allowinlinecells, author="Wolfram Research", title="{AllowInlineCells}", year="1999", howpublished="\url{https://reference.wolfram.com/language/ref/AllowInlineCells.html}", note=[Accessed: 07-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_allowinlinecells, organization={Wolfram Research}, title={AllowInlineCells}, year={1999}, url={https://reference.wolfram.com/language/ref/AllowInlineCells.html}, note=[Accessed: 07-August-2026]}