在笔记本中为 Mathematica 笔记本的各个部分创建 OpenerView
我有一个包含各个部分的笔记本,我想将其缩小(即仅显示该部分/小节的标题等...)并根据需要展开以或多或少地显示各个部分的内容(如在例如 Mathematica 的帮助部分)。
我看到 OpenerView 函数创建了图标,但似乎不适合该目的。 我该如何做到这一点?
I have a notebook with various sections which I would like to contract (i.e show only the title of the section/subsection etc...) and expand as needed to reveal more or less of the content of the various parts (as done in the help section of Mathematica for instance).
I see the function OpenerView creates the icon but appears not to be suited for the purpose.
How do I accomplish that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从菜单中尝试“格式->选项检查器”,然后从下拉菜单中选择“选定的笔记本”。然后在搜索框中输入“opener”,并确保选中“ShowGroupOpener”。然后使用“格式->样式”菜单选项将文档的各个部分放入“节”、“小节”等中。
From the menu, try "Format->Option Inspector" and select "Selected Notebook" from the drop-down menu. Then in the search box type "opener", and make sure the "ShowGroupOpener" is checked. Then put the parts of your document into "Sections", "Subsections" etc. using the "Format->Style" menu options.
页面右侧的蓝色括号是单元格括号。它们表明你的愿望可以或将会崩溃。双击您要折叠的块周围的块,或选择该部分并按:Ctrl+'
如果您希望展开或折叠某个区域中的所有部分节或笔记本,选择要影响的范围(Ctrl+a 选择全部),然后使用:
Ctrl+Shift+[打开
Ctrl+Shift+]关闭
在菜单中
Cell
>分组
如果选择手动分组
而不是自动分组
,则您想要折叠的部分实际上可能不会分组。您可以通过笔记本右侧的蓝色括号查看已分组或未分组的内容。这就是我在上面试图提到的。如果您将设置更改为自动分组
,或使用Ctrl+Shift+g手动对单元格进行分组,您应该看到括号指示组,并且上面的命令应该可以工作。The blue brackets on the right side of the page are cell brackets. They show you want can or will be collapsed. Double click the one that surrounds the block you wish to collapse, or select the section and press: Ctrl+'
If you wish to expand or collapse all of the sections within a section or notebook, select the range you want to affect (Ctrl+a to select all), then use:
Ctrl+Shift+[ to open
Ctrl+Shift+] to close
In the menu
Cell
>Grouping
ifManual Grouping
rather thanAutomatic Grouping
is selected, then the sections you want to collapse may not actually be grouped. You can see what is grouped or not, by the blue brackets on the right side of the Notebook. This is what I attempted to allude to above. If you change the setting toAutomatic Grouping
, or group the cells manually using Ctrl+Shift+g, you should see the brackets indicate the group, and the commands above should work.如果你参考这篇文章,
https://mathematica.stackexchange.com/questions/265/easiest- way-to-use-showgroupopener-in-mathematica
它可能会给你答案。要输入单元格的表达式,请使用 Cell |显示表情。您可以在此处打开 ShowGroupHeader 选项。
If you refer to this post,
https://mathematica.stackexchange.com/questions/265/easiest-way-to-use-showgroupopener-in-mathematica
it will likely have your answer. To enter the expression for the cell, use Cell | Show Expression. There you can turn on the ShowGroupHeader option.