开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 0

texmacs/GNU TeXmacs plugins in Python

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
main
分支 (1)
main
main
分支 (1)
main
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
main
分支 (1)
main
plugins-in-python
/
plugins
/
python
/
doc
/
python-instructions.en.tm
plugins-in-python
/
plugins
/
python
/
doc
/
python-instructions.en.tm
python-instructions.en.tm 4.52 KB
一键复制 编辑 原始数据 按行查看 历史
Darcy Shen 提交于 2022年10月02日 16:32 +08:00 . Re-implement the Python plugin (#5)
<TeXmacs|1.99.2>
<style|tmdoc>
<\body>
<tmdoc-title|Usage of the Python Plugin>
Separate statements by using <key|shift return>. When you are ready to have
<name|Python> evaluate your input press <key|return>. \ If you would like
this behaviour reversed select <menu|Focus|Input options|Multiline input>.
The plugin has the following features:
<paragraph|Autocompletion>Type the fist letters of a built-in command or a
command you have previously defined and then press <key|tab> until you find
a completion of your choice.
<paragraph|<name|PostScript> output and <python|matplotlib> support>Use the
function <python|ps_out (data)> to output <name|PostScript> data directly
to <TeXmacs>:
<\itemize>
<item>If the <verbatim|data> is a string and has more than one line, it
will be processed as raw <name|PostScript> data.
<item>If <verbatim|data> is a simple string, it is assumed to contain the
filename of a <name|PostScript> file which will be read (if the file has
no extension, the defaults <verbatim|.eps> and <verbatim|.ps> will be
tried in that order).
<item>If <verbatim|data> is an instance of
<python|matplotlib.pyplot.Figure> and <strong|only if additionally> a
backend supporting output to (encapsulated) <name|PostScript> is being
used, then the plugin will call <python|data.savefig()> to save the plot
to a string and copy it into the <TeXmacs> document. See <hlink|the
examples section|python-demo.en.tm>.
<item>If <verbatim|data> is a file or other object which provides a
'<verbatim|read>' method, the <name|PostScript> data will be obtained by
calling such method.
</itemize>
<paragraph|Help window>Type any name followed by a question mark <key|?> to
have a popup window with the associated <python|help()> as well as the code
if it is available through <python|inspect.getsource()>. For instance:
<\session|python|default>
<\input>
\<gtr\>\<gtr\>\<gtr\>\
<|input>
ps_out?
</input>
</session>
<paragraph|Usage as a scripting language>Selecting the menu item
<menu|Insert|Fold|Executable|Python> will produce the following output:
<script-input|python|default||>. You may enter any <name|Python> expression
or statement in the yellow box, e.g <script-input|python|default|1+2|3>.
Hitting <shortcut|(kbd-return)> inside the box will alternate between the
unevaluated input and the evaluated output.
For more complex code you can use <shortcut|(kbd-shift-return)> to enable
multi-line input. Note however that <em|expressions> (e.g. <python|1+2>),
<python|>are evaluated using <python|eval()> and the resulting value is
sent to <TeXmacs>, whereas <em|statements> (e.g. <python|print "hi there">,
or <python|a=1;a=a+2>) are sent to <python|compile()> and in doing this,
the return value of the last statement is lost. Therefore, in case you have
more than one expression you need to write to <python|os.sys.stdout> in
order to see the output inline: <script-input|python|default|a=1;a=a+2;print
a|3> will print <script-output|python|default|a=1;a=a+2;print a|3> but
<script-input|python|default|a=1;a=a+2|3> will print nothing. This
limitation may be fixed in the future.
Additionally, after selecting <menu|Document|Scripts|Python>, you may also
insert <em|executable input fields> using <shortcut|(make-calc-input)> or
<menu|Insert|Link|Executable input field> (again, pressing <key|return>
alternates between evaluated and unevaluated input). These have identifiers
associated which may be referred to in other fields by inserting a
<em|field reference> using <shortcut|(make 'calc-ref)> or
<menu|Insert|Link|Field reference>. Plain <em|input fields> are also
available using <shortcut|(make-calc-inert)> or <menu|Insert|Link|Input
field>. This allows for dynamic documents which automatically run the
scripts after changes to the referred fields. See ``Plug-ins as scripting
languages'' in the <TeXmacs> documentation for more on this topic.
<tmdoc-copyright|2004, 2014|Adrián Soto|Miguel de Benito Delgado>
<tmdoc-license|Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled "GNU Free
Documentation License".>
</body>
<\initial>
<\collection>
<associate|page-type|letter>
</collection>
</initial>
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

Plugins in Python
暂无标签
GPL-3.0
使用 GPL-3.0 开源许可协议
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/texmacs/plugins-in-python.git
git@gitee.com:texmacs/plugins-in-python.git
texmacs
plugins-in-python
GNU TeXmacs plugins in Python
main
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /