RSS

 
WinEdt Macro Library  | LaTEX previous macro  | next macro

MP-mpsproof / MP-current-fig

Description

MP-mpsproof.edt is a macro for producing proof sheets of MetaPost figures. An existing macro package, MPPreview, already performs this function. The minor differences between the macros are: (i) MP-mpsproof is slightly faster, by creating a pdf file directly via pdftex, rather than going through LaTEX and dvips; (ii) MPPreview has some options. MP-mpsproof makes use of the code in mpsproof.tex.

MP-current-fig.edt executes MetaPost, then immediately displays the "current figure" in GSView. The "current figure" is determined by the current position of the cursor in the .mp file. (The macro finds the most recently issued beginfig command.) The output is readable due to an internal issuance of the prologues:=3 command (hence you must be using a sufficiently recent version of MetaPost). This setting is overridden if the user (re)issues a prologues command in the .mp file.

Installation of MP-mpsproof

  1. Download MP-mpsproof.zip, and extract it to %b\Macros\LaTeX\.
  2. Create a new menu item (perhaps named MetaPost - proofs) consisting of this macro:
    Exe('%b\Macros\LaTeX\MP-mpsproof.edt','%p');
    with
    Requires File Filterset to: %p\%n.mp
    Start inset to: %p
    Requires a documentchecked
    Set Folder to 'Start in'checked.
    Save Input file to Diskchecked.

If you set your MetaPost files as Main Files, you should use %P\%N-type variables; however you also will have to edit the macro, and replace %p and %n appropriately.

When you have a MetaPost file open, this menu item will produce a preview of all of the figures within that file.

  • Only figure numbers up to 200 are displayed. The macro can be edited to handle more: Replace "200" with a higher number.
  • Your output files must have the default extensions: filename.1, filename.2, etc. (i.e. you cannot use the "filenametemplate" variable to change extensions to .mps or .eps). Advanced users should be able to edit the macro to accommodate certain variations on file names.
  • pdftex must be in your PATH, and GSView must be installed.
  • Option: Filenames, datestamps and page numbers can be omitted from the resulting pdf file by a simple change to the macro file. (Search for the string "noheaders" in MP-mpsproof.edt to find the appropriate line to edit.)

Installation of MP-current-fig

Follow exactly the same instructions as above, except you should point your menu item toward the file MP-current-fig.edt.

  • Your output files must have the default extensions: filename.1, filename.2, etc. Advanced users should be able to edit the macro to accommodate certain variations on file names.
  • Bug: if your file contains a beginfig() command within a commented area, that can cause the macro to open the wrong file in GSView. Solution: don't have commented beginfig() commands.

Download

LaTeX\MP-mpsproof.zip (version: 2007 June 02)

Macro contributed by Jim Schummer <schummernorthwestern.edu>

WinEdt Macro Library  | LaTEX previous macro  | next macro