UltraEdit-32 and LaTeX

技术文档   2009-05-04 11:24   阅读33   评论0  
字号:    

This guide shows you how to set up UltraEdit-32 for use with LaTeX. UltraEdit-32 is not a LaTeX graphical user interface nor a dedicated LaTeX editor, but a powerful text editor with features such as syntax highlighting, user tools, templates, regular expression search and replace, auto-completion, function list, code folding and macros. UltraEdit-32 doesn't provide any symbol repository so you have to be comfortable writing most of the LaTeX code on your own (templates aside).

This guide assumes you have already installed MiKTeX and UltraEdit-32. The screenshots are from version 12.10b of UltraEdit-32.

Adding the user tools

First of all start UltraEdit-32 and go to Advanced > Tool Configuration...

The LaTeX DVI tool

  • Insert these values into the appropriate fields:
    • Menu Item Name: Something like de>LaTeX DVIde>
    • Command Line: de>texify.exe --clean --src --run-viewer "%n.tex"de>
      de>--cleande> removes all temporary and unneccesary files created during compilation.
      de>--srcde> makes the compiler include source file information in the DVI file (to enable inverse search).
      de>--run-viewerde> does exactly that.
    • Working Directory: de>%pde>
    • Toolbar bitmap/icon (file path): Whatever icon you prefer.
  • Now, click the tab named 'Options' and make make sure these choices are made:
    • Program type: Should be 'DOS Program' since de>texify.exede> is a DOS program.
    • Check 'Save active file'. This option forces UltraEdit-32 to save the file you are working on before it is compiled.
  • Then, click the tab named 'Output' and make these choices:
    • Command Output (DOS commands): 'Output to List Box'.
    • Check 'Cature Output'.
    • Replace selected text with: 'No Replace'.
  • Click 'Apply' to accept these settings.
Note: The de>--srcde> option causes YAP to place small gray circles at the beginning of every paragraph.

The LaTeX PDF tool

  • If you want to be able to create PDF files in a jiffy -- add these values to the fields:
    • Menu Item Name: Something like de>LaTeX PDFde>
    • Command Line: de>texify.exe --clean --quiet --pdf --run-viewer "%n.tex"de>
    • de>--quietde> supresses all compiler output.
      de>--pdfde> makes a Word .doc file instead of a DVI. Yeah, right.
    • Working Directory: de>%pde>
    • Toolbar bitmap/icon (file path): Whatever icon you prefer.
  • The 'Options' and 'Output' tabs should be set up the same way as for the LaTeX DVI Tool.
  • Click 'Apply' to accept the settings of your new LaTeX PDF tool.

The LaTeX Forward Search tool

  • A forward search just means passing along a line number to the DVI viewer thus making it jump directly to the corresponding paragraph in the DVI file. For large documents this feature is isdispensable. To add this tool insert these values into the appropriate fields:
    • Menu Item Name: Something like de>LaTeX DVI Forward Searchde>
    • Command Line: de>texify.exe --clean --src --run-viewer --viewer-opt="-1 -s %line%%N.tex" "%n.tex"de>
      de>--viewer-optde> passes the text between the quotation marks as parameters to the DVI viewer.
      de>-1de> and de>-sde> are parameters understood by the default viewer, YAP.
    • Working Directory: de>%pde>
    • Toolbar bitmap/icon (file path): Whatever icon you prefer.
  • The 'Options' and 'Output' tabs should be set up the same way as for the LaTeX DVI Tool.
  • Click 'Apply' to accept these settings.

You can rearrange the order of the tools using the 'Up' and 'Down' buttons.
Note: Be sure to press 'OK' when you're finished or else none of your tools will be saved.

Key Mapping

UltraEdit-32 has already provided your new tools with shortcut keys, but you may want to change them to more sensible ones. Here's how:

  • Go to Advanced > Configuration... > Key Mapping.
  • In the 'Commands' list box select 'AdvancedUserTool1'.
  • Select 'Ctrl+Shift+1' in the 'Existing Keys' list box and click 'Remove'.
  • Place the cursor inside the 'Press New Key' field and press a suitable combination. Most of the 'Ctrl+Alt+' combinations are unassigned. 
  • Click 'Assign' and then repeat the steps for the rest of your custom tools ('AdvancedUserTool2' and 'AdvancedUserTool3').
  • Click 'OK' to save your custom Key Mapping.

Adding the tools to the toolbar

You may want to add your new tools to your toolbar. To do this follow these steps:

  • Go to Advanced > Configuration... > Toolbars / Menus > Customization
  • Click the 'Customize Toolbar' button to open the Toolbar dialog.
    • In the left list box, scroll down and select the last element in the list.
    • Add 'UserTool2' and 'UserTool3' the same way.
    • If you want to separate your custom tools from the neighbouring tools on the toolbar, add a separator (found at the top of the list in right list box) the same way as with your tools. Change the order with the up/down arrow buttons in the middle.
    • Click 'OK' to save your custom toolbar.
  • Your tools should now appear on the Toolbar. If you can't find them, right-click on any tool and select 'Basic' from the popup menu.

Syntax highlighting

It's a shame and a sin, but UltraEdit-32 does a poor job syntax highlighting LaTeX source. An useful wordfile that are available here. Append the content of this file to the end of your de>wordfile.txtde> found in the UltraEdit-32 program directory. As you can see, the first line starts with de>/L20de>, indicating that this is language number 20. If you don't already have 19 languages in your wordfile you may want to change this number. If you go to View > View As (Highlighting File Type) you can get the number of the next available language (Language ##). If you haven't added any languages before the number is most likely 12.

Inverse search

The standard DVI viewer, YAP, makes it possible to do inverse searches. This means that you can right click anywhere in the DVI file and by selecting 'Edit TeX Source' be placed near the corresponding paragraph in UltraEdit. To enable this feature follow these steps:

  • Go to View > Options... > Inverse Search.
  • Insert this in the 'Command line'-field: de>uedit32.exe "%f/%l/5"de>
    The number de>5de> indicates that UltraEdit-32 should place the cursor in column 5.
  • Click 'OK'.

This guide was put together by Thor Chr. Jacobsen.
If you have any remarks, corrections, suggestions or other feedback please feel free to contact him.

评论(?)
阅读(?)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
网易公司版权所有 ©1997-2009