在Mma (v.11)中粘贴时,回车符和某些空格似乎消失了。例如,当我在word中剪切以下文本(格式如下)时:
xmin = 0; xmax = 1;(*x-axis domain*)
ymin = 0; ymax = 1;(*y-axis domain*)
zmin = 0; zmax = 1;(*z-axis domain*)
E1 = x > 0 && y > 0 && z > 0 && x + y + z < 1;(*domain of solid region E1*)
RegionPlot3D[E1, {x,xmin, xmax}, {y, ymin, ymax}, {z, zmin, zmax},
PlotPoints -> 50,
AxesLabel -> {"x", "y", "z"},
PlotLabel -> "Solid Region E",
ImageSize -> Small]结果是这样的,这是不理想的:
xmin = 0;
xmax = 1;
(*x-axis domain*)ymin = 0;
ymax = 1;
(*y-axis domain*)zmin = 0;
zmax = 1;
(*z-axis domain*)E1 = x > 0 && y > 0 && z > 0 && x + y + z < 1;
(*domain of solid region E1*)
RegionPlot3D[E1, {x,xmin, xmax}, {y, ymin, ymax}, {z, zmin, zmax},PlotPoints -> 50,
AxesLabel -> {"x", "y", "z"},PlotLabel -> "Solid Region E",ImageSize -> Small]在程序之间复制和粘贴时,有没有办法保持返回和空格。请给我建议。
谢谢,K
发布于 2016-12-10 07:27:39
不是特别直接:
创建一个空单元格,选择它。进入菜单:格式>样式>程序。将您的代码粘贴到单元格中,选择单元格并将样式转换回:格式>样式>输入。
最好是格式化你的how-to文档,使其粘贴到Mathematica中而不进行更改。
发布于 2016-12-10 03:30:40
在Word中抓取文本并将其放入剪贴板
启动Mathematica
在笔记本内单击鼠标左键
键入x(或任何其他字符)
右键单击包含x的笔记本右侧的单元格括号
轻轻地向下滑动鼠标至Style,然后滑过至左键单击文本
将x划过以将其突出显示
将剪贴板粘贴到Mathematica中,替换x
右键单击包含表达式的notebook右侧的单元格括号
轻轻地向下滑动鼠标至Style,然后滑过至左键单击输入
你的表达式将在Mathematica中使用,同时保留你的返回值和空格。
https://stackoverflow.com/questions/41066453
复制相似问题