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:
I tried investigating a bit into MathPSfrag.m file, and found the following:
FilterOptionsis replaced by
FilterRulesin version 10. Hence, I replaced all the commands with
FilterOptionsfunctions with the
FilterRulesfunction, but with the right syntax.
Despite the above step, I get an error saying that
FilterRulesfunction needs two arguments. So I checked the
HandleAutomaticPSfragfunction defined in the package file, which is defined as
HandleAutomaticPSfrag[gr_Graphics,opts___Rule]:= ...and realized that there is a
opts___argument that denotes a
FilterRulesas an example is used within this function as as
FilterRules[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 the
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?