zoukankan      html  css  js  c++  java
  • 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使得宏生效。

  • 相关阅读:
    andorid自己定义ViewPager之——子ViewPager滑到边缘后直接滑动父ViewPager
    MTK Camera驱动移植
    云计算VDI相关职位招聘
    Android内存泄露之开篇
    关于ping以及TTL的分析
    STL之关联容器的映射底层
    STL非变易算法
    自己主动更新 -- 版本比較(2)
    activiti自己定义流程之Spring整合activiti-modeler5.16实例(四):部署流程定义
    合并多个文本文件方法
  • 原文地址:https://www.cnblogs.com/Lewis_Liu/p/Winedt_macros_add.html
Copyright © 2011-2022 走看看