有没有办法在 Mathematica 中使用 [[ 和 ]] 作为 Part 吗? [英] Is there a way around using [[ and ]] for Part in Mathematica?

查看:15
本文介绍了有没有办法在 Mathematica 中使用 [[ 和 ]] 作为 Part 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法避免必须执行 ⋮[[⋮ 来获得 Part 的那些漂亮的括号?

Is there a way to avoid having to do ⋮[[⋮ to obtain those great looking brackets for Part?

有没有办法在你运行一个函数或定义后自动完成?

Is there a way for this to be done automatically after you ran a function or a definition ?

推荐答案

我在 /Applications/Mathematica.app/SystemFiles/FrontEnd/TextResources/Macintosh/KeyEventTranslations.tr 中添加了以下内容我用组合键输入双括号.您可以通过修改文件(在您的操作系统上的任何位置)来执行相同的操作.我首先从 Szabolcs's 网站 这里.他那里有其他数学相关的东西可能对你有帮助.

I have the following addition in /Applications/Mathematica.app/SystemFiles/FrontEnd/TextResources/Macintosh/KeyEventTranslations.tr which lets me enter double brackets with key combinations. You can do the same by modifying the file (where ever it is on your OS). I first learnt of this from Szabolcs's website here. He has other mathematica related stuff there that might be of help to you.

添加的命令有:

  • Ctrl+[
  • Ctrl+]
  • 〚〛 with Ctrl+Alt+]
  • with Ctrl+[
  • with Ctrl+]
  • 〚〛 with Ctrl+Alt+]

KeyEventTranslations.tr 文件中列出的等效项是:

Equivalents, as listed in the KeyEventTranslations.tr file are:

修饰符可以是Shift"、Control"、Command"、Option"

Modifiers can be "Shift", "Control", "Command", "Option"

对于 Macintosh:Command" = 命令键,Option" = 选项键

For Macintosh: "Command" = Command Key, "Option" = Option Key

对于 X11:命令"= Mod1,选项"= Mod2

For X11: "Command" = Mod1, "Option" = Mod2

对于 Windows:Command" = Alt,Option" = Alt

For Windows: "Command" = Alt, "Option" = Alt

在上述文件中的 EventTranslations[{ 之后插入以下内容.

Insert the following after EventTranslations[{ in the above file.

(* Custom keyboard shortcuts *)
    Item[KeyEvent["[", Modifiers -> {Control}],
        FrontEndExecute[{
            FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
                "[LeftDoubleBracket]", After]
        }]],
    Item[KeyEvent["]", Modifiers -> {Control}],
        FrontEndExecute[{
            FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
                "[RightDoubleBracket]", After]
        }]], 
    Item[KeyEvent["]", Modifiers -> {Control, Command}],
        FrontEndExecute[{
            FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
                "[LeftDoubleBracket]", After],
            FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
                "[RightDoubleBracket]", Before]
        }]], 

<小时>

你不是唯一一个被它激怒的人.这是我试图避免伸展击球的尝试Esc 通过将 Caps lock 映射到 Esc.巫师先生也有 一对 questions[[ 的转换有关到.


You're not the only one who's peeved by it. Here's my attempt to avoid having to stretch to hit Esc by mapping Caps lock to Esc. Mr. Wizard also had a couple of questions related to conversion of [[ to .

这篇关于有没有办法在 Mathematica 中使用 [[ 和 ]] 作为 Part 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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