I am interested to use LaTeX like labels in the plots that I prepare in Mathematica, and hence, I downloaded the MathPSfrag package from this website http://wwwth.mpp.mpg.de/members/jgrosse/mathpsfrag/ . Since I cannot attach any file here, I request anyone who is interested to help me, to download the package and run the MathPsfrag-Test.nb notebook. I apologize if the manner in which I am asking the question violates any code of conduct, but since I am new to this group, and because there are multiple files involved with long codes, I am not entirely sure about how else to ask.
This package has been tested only up to version 6, and I am using Mathematica 10 on Windows 7 machine. Unfortunately the package does not work, and I tried finding the problem and any solution to it myself, but without much success. Here is a summary of what I have found.
After unzipping the contents on the package, I followed the instructions and tried running the MathPSfrag-Test.nb notebook line by line. First and foremost I realized that the Windows 7 has a space in their folder names like Program Files, where all programs are installed, and hence, I gave the absolute path to the GhostScript executable, after which the MathPSfragConfigurationTest[]
was successful. After that I started executing the notebook step-by-step, and got stuck at the command:
CreatePSfragRules[HandleAutomaticPSfrag[exampleplot]][[1]]
I tried investigating a bit into MathPSfrag.m file, and found the following:
The Utilities
FilterOptions
is replaced byFilterRules
in version 10. Hence, I replaced all the commands withFilterOptions
functions with theFilterRules
function, but with the right syntax.Despite the above step, I get an error saying that
FilterRules
function needs two arguments. So I checked theHandleAutomaticPSfrag
function defined in the package file, which is defined asHandleAutomaticPSfrag[gr_Graphics,opts___Rule]:= ...
and realized that there is aopts___
argument that denotes aBlankNullSequence
. TheFilterRules
as an example is used within this function as asFilterRules[opts, Options @ HandleAutomaticPSfrag]
By using the
HandleAutomaticPSfrag[exampleplot]
command in the Test notebook, there seem to be no opts provided as a second argument, and this is where I think theFilterRules
gets stuck.
However, if my explanation of the opts___
above is correct, then I do not understand how the old versions of Mathematica were able to run the package. This makes me feel that I am missing something obvious. Could someone please help me changing the package so that I can also use it with version 10?
Thanks!
Comments
Post a Comment