# Turn off auto-pairing of underscores

**URL:** <https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982>\
**Category:** Basement\
**Created:** [July 16, 2021, 4:54pm UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982 "2021-07-16T16:54:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![padic](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@padic](https://forum.obsidian.md/u/padic)\
**Post date:** [July 16, 2021, 4:54pm UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/1 "2021-07-16T16:54:28Z")

</div>

### Things I have tried

I tried turning off the auto-pair brackets function in the editor settings but nothing happened.  
I searched for “underscore” in community plugins but found nothing.  
I tried variations of the search “obsidian double underscore” on Google and the forums but didn’t find anything relevant.

### What I’m trying to do

Whenever I type \_ in Obsidian it auto-pairs the underscore with another one. So I get like two underscores with the cursor in the middle like so: `_|_`

This has become an annoyance as I use the underscore a lot for subscripts in mathematical notation. I would like to turn this “feature” off, but I’m not sure how.

I’ve only encountered this issue in Obsidian, and not any other editors I use.

I use Obsidian v0.12.10 on macOS Catalina v10.15.7

---

<div class="post-metadata">

**Author:** ![mnvwvnm](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mnvwvnm/32/9766_2.png) [@mnvwvnm](https://forum.obsidian.md/u/mnvwvnm)\
**Post date:** [July 16, 2021, 5:53pm UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/2 "2021-07-16T17:53:25Z")

</div>

In settings, after “Auto pair brackets” you find “Auto pair Markdown syntax”: `_` is the symbol for italic!

---

<div class="post-metadata">

**Author:** ![padic](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@padic](https://forum.obsidian.md/u/padic)\
**Post date:** [July 16, 2021, 7:06pm UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/3 "2021-07-16T19:06:57Z")

</div>

Thank you! This solves the problem, however it creates a new one: I frequently use the auto pairing function for Markdown syntax such as `*` for italics or `**` for bold. Is there a way to only turn off auto pairing of `_`?

---

<div class="post-metadata">

**Author:** ![padic](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@padic](https://forum.obsidian.md/u/padic)\
**Post date:** [July 16, 2021, 7:16pm UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/4 "2021-07-16T19:16:43Z")

</div>

Here’s a relevant post from March: [Add option to ignore `$` when pairing markdown symbols](https://forum.obsidian.md/t/add-option-to-ignore-when-pairing-markdown-symbols/14855)

Based on that post there doesn’t seem to be a satisfactory solution at the moment…

---

<div class="post-metadata">

**Author:** ![nemski](https://forum.obsidian.md/user_avatar/forum.obsidian.md/nemski/32/16707_2.png) [@nemski](https://forum.obsidian.md/u/nemski)\
**Post date:** [July 17, 2021, 10:53am UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/5 "2021-07-17T10:53:52Z")

</div>

Have you thought of putting the mathematical notation in the code markdown segment like this?

```auto
__Text here__

```

---

<div class="post-metadata">

**Author:** ![padic](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@padic](https://forum.obsidian.md/u/padic)\
**Post date:** [July 21, 2021, 6:37pm UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/6 "2021-07-21T18:37:28Z")

</div>

I don’t think I understand. Could you elaborate?

For mathematical notation I use MathJax, and the code for subscript is a single underscore.

---

<div class="post-metadata">

**Author:** ![nemski](https://forum.obsidian.md/user_avatar/forum.obsidian.md/nemski/32/16707_2.png) [@nemski](https://forum.obsidian.md/u/nemski)\
**Post date:** [July 22, 2021, 10:54am UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/7 "2021-07-22T10:54:41Z")

</div>

Sorry that I wasn’t clear.

Can you put your mathematical notation in Obsidian Code blocks? You can find out more about it in [Format Your Notes](https://help.obsidian.md/How+to/Format+your+notes). Search for “code blocks”, it’s about half-way down the page.

---

<div class="post-metadata">

**Author:** ![padic](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@padic](https://forum.obsidian.md/u/padic)\
**Post date:** [July 23, 2021, 6:00pm UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/8 "2021-07-23T18:00:17Z")

</div>

If I understand correctly, you’re suggesting to put the MathJax code in a code block? I don’t see how that solves my problem, since whether or not you’re in a code block doesn’t appear to affect auto pairing. Moreover, MathJax code written in a code block won’t be rendered in preview mode.

Please let me know if I’m missing something.

---

<div class="post-metadata">

**Author:** ![padic](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@padic](https://forum.obsidian.md/u/padic)\
**Post date:** [July 23, 2021, 6:05pm UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/9 "2021-07-23T18:05:05Z")

</div>

I’ve noticed that auto-pairing does not occur if the underscore is preceded by a letter or number. However, it does occur if it is preceded by `}`, which is typically the case for me. I’m not sure about the inner workings of the auto pairing function, but if somehow this symbol was treated a number or letter, it would have solved my problem.

---

<div class="post-metadata">

**Author:** ![anon12638239](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/a/2bfe46/32.png) [@anon12638239](https://forum.obsidian.md/u/anon12638239)\
**Post date:** [July 23, 2021, 6:12pm UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/10 "2021-07-23T18:12:18Z")

</div>

If you turn “Auto pair Markdown syntax” off, you can use **CMD I** for _italics_ and **CMD B** for **bold** , with both keystrokes automatically pairing the single / double asterisks used in Markdown.

Would that work for your needs?

Angel

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [August 2, 2021, 9:49pm UTC](https://forum.obsidian.md/t/turn-off-auto-pairing-of-underscores/20982/11 "2021-08-02T21:49:41Z")

</div>

Closed on August 2, 2021, 9:49pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
