mathematica中的2列文件 [英] 2 column documents in mathematica

查看:234
本文介绍了mathematica中的2列文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mathematica可以用来写非常好的文档。有谁知道是否有可能写2列的文件?如果是这样,你能提供一些例子或链接到其他笔记本,显示这种风格。

解决方案

我不认为任何好Mathematica支持多列的实现 - 它与笔记本接口的结构不兼容。 publicon不支持正确的多列的事实可能是Mathematica没有的好提示。产品/ publicon / qa.html#列rel =noreferrer> 问:Publicon是否支持多列布局?

< blockquote>
Publicon文档是面向垂直滚动范例的
,与HTML非常相似,而不是页面布局程序中的逐页配置

可以在表中配置多个列,但不能将其维护为
流。 Publicon的重点是文档结构,允许干净的
转换为LaTeX或XML,以提交给发布者。然后,出版商
可以使用页面布局工具,利用它们自己特定的
格式生成单列或双列布局到他们自己的
规格。
blockquote>

虽然当然,像黑客入侵一样 Bilateral Cells (Verbia答案中提到的作者工具包的一部分)和下面的内容可以使用。



一些生成两列文本单元格的代码将把列的大小调整为窗口大小 - 但文本不会从一列流向另一列。

 单元格[BoxData [
GridBox [{ {Cell [Column One:\ some text,Text],
Cell [Column Two:\ more text,Text]}},ColumnsEqual - >确实,
ColumnSpacings - > 2,ColumnAlignments - >左边,
ColumnWidths - >动态[第一[WindowSize /。选项[EvaluationNotebook []]] /(2 * 18)]]],
Text] // CellPrint



或者你可以在右边有一个输入/输出的文本

$ $ $ $ $ $ $ $ $ $单元格[BoxData [GridBox [{
{Cell [Column One:\ some text,Text],Cell [BoxData [RowBox [{1,+,1}]],Input]},
{\ [SpanFromAbove],Cell [BoxData [2],Output]},
ColumnsEqual - > True,ColumnSpacings - > 2,ColumnAlignments - >左边,
ColumnWidths - >动态[第一[WindowSize /。选项[EvaluationNotebook []]] /(2 * 18)]]],
Text] // CellPrint



请注意,我只是通过将前者除以18来完成像素到em的转换。真正的转换将依赖于系统和字体。另外,只需在输入和输出单元格中添加 CellLabel s不起作用。所以 In [n]:= Out [n] = 可能需要使用一个小的中间列。

最后,应该可以构建类似于作者工具包使用的双边单元代码,该代码抓取一个Text / MathCaption单元格,后跟一个Input和Output单元格并把它们组合成一个双列建筑。

Mathematica can be used to write very nice documents. Does anyone know if it is possible to write documents with 2 columns? If so, can you provide some examples or links to other notebooks that show this style.

解决方案

I don't think any good implementation of multicolumns are supported in Mathematica - it's not really compatible with the structure of the notebook interface. The fact that publicon does not support proper multiple columns is probably a good hint that Mathematica does not.

Q: Does Publicon support multi-column layout?

Publicon documents are oriented toward a vertical scrolling paradigm much like HTML, rather than a page-by-page configuration found in page-layout programs. Multiple columns can be configured in tables, but not maintained as flows. Publicon's focus is on document structure, allowing clean translation to LaTeX or XML for submission to publishers. Publishers can then use page-layout tools that exploit their own particular formats to generate single- or double-column layouts to their own specifications.

Although, of course, hacks like Bilateral Cells (part of the Author Tools package mentioned in Verbia's answer) and that below can be used.

Here's some code that generates a two column text cell that will resize the columns to the window size - but the text does not flow from one column to another. Once the cell is generated, you can type in it as per normal.

Cell[BoxData[
   GridBox[{{Cell["Column One:\nsome text", "Text"], 
      Cell["Column Two:\nmore text", "Text"]}}, ColumnsEqual -> True, 
    ColumnSpacings -> 2, ColumnAlignments -> Left, 
    ColumnWidths -> Dynamic[First[WindowSize /. Options[EvaluationNotebook[]]]/(2*18)]]], 
  "Text"] // CellPrint

Or you can have text on the left an input/output on the right

Cell[BoxData[GridBox[{
     {Cell["Column One:\nsome text", "Text"], Cell[BoxData[RowBox[{"1", "+", "1"}]], "Input"]},
     {"\[SpanFromAbove]", Cell[BoxData["2"], "Output"]}}, 
    ColumnsEqual -> True, ColumnSpacings -> 2, ColumnAlignments -> Left, 
    ColumnWidths -> Dynamic[First[WindowSize /. Options[EvaluationNotebook[]]]/(2*18)]]], 
  "Text"] // CellPrint

Note that I've only done a dodgy conversion from pixels to em by dividing the former by 18. The true conversion will be system and font dependent. Also, just adding CellLabels to the input and output cells does not work. So the In[n]:= Out[n]= might need to be added manually using a small middle column.

Finally, it should be possible to construct something like the bilateral cell code used by the author tools package that grabs a Text/MathCaption cell followed by an Input and Output cell and combines them into a two-column construction.

这篇关于mathematica中的2列文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆