@@ -89,35 +89,22 @@ function(tikz)
89
89
90
90
else
91
91
ltx := Concatenation( " pdf2svg " , Concatenation( fn, " .pdf" ), " " ,
92
- svgfile);
92
+ svgfile, " ; base64 " , svgfile, " >> " , b64file );
93
93
fi ;
94
94
Exec( ltx );
95
95
if not ( IsExistingFile( svgfile ) ) then
96
96
tojupyter := rec ( json := true , name := " stdout" ,
97
97
data := " No svg was created; pdf2svg is installed in your system?" , metadata := rec ());
98
98
return JupyterRenderable(tojupyter.data, tojupyter.metadata);
99
99
fi ;
100
- if ARCH_IS_MAC_OS_X() then
101
- stream := InputTextFile( b64file );
102
- if stream <> fail then
103
- svgdata := ReadLine( stream );
104
- CloseStream( stream );
105
- else
106
- tojupyter := rec ( json := true , name := " stdout" ,
107
- data := Concatenation( " Unable to render " , tikz ), metadata := rec () );
108
- return JupyterRenderable(tojupyter.data, tojupyter.metadata);
109
- fi ;
100
+ stream := InputTextFile( b64file );
101
+ if stream <> fail then
102
+ svgdata := ReadAll( stream );
103
+ CloseStream( stream );
110
104
else
111
- stream := InputTextFile( svgfile );
112
- if stream <> fail then
113
- svgdata := ReadAll( stream );
114
- svgdata:= SubstitutionSublist(Base64String(svgdata)," \n " ," " );
115
- CloseStream( stream );
116
- else
117
- tojupyter := rec ( json := true , name := " stdout" ,
118
- data := Concatenation( " Unable to render " , tikz ), metadata := rec () );
119
- return JupyterRenderable(tojupyter.data, tojupyter.metadata);
120
- fi ;
105
+ tojupyter := rec ( json := true , name := " stdout" ,
106
+ data := Concatenation( " Unable to render " , tikz ), metadata := rec () );
107
+ return JupyterRenderable(tojupyter.data, tojupyter.metadata);
121
108
fi ;
122
109
123
110
img:= Concatenation(" <img src='data:image/svg+xml;base64," , svgdata," '>" );
0 commit comments