artisticat1 / obsidian-tikzjax

Render LaTeX and TikZ diagrams in your notes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught (in promise) Error: Could not find font cmmib5 when drawing an OpAmp

nilswenning opened this issue · comments

Hi everyone,

I ran into an issue while trying to draw an operational amplifier (op-amp) using Circuitikz. Here's the code snippet I used:

```tikz
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,0) node[above]{$v_i$} to[short, o-] ++(1,0) node[op amp, noinv input up, anchor=+](OA){\texttt{OA1}};
\end{circuitikz}
\end{document}
```

The error message in the console mentions that the font cmmib5 is missing. Does anyone have insights into why this is happening and how to resolve it?

Thanks for any help or suggestions!

The error is caused by the dvi2html node module. It cannot read the tfm fonts from the amsfonts out of the Base64 string because they are not present.

Steps to Resolve:

  1. Install a Tex Distribution -> For Mac https://www.tug.org/mactex/.
  2. Clone my fork of dvi2html.
    • The fonts from tools/tfm2json.js have been added there.
  3. Clone the tikzjax fork by artisticat1.
  4. Change line 21 to "dvi2html": "file:../dvi2html",.
  5. Clone obsidian-tikzjax.
  6. In the dvi2html folder, run npm i & npm run dev.
  7. In the tikzjax folder, run npm i & npm run dev.
  8. Replace the newly generated tikzjax.js with the one from the obsidian-tikzjax folder.
  9. In the obsidian-tikzjax folder, run npm i & npm run dev.

I'm definitely not an expert in this. This is the only solution I figured out working for me.

@artisticat1 I just opened an PR on your dvi2html maybe you can add this if you have time. :)

I just opened an PR on your dvi2html maybe you can add this if you have time. :)

Thanks! I'll try to take a look sometime this week.