# Problems with katex

**URL:** <https://talk.jekyllrb.com/t/problems-with-katex/8476>\
**Category:** Help\
**Created:** [August 18, 2023, 1:12pm UTC](https://talk.jekyllrb.com/t/problems-with-katex/8476 "2023-08-18T13:12:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sywu](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@sywu](https://talk.jekyllrb.com/u/sywu)\
**Post date:** [August 18, 2023, 1:12pm UTC](https://talk.jekyllrb.com/t/problems-with-katex/8476/1 "2023-08-18T13:12:41Z")

</div>

I’m using `$f(x)$ and $(x_n)_{n}$ and $(y_n)_{n}$` in my markdown file. After `jekyll clean && jekyll serve`, the result is

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/2/2c6784b1a4d35c06011fb0e2fd4aa845ccf2bd03.png)  
If I remove the curly braces, everything is fine. What’s the problem?

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 19, 2023, 5:52pm UTC](https://talk.jekyllrb.com/t/problems-with-katex/8476/2 "2023-08-19T17:52:12Z")

</div>

I’ve not used katex, so not sure. If you searched for jekyll katex to see if there are any blog posts about how it works? I found a few.

Maybe you need to wrap it in `{% raw %} {% endraw %}` so jekyll doesn’t process the curly brackets as liquid?

---

<div class="post-metadata">

**Author:** ![sywu](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@sywu](https://talk.jekyllrb.com/u/sywu)\
**Post date:** [August 22, 2023, 2:22pm UTC](https://talk.jekyllrb.com/t/problems-with-katex/8476/3 "2023-08-22T14:22:44Z")

</div>

I had tried this method. However, it didn’t work.

---

<div class="post-metadata">

**Author:** ![BillRaymond](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/billraymond/32/5963_2.png) [@BillRaymond](https://talk.jekyllrb.com/u/BillRaymond)\
**Post date:** [August 22, 2023, 10:55pm UTC](https://talk.jekyllrb.com/t/problems-with-katex/8476/4 "2023-08-22T22:55:06Z")

</div>

Sorry, I am unfamiliar with this functionality, but it would be good to see what you expected vs. the output you received.

---

<div class="post-metadata">

**Author:** ![sywu](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@sywu](https://talk.jekyllrb.com/u/sywu)\
**Post date:** [August 23, 2023, 12:26am UTC](https://talk.jekyllrb.com/t/problems-with-katex/8476/5 "2023-08-23T00:26:55Z")

</div>

This is my expectation:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/0/045eeb570a852615896630e7742f59e1342abeaf.png)

Demo markdown file for the problem:

```markdown
---
layout: post
title: title
category: 
description: 
math: true
---
{% raw %}
$f(x)$ and $(x_n)_{n}$ and $(y_n)_{n}$
{% endraw %}

```

---

<div class="post-metadata">

**Author:** ![pdmosses](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/pdmosses/32/4764_2.png) [@pdmosses](https://talk.jekyllrb.com/u/pdmosses)\
**Post date:** [September 15, 2023, 9:12am UTC](https://talk.jekyllrb.com/t/problems-with-katex/8476/6 "2023-09-15T09:12:18Z")

</div>

When using [kramdown](https://kramdown.gettalong.org/syntax.html#math-blocks):

> Using inline math is also easy: just surround your math content with two dollar signs, like with a math block.

So try `$$…$$` instead of `$…$`.
