# Gmtplot\_latex\_eps: Running error

**URL:** <https://forum.generic-mapping-tools.org/t/gmtplot-latex-eps-running-error/3265>\
**Category:** Q&A\
**Created:** [September 12, 2022, 11:48am UTC](https://forum.generic-mapping-tools.org/t/gmtplot-latex-eps-running-error/3265 "2022-09-12T11:48:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![adakite](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/adakite/32/2475_2.png) [@adakite](https://forum.generic-mapping-tools.org/u/adakite)\
**Post date:** [September 12, 2022, 11:48am UTC](https://forum.generic-mapping-tools.org/t/gmtplot-latex-eps-running-error/3265/1 "2022-09-12T11:48:11Z")

</div>

Hi  
I try to make a legend with some Greek symbols and got such error:

```
dvips: DVI file can't be opened: gmt_eq.dvi: No such file or directory
text [ERROR]: gmtplot_latex_eps: Running "sh gmt_eq.sh" returned error 256.
text [ERROR]: gmtplot_latex_eps: Please run it manually to learn what LaTeX packages you are missing.
text [ERROR]: gmtplot_latex_eps: The script and logs can be found here: /var/folders/hm/n_tqlkfd6b16smck88w5q12w0000gn/T/gmt_latex_PMjLL2
text [ERROR]: gmt_map_text: Conversion of LaTeX to EPS failed

```

here is the line that causes the problem:

`S 0.1i c .4c white 0.5p,snow3,- 0.3i x = cos(@%12%a@%%)`

I tried with other way for LaTeX ( and @[) same issue.

Any hint?

Thanks

NB: Running macOS, gmt installed with homebrew and TexLive is installed. All the system is up-to-date.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 12, 2022, 1:16pm UTC](https://forum.generic-mapping-tools.org/t/gmtplot-latex-eps-running-error/3265/2 "2022-09-12T13:16:40Z")

</div>

Does this line work for you ?

```auto
gmt basemap -R0/1/0/1 -JX10c -Bafg -B+t"@[\cos(x)@[" -png test

```

(should produce just a “cos(x)” png)

---

<div class="post-metadata">

**Author:** ![adakite](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/adakite/32/2475_2.png) [@adakite](https://forum.generic-mapping-tools.org/u/adakite)\
**Post date:** [September 12, 2022, 1:36pm UTC](https://forum.generic-mapping-tools.org/t/gmtplot-latex-eps-running-error/3265/3 "2022-09-12T13:36:38Z")

</div>

Hey, yes the example you gave me works, I got the png with cos(x) and a grid below.

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [September 13, 2022, 4:17am UTC](https://forum.generic-mapping-tools.org/t/gmtplot-latex-eps-running-error/3265/4 "2022-09-13T04:17:22Z")

</div>

@adakite Could you please post your full example or a minimal example so that it’s easier for us to reprodue?

---

<div class="post-metadata">

**Author:** ![adakite](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/adakite/32/2475_2.png) [@adakite](https://forum.generic-mapping-tools.org/u/adakite)\
**Post date:** [September 14, 2022, 8:50am UTC](https://forum.generic-mapping-tools.org/t/gmtplot-latex-eps-running-error/3265/5 "2022-09-14T08:50:14Z")

</div>

Here is an example that generates the issue:

```
gmt begin legend
gmt set FONT_ANNOT_PRIMARY 12p
gmt legend -R0/10/0/10 -JM6i -Dx0.1i/0.1i+w4i+jBL+l1.2 -C0.1i/0.1i << EOF

G 0.1i
H 14p,AvantGarde-Book Legend
N 2
V 0 1p
G 0.15i
S 0.1i c .8c white 0.5p,snow3,- 0.3i
G -0.2i
S 0.1i c .6c white 0.5p,snow3,- 0.3i
G -0.2i
S 0.1i c .4c white 0.5p,snow3,- 0.3i x = cos(@%12%a@%%)

EOF
gmt end show
```

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 14, 2022, 12:13pm UTC](https://forum.generic-mapping-tools.org/t/gmtplot-latex-eps-running-error/3265/6 "2022-09-14T12:13:48Z")

</div>

With Latex and “symbols” (`%@12%symbol letter@%%` should work. Else, the [octal code](https://docs.generic-mapping-tools.org/dev/cookbook/octal-codes.html?highlight=octal+code) for alpha is \141)

```auto
gmt begin legend
gmt set FONT_ANNOT_PRIMARY 12p
gmt legend -R0/10/0/10 -JM6i -Dx0.1i/0.1i+w4i+jBL+l1.2 -C0.1i/0.1i << EOF

G 0.1i
H 14p,AvantGarde-Book Legend
N 2
V 0 1p
G 0.15i
S 0.1i c .8c white 0.5p,snow3,- 0.3i
G -0.2i
S 0.1i c .6c white 0.5p,snow3,- 0.3i
G -0.2i
S 0.1i c .4c white 0.5p,snow3,- 0.3i @[x = \cos(\alpha)@[
S 0.1i c .4c white 0.5p,snow3,- 0.3i x = cos(@%12%\141@%%) 
S 0.1i c .4c white 0.5p,snow3,- 0.3i x = cos(@%12%a@%%) 

EOF
gmt end show

```

 ![legend](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/b/b2432612c6319f7dbfac3ea849ead387b5899f35.png)

---

<div class="post-metadata">

**Author:** ![adakite](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/adakite/32/2475_2.png) [@adakite](https://forum.generic-mapping-tools.org/u/adakite)\
**Post date:** [September 15, 2022, 11:47am UTC](https://forum.generic-mapping-tools.org/t/gmtplot-latex-eps-running-error/3265/7 "2022-09-15T11:47:00Z")

</div>

Yeah but the issue I post, is what I get instead.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 15, 2022, 1:27pm UTC](https://forum.generic-mapping-tools.org/t/gmtplot-latex-eps-running-error/3265/8 "2022-09-15T13:27:53Z")

</div>

With the 3 different methods I provided ?
