• Winedt10 添加自定义宏


    Winedt10 添加自定义功能,并在toolbar上添加快捷命令

    功能描述:
    用宏实现latex+bib参考文献的一键编译。

    Remark: The toolbar is the most visible and commonly used interface to many actions (especially by new users). However, a toolbar button is just an interface to invoke the associated menu item. The functionality and properties of such a button are provided through the corresponding menu item definition. This being explained, you should realize that a report "LaTeX button does not work" doesn't make sense. Buttons are there to look pretty and provide an easy interface to commonly used menu items.

    此段来自Winedt10的帮助文档,总结起来就是说,toolbar上的button项目是Main Menu中的快捷方式罢了,toolbar上所有的的项目的定义均来自Main Menu。所以想定义新的功能键,就必须先在Main Menu中实现该功能。

    IMPORTANT: After you make changes to any particular script you must use the Load Current Script command (the first button in the Options Interface toolbar or the context popup menu) to make the changes effective immediately. It is not necessary, nor is it enough to merely restart WinEdt. In fact, no scripts are loaded at startup: the compiled raw data is stored in WinEdt.dnt (Do Not Touch). This significantly reduces the startup time and reduces the likelihood of error messages during startup.

    此段是说,在修改了任何一个配置文件后,都要手动加载修改过后的配置文件。方法是:Load Current Script in the Options Interface toolbar(Option interface的左上角的一个很小的按钮)

    进入main Menu配置文件 MainMenu.ini

    实现功能代码放在文件OneClickBuild.edt中,内容如下:

    Exe('%bExecTeXLaTeX.edt');
    Exe('%bExecTeXBibTeX.edt');
    Exe('%bExecTeXLaTeX.edt');
    Exe('%bExecTeXLaTeX.edt');
    Exe('%bExecTeXdvi2pdf.edt');
    

    Winedt调用该功能代码如下:

    ITEM="OneClickBuild"
    CAPTION="&OneClickBuild"
    IMAGE="Play1"
    MACRO="Exe('%bConfigOneClickBuild.edt');" 
    

    然后,再进入到Toolbar.ini配置文件,添加一个快捷命令(Button),代码
    如下:

      BUTTON="OneClickBuild"
    

    至此就完成了新功能的添加。
    最后别忘了 右击MainMenu.ini选load script使得宏生效。

  • 相关阅读:
    cnblogs 博客园下载工具
    SQL 排序规则 CodeProject
    SQL 排序规则问题
    Datatbel和 string之间的相互转换
    C#三步实现标准事件处理程序
    利用C#来做ASP.NET的登陆页面
    C#用panel实现子窗体的切换
    C#中split分隔字符串的应用
    C#.NET 用程序画图,曲线图
    C#中消息的工作流程
  • 原文地址:https://www.cnblogs.com/Lewis_Liu/p/Winedt_macros_add.html
Copyright © 2020-2023  润新知