mathematica中的2列文档

jml*_*pez 12 formatting layout wolfram-mathematica

Mathematica可用于编写非常好的文档.有谁知道是否可以写2列文件?如果是这样,您是否可以提供一些示例或指向显示此样式的其他笔记本的链接.

Sim*_*mon 8

我认为Mathematica不支持任何好的多列实现 - 它与笔记本界面的结构并不完全兼容.publicon不支持正确的多列这一事实可能是Mathematica没有的好提示.

问:Publicon是否支持多列布局?

Publicon文档面向垂直滚动范例,非常类似于HTML,而不是页面布局程序中的逐页配置.可以在表中配置多个列,但不能将其维护为流.Publicon的重点是文档结构,允许干净地翻译成LaTeX或XML以提交给发布者.然后,发布者可以使用利用其自己的特定格式的页面布局工具来生成符合其自身规范的单列或双列布局.

当然,虽然可以使用像Bilateral Cells这样的黑客(Verbia的答案中提到的作者工具包的一部分).

下面是一些生成两列文本单元格的代码,它会将列大小调整为窗口大小 - 但文本不会从一列流向另一列.生成单元格后,您可以按正常方式键入单元格.

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
Run Code Online (Sandbox Code Playgroud)

2 col文本

或者您可以在左侧输入文本右侧的输入/输出

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
Run Code Online (Sandbox Code Playgroud)

2进/出

请注意,我只是通过将前者除以18来完成从像素到em的狡猾转换.真正的转换将取决于系统和字体.此外,只是将CellLabels 添加到输入和输出单元格不起作用.因此In[n]:= Out[n]=可能需要使用小型中间列手动添加.

最后,应该可以构造类似于作者工具包使用的双边单元代码,它抓取Text/MathCaption单元,然后是输入和输出单元,并将它们组合成两列结构.


Chr*_*nen 8

Graphics和Inset可用于布局,例如: -

text = StringTake[ExampleData[{"Text", "Prufrock"}], {226, 931}];
columntext1 = StringTake[text, 350];
columntext2 = StringTake[text, {348, 706}];
column1 = Graphics[{White, Rectangle[{0, 0}, {150, 210}], Black,
    Inset[TextCell[columntext1,
      LineSpacing -> {0, 16}, TextJustification -> 1],
     {0, 210}, {Left, Top}, {150, Automatic}]},
   PlotRange -> {{0, 150}, {0, 210}},
   BaseStyle -> {FontFamily -> "Times", 
         FontWeight -> "Plain", FontSize -> 13}];
column2 = Graphics[{White, Rectangle[{0, 0}, {150, 210}], Black,
    Inset[TextCell[columntext2,
      LineSpacing -> {0, 16}, TextJustification -> 1],
     {0, 210}, {Left, Top}, {150, Automatic}]},
   PlotRange -> {{0, 150}, {0, 210}},
   BaseStyle -> {FontFamily -> "Times", 
         FontWeight -> "Plain", FontSize -> 13}];
image = ExampleData[{"TestImage", "House2"}];
clippedimage = Graphics[{Blue, Rectangle[{0, 0}, {500, 270}],
    Inset[image, {250, 170}, {Center, Center}, {512, 512}]},
   PlotRange -> {{0, 500}, {0, 270}}, ImageSize -> 500];
Graphics[{White, Rectangle[{0, 0}, {330, 400}],
  Inset[column1, {75, 295}, {Center, Center}, {150, 210}],
  Inset[column2, {255, 295}, {Center, Center}, {150, 210}],
  Inset[clippedimage, {165, 90}, {Center, Center}, {330, 179}]},
 PlotRange -> {{0, 330}, {0, 400}}, ImageSize -> 330]
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述


Ver*_*eia 4

这显然可以使用版本 5 的AuthorTools包来实现(请参阅Mathematica 用户 wiki 中的此参考)。

然而,版本8中没有这样的调色板,“写作助手”调色板和选项检查器似乎都没有相关选项。

也许可以使用其中的Grid文本样式来做一些事情,但我怀疑这会很简单。Cells

  • 这是[双边单元格](http://reference.wolfram.com/legacy/v5_2/Add-onsLinks/AuthorTools/PaletteInterface/MakeBilingualCells/CreatingBilingualCellsPalette.html)的链接,显示了过去可能发生的情况... (3认同)