Math Mode Pipe around Fractions

Things I have tried

Hi, I’ve had a look on this forum and elsewhere but i can’t seem to find anything related to this.

What I’m trying to do

I am trying to display two pipes around a fraction in math mode. This of course works normally using just:

$ |\dfrac{a}{b}| $


The problem is when i try to use \left and \right, the pipes dissappear instead of getting taller.
The same happens when using \vert instead of just the pipe character.

I’m not sure if this is a rendering bug with mathjax or latex but I couldn’t find anything on google about this happening to anyone else.

The weird thing is the pipe is taking up space because I can see the block getting taller in live preview. Same happens with using \bigg{|} which works with other characters like [ and ( but just not pipes.

Thanks in advance if anyone has any suggestions.

Best to use this. It uses \vert in \left and \right pair, to adjust height to be appropriate for the fraction, like you want.


Here is a photo of the result:
Screenshot 2023-02-02 at 1.53.45 PM

1 Like

Thanks for the reply, that’s one of the things I tried. The pipes don’t display for me.

I just double checked it in the sandbox vault and it’s not displaying there either.
There must be a bug with obsidian on my laptop cause its actually displaying fine on my phone.

Okay so I’ve done some tinkering and created a css snippet that seems to fix it.

.MathJax mjx-stretchy-v > mjx-ext {
	overflow: visible overlay;

Inspecting the default css shows that this was originally:

.MathJax mjx-stretchy-v > mjx-ext {
	overflow: visible clip;

I still have no idea how this is only happing to me and not @TheMathGuyd

Related topic:

I’m sorry you are having this issue. I cannot recreate it on my machine (MacOS Ventura)

Is it perhaps OS specific?

Thanks for linking this, its definitely the same problem. Increasing the font weight for the pipes fixes it.

mjx-stretchy-v > mjx-ext {
  font-weight: 800

The other snippet i posted added tiny scroll bars to the pipes so wasn’t ideal.
I’ll close this now. Thanks everyone.

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