5

3

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 by`FilterRules`

in version 10. Hence, I replaced all the commands with`FilterOptions`

functions with the`FilterRules`

function, but with the right syntax.Despite the above step, I get an error saying that

`FilterRules`

function needs two arguments. So I checked the`HandleAutomaticPSfrag`

function 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`BlankNullSequence`

. The`FilterRules`

as 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`FilterRules`

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!

1

You could instead look at LevelScheme and/or SciDraw

– dr.blochwave – 2014-08-06T17:10:59.570Thank you Blochwave! I downloaded the packages and skimmed through the user guides. It looks promising, but before I dig into more details of these packages and start using them, could you please tell me if the text formatting of the labels have Computer Modern fonts as used by Latex with the default font encoding, family and series used for the text and Math symbols respectively in LaTeX? – Ameya – 2014-08-06T17:48:37.023

I'm afraid I don't know, you'll have to check yourself. – dr.blochwave – 2014-08-06T17:51:24.950

Well, this is a pretty cool package and I didn't know about it. I just published an alternative package, MaTeX, which also makes it easy to use LaTeX labels.

– Szabolcs – 2015-03-07T00:01:34.797