# Printing letter C with caron

**URL:** <https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870>\
**Category:** Q&A\
**Created:** [May 6, 2024, 12:57pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870 "2024-05-06T12:57:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [May 6, 2024, 12:57pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/1 "2024-05-06T12:57:10Z")

</div>

I need to annotate some maps that have the letter “c” with a caron (upside-down hat). This letter is commonly used in Czech, Slovak, Serbo-Croation, etc. languages.

I do not see an octal code for this character. How can it be printed within GMT?

---

<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:** [May 6, 2024, 1:04pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/2 "2024-05-06T13:04:02Z")

</div>

Do you have Latex installed ?

---

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [May 6, 2024, 1:12pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/3 "2024-05-06T13:12:10Z")

</div>

I have TeXShop installed. Will that do?

---

<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:** [May 6, 2024, 1:15pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/4 "2024-05-06T13:15:42Z")

</div>

> [@John\_Geodesy](#):
>
> . Will that do?

Check it:

```auto
gmt begin GMT_latex
	gmt set GMT_THEME cookbook
	gmt basemap -R-200/200/0/2 -JX15c -Bxaf+l"@[\nabla^4 \psi - \Delta \sigma_{xx}^2@[ (MPa)" -BS
gmt end show

```

---

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [May 6, 2024, 1:26pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/5 "2024-05-06T13:26:55Z")

</div>

I get a nice scale bar with some text below. So I guess I have it! Never used LaTeX before!

---

<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:** [May 6, 2024, 1:53pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/6 "2024-05-06T13:53:06Z")

</div>

Now you can try `"@[\v{c}@["`

---

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [May 6, 2024, 2:07pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/7 "2024-05-06T14:07:29Z")

</div>

I tried taking your expression and including the c-caron:

```auto
gmt begin GMT_latex
	gmt set GMT_THEME cookbook
	gmt basemap -R-200/200/0/2 -JX15c -Bxaf+l"@[ \v{c} \nabla^4 \psi - \Delta \sigma_{xx}^2@[ (MPa)" -BS
gmt end show

```

But nothing appears like a “č”, in the output PDF.

I just read chapter 13 in the GMT technical reference and saw the recommended TeX iinstallation. I’ve installed the texlive apps through MacPorts. That didn’t help. The @[\v{c}@[ still isn’t showing up in the output PDF.

---

<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:** [May 6, 2024, 2:19pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/8 "2024-05-06T14:19:32Z")

</div>

Do you have an error message or something?  
Does the first command ressembles this :  
 ![](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/7/7256857d74c39ddae4ec693b8d0fe08347eeda1a.png)  
?

---

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [May 6, 2024, 2:20pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/9 "2024-05-06T14:20:30Z")

</div>

Yes, looks just like that, on the first try. But still looks like that when I used the \v{c} in my second try. No error messages.

---

<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:** [May 6, 2024, 2:25pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/10 "2024-05-06T14:25:21Z")

</div>

try `\capitalcaron{c}` ?

---

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [May 6, 2024, 2:28pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/11 "2024-05-06T14:28:02Z")

</div>

Nice try, but not getting it yet. I tried this:

```auto
gmt begin GMT_latex
	gmt set GMT_THEME cookbook
	gmt basemap -R-200/200/0/2 -JX15c -Bxaf+l"@[\capitalcaron{c}@[ (MPa)" -BS
gmt end show

```

and got this:

 ![Screenshot 2024-05-06 at 9.26.28 AM](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/0/05563f8e5644d692eb9ab051440fa267ffe973ab.png)

---

<div class="post-metadata">

**Author:** ![jjg](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/jjg/32/2822_2.png) [@jjg](https://forum.generic-mapping-tools.org/u/jjg)\
**Post date:** [May 6, 2024, 3:30pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/12 "2024-05-06T15:30:56Z")

</div>

Try `\check{c}`

---

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [May 6, 2024, 4:04pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/13 "2024-05-06T16:04:35Z")

</div>

Yes, that works, but the “c” is italic.

Additionally, the situation I’m working involves a list of items that I pass through pstext, inside of a non-LaTeX, classic GMT mode, script (in `x y text` format).

Although you’ve taught me how to create a c with a caron, I’m not sure how to adapt my script to read this list of items and translate the č characters that appear in the list to something GMT can print on a map/graphic.

---

<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:** [May 6, 2024, 4:29pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/14 "2024-05-06T16:29:22Z")

</div>

Have you tried to just update the 3rd column ?

I think all text in latex is italic. Maybe some \normal{\check{c}} could modify the style?

---

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [May 6, 2024, 4:44pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/15 "2024-05-06T16:44:38Z")

</div>

Yes, Gus, that is what I’m trying to do. I was successful with the \check{c}, but it came out as italic, which didn’t look good in the middle or end of a person’s name.

I even went as far as trying to use the over-strike escape sequence (@!) but was only able to get the caron next to the letter c.

Using this entry (from my list):

```auto
   168.8 77.2 Milankovi@[\normal{\check{c}}@[

```

yielded this output:

 ![Screenshot 2024-05-06 at 11.41.48 AM](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/a/a6831a4fc5abd523d9879188c8068305a696724d.png)

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [May 6, 2024, 4:55pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/16 "2024-05-06T16:55:22Z")

</div>

ugly but seems working; nobody will probably like it.  
the character code comes from [ISO/IEC 8859-2 - Wikipedia](https://en.wikipedia.org/wiki/ISO/IEC_8859-2)

```auto
gmt basemap -R-200/200/0/2 -JX5c/0c -Bxaf+l"Milankovi\350" -png char --PS_CHAR_ENCODING=ISO-8859-2

```

 ![char](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/0/091093712e13def3863c8b13ab453cc616329b51.png)

---

<div class="post-metadata">

**Author:** ![John\_Geodesy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/john_geodesy/32/116_2.png) [@John\_Geodesy](https://forum.generic-mapping-tools.org/u/John_Geodesy)\
**Post date:** [May 6, 2024, 5:04pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/17 "2024-05-06T17:04:13Z")

</div>

Thanks, mkono, I think that is the answer. Just need to get the s and r with the carons. I’ll study the character codes.

---

<div class="post-metadata">

**Author:** ![jjg](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/jjg/32/2822_2.png) [@jjg](https://forum.generic-mapping-tools.org/u/jjg)\
**Post date:** [May 6, 2024, 5:16pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/18 "2024-05-06T17:16:36Z")

</div>

That `\check{c}` is in math-mode, so I guess that `@[ ... @[` syntax is for TeX math mode (and that explains the italic). In that case `\text{\Milankovi\v{c}}` _might_ work but would be in the TeX font, probably not what you want – using the ISO8850-2 code codes does sound a better bet …

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [May 6, 2024, 7:36pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/19 "2024-05-06T19:36:45Z")

</div>

Hm. I just looked how this can be accomplished in PyGMT and at least for me, `@!` works to combine any letter with a `v` on top (`\237`):

```python
import pygmt

size = 5

fig = pygmt.Figure()
fig.basemap(
    region=[-size, size, -size, size],
    projection=f"X{size}c",
    frame="x+l@!s\\237 @!r\\237 @!c\\237", # two \ needed in PyGMT / Python
)
fig.text(position="MC", text="@!s\\237 @!r\\237 @!c\\237")
fig.colorbar(cmap="batlow", position="jTC", frame="x+l@!s\\237 @!r\\237 @!c\\237")
fig.show()

```

 ![merged_letters](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/8/89dd25a3a2bfe446707347b968a749308799bade.png)

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [May 6, 2024, 8:44pm UTC](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870/20 "2024-05-06T20:44:27Z")

</div>

somewhat nicer solution, using `iconv` to convert text labels into ISO-8859-2:

```auto
cat <<EOF | iconv -f utf8 -t iso8859-2 | gmt text -JX5c -R0/3/0/3 -F+jMC -png chars -Bxa -Bya -BWSen --PS_CHAR_ENCODING=ISO-8859-2
1 1 Milošević
2 2 Milankovič
EOF

```

 ![chars](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/7/76dfb31f2a848f4e7d16797f865468d70e7c2bc7.png)

I can imagine running `iconv` on the whole `gmt` shell script so all the utf text strings get converted into ISO-8859-2, including axis labels, titles that could not be specified in a separate text file. Could not quickly imagine a practical way of doing the same to a pygmt script.

Quite an annoying thing.

[Next page](https://forum.generic-mapping-tools.org/t/printing-letter-c-with-caron/4870.md?page=2)
