Compatibility with tikz-bayesnet

Hello,

I am wondering how can I make your Google Doc plugin compatible with tikz-bayesnet GitHub - jluttine/tikz-bayesnet: TikZ library for drawing Bayesian networks, graphical models and (directed) factor graphs in LaTeX.

to be able to render these graphics

image

With this kind of code

\usepackage{tikz}
\usetikzlibrary{bayesnet}
\begin{tikzpicture}
    \node[latent] (theta) {$\theta$} ; %
    \node[latent, right=of theta] (z) {$z_n$} ; %
    \node[obs, right=of z] (y) {$y_n$} ; %
    \node[latent, above=of z] (mu) {$\mu_k$} ; %
    \node[latent, above=of y] (sigma) {$\sigma_k$} ; %
    \plate[inner sep=0.25cm, xshift=-0.12cm, yshift=0.12cm] {plateN} {(z) (y)} {$N$}; %
    \plate[inner sep=0.25cm, xshift=-0.12cm, yshift=0.12cm] {plateK} {(mu) (sigma)} {$K$}; %
    \edge {theta} {z} ; %
    \edge {z} {y} ; %
    \edge {mu, sigma} {y} ; %
\end{tikzpicture}

While it can render the graphics, it throws an error, whenever I click on that image so I cannot edit it anymore

Thanks

This seems a bug, we will fix this in next update.

Quick Fix
To fix Reload pop-up dialogue: select few blank lines above the rendered image then drag down such that rendered image is selected and keep dragging down until few blank lines below the rendered image are selected. Then press the Delete button.
This will delete the image that was causing the problem without losing rest of the work.

Root Cause
The root cause of this problem is using % sign in code. remove all % signs from the LaTeX Block that you want to render.

Suggestion
We already have tikz package included on our system. So, you can remove \usepackage{tikz} line from your code.

Thanks,

this is solved. (You should add the solve button to Discourse.)

I was trying to compile some plate diagrams

\usetikzlibrary{bayesnet}
\begin{tikzpicture}

\node[latent] (y_hat) {$\hat{Y}$} ;

\node[obs, right=of y_hat, yshift=0.5cm] (Y) {$y_n$} ; 
\node[obs, right=of y_hat, yshift=0.5cm] (Y) {$Y$} ; 
\node[obs, right=of y_hat, yshift=-0.5cm] (X) {$X$} ; 
		
\node[latent, right=of Y] (w) {$\omega$} ;
\node[latent, above=of Y, yshift=-0.5cm] (d) {$\delta$} ;	
	
\node[latent, left=of y_hat] (b) {$\beta$} ;	
\node[latent, above=of y_hat] (y) {$y^{\circ}$} ;
\node[latent, below=of y_hat] (n) {$\nu$} ;

\node[latent, above=of y, xshift=0.5cm] (g1) {$\gamma'$} ;
\node[latent, above=of y, xshift=-0.5cm] (g2) {$\gamma''$} ;

\node[latent, left=of b] (s) {$\sigma$} ;
\node[latent, left=of b] (xi) {$\xi$} ;


\end{tikzpicture}

but it gives error in the local rendering if I add the last line (for no apparent reason)

\node[latent, left=of b] (xi) {$\xi$} ;

@Ste This issue is related to size of rendered image. If the resulting image is greater than 100kb it will throw error.
But while converting to LaTeX PDF you won’t face any issue. We have marked this as open issue and will fix in next release.

1 Like