# Inline code with syntax highlight

**URL:** <https://discourse.gohugo.io/t/inline-code-with-syntax-highlight/29018>\
**Category:** support\
**Created:** [October 24, 2020, 6:51pm UTC](https://discourse.gohugo.io/t/inline-code-with-syntax-highlight/29018 "2020-10-24T18:51:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobiasBora](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@tobiasBora](https://discourse.gohugo.io/u/tobiasBora)\
**Post date:** [October 24, 2020, 6:51pm UTC](https://discourse.gohugo.io/t/inline-code-with-syntax-highlight/29018/1 "2020-10-24T18:51:52Z")

</div>

Hello,

I’m trying to see if I can use inline code with syntax highlight with gohugo. So I tried to use these two syntax:

```auto
`a = "abc"+"def"`{:.python}

```

and

```auto
`a = "abc"+"def"`{.python}

```

which seems to be used by Jekyll and Pandoc.

However, this does not work on gohugo (using the theme `ananke`), while the not-inlined version does work.

Thanks.

---

<div class="post-metadata">

**Author:** ![ju52](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ju52/32/6749_2.png) [@ju52](https://discourse.gohugo.io/u/ju52)\
**Post date:** [October 25, 2020, 10:51am UTC](https://discourse.gohugo.io/t/inline-code-with-syntax-highlight/29018/2 "2020-10-25T10:51:15Z")

</div>

search helps

> **[Shortcodes](https://gohugo.io/content-management/shortcodes/#highlight)**
>
> Shortcodes are simple snippets inside your content files calling built-in or custom templates.

---

<div class="post-metadata">

**Author:** ![tobiasBora](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@tobiasBora](https://discourse.gohugo.io/u/tobiasBora)\
**Post date:** [October 25, 2020, 1:32pm UTC](https://discourse.gohugo.io/t/inline-code-with-syntax-highlight/29018/3 "2020-10-25T13:32:09Z")

</div>

I don’t want to use shortcodes since it makes my document hugo-specific. I still want to be able to generate tex files from my source code, and inserting shortcodes would break that. I’ll try to see if I can use some other languages + pandoc.

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [October 26, 2020, 2:49pm UTC](https://discourse.gohugo.io/t/inline-code-with-syntax-highlight/29018/4 "2020-10-26T14:49:31Z")

</div>

You can’t use inline code with syntax highlight with gohugo. If you use shortcodes as suggested by @ju52 you can.
