[tw5] Re: Is there any way of using entire latex syntax inside TiddyWiki?

2021-05-03 Thread PMario
On Monday, May 3, 2021 at 1:24:52 AM UTC+2 Anjar wrote:
...

> I don't think there is any way to render a full latex document by 
> javascript (or is there? https://github.com/kisonecat/web2js); you may 
> have to actually run latex somehow, 
>

Very interesting project. It seems to run a full blown TeX ... not LaTeX 
environment in the browser. 
In the background it needs about 13 MByte of WASM code + TeX configuration 
to + editor ... 

But it seems, that it still needs a backend to load assets like fonts ... 
As far as I can see, inspecting the live demo code. .. 

So there would be some considerable work to do, to slim the stuff down to 
make it usable with TW. 

-mario

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fc7ef87c-b06b-400c-b17a-f6b46889f32dn%40googlegroups.com.


[tw5] Re: Is there any way of using entire latex syntax inside TiddyWiki?

2021-05-02 Thread muynars...@gmail.com
Thanks everyone for the answers,

I'm checking the links... I really liked the interactivity that the 
https://github.com/pyramation/LaTeX2JS plugin allows us to do. I've tried 
making a fast adaption here using a tiddler of type html but it doesn't 
work. I don't know why, if I save a file with the following content on my 
computer as html and open it with a browser it works:




  
  
  
  
  

  LaTeX2JS Examples
  
  

  
  
  

  
  https://latex2js.com/assets/images/share.jpg; />
  https://latex2js.com/assets/images/share.jpg; />
  
  
  

  

  https://fonts.googleapis.com/css?family=Arbutus+Slab; 
rel="stylesheet" type="text/css">
  https://latex2js.com/assets/css/latex2js.css;>
  https://latex2js.com/assets/css/website.css;>
  https://latex2js.com/assets/js/latex2html5.bundle.js";>





  LaTeX2JS Examples





\begin{pspicture}(0,-3)(8,3) \rput(0,0){$x(t)$} \rput(4,1.5){$f(t)$} \rput(4,-1.5){$g(t)$} \rput(8.2,0){$y(t)$} \rput(1.5,-2){$h(t)$} \psframe(1,-2.5)(7,2.5) \psframe(3,1)(5,2) \psframe(3,-1)(5,-2) \rput(4,0){$X_k = \frac{1}{p} \sum \limits_{n=\langle p\rangle}x(n)e^{-ik\omega_0n}$} \psline{->}(0.5,0)(1.5,0) \psline{->}(1.5,1.5)(3,1.5) \psline{->}(1.5,-1.5)(3,-1.5) \psline{->}(6.5,1.5)(6.5,0.25) \psline{->}(6.5,-1.5)(6.5,-0.25) \psline{->}(6.75,0)(7.75,0) \psline(1.5,-1.5)(1.5,1.5) \psline(5,1.5)(6.5,1.5) \psline(5,-1.5)(6.5,-1.5) \psline(6,-1.5)(6.5,-1.5) \pscircle(6.5,0){0.25} \psline(6.25,0)(6.75,0) \psline(6.5,0.5)(6.5,-0.5) \end{pspicture}



\begin{pspicture}(-2,-2)(2,2) \psframe(-2,-2)(2,2) \userline[linewidth=1.5 pt]{->}(0,0)(2,2) \end{pspicture}
LaTeX2HTML5.init(); I got it from the page https://latex2js.com/examples/index.html and just changed the relative paths to absolute paths... But well, inside TiddlyWiki it doesn't work as a type HTML, does anyone know why? Does the HTML type of tiddlers work exactly as an HTML file? On Sunday, May 2, 2021 at 8:24:52 PM UTC-3 Anjar wrote: > Hi, > > I don't think there is any way to render a full latex document by > javascript (or is there? https://github.com/kisonecat/web2js); you may > have to actually run latex somehow, for example through php: > https://github.com/scarfboy/phplatex There is a js library for rendering > tikz that may be useful https://github.com/kisonecat/tikzjax > > If making charts is more important than using latex, you can have a look > at this short thread > > about Charts.css (although pie charts are not > currently supported) > > Best, > Anders > > mandag 3. mai 2021 kl. 00:25:51 UTC+2 skrev muynars...@gmail.com: > >> I know that with the KaTex Plugin I can partially use LaTex syntax by >> adding $$ at the beginning of the phrase like: >> >> $$\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi >> x}\,d\xi$$ >> >> However, I'd like to put the entire LaTex syntax on my tiddlers like the >> following: >> >> ```latex >> % Pie chart >> % Author: Robert Vollmert >> \documentclass{article} >> >> \usepackage{calc} >> \usepackage{ifthen} >> \usepackage{tikz} >> \begin{document} >> \newcommand{\slice}[4]{ >> \pgfmathparse{0.5*#1+0.5*#2} >> \let\midangle\pgfmathresult >> >> % slice >> \draw[thick,fill=black!10] (0,0) -- (#1:1) arc (#1:#2:1) -- cycle; >> >> % outer label >> \node[label=\midangle:#4] at (\midangle:1) {}; >> >> % inner label >> \pgfmathparse{min((#2-#1-10)/110*(-0.3),0)} >> \let\temp\pgfmathresult >> \pgfmathparse{max(\temp,-0.5) + 0.8} >> \let\innerpos\pgfmathresult >> \node at (\midangle:\innerpos) {#3}; >> } >> >> \begin{tikzpicture}[scale=3] >> >> \newcounter{a} >> \newcounter{b} >> \foreach \p/\t in {20/type A, 4/type B, 11/type C, >>49/type D, 16/other} >> { >> \setcounter{a}{\value{b}} >> \addtocounter{b}{\p} >> \slice{\thea/100*360} >> {\theb/100*360} >> {\p\%}{\t} >> } >> >> \end{tikzpicture} >> >> \end{document} >> ``` >> >> This is a pie chart made in LaTex language. Is there any way of making >> TiddlyWiki show the result of what I write like that? Just by using the >> same syntax that I use for choosing syntax? Or is there an alternative way >> to reach this same goal? >> > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6fe49798-ae51-4a09-a877-a51358aead5cn%40googlegroups.com.

[tw5] Re: Is there any way of using entire latex syntax inside TiddyWiki?

2021-05-02 Thread Anjar
Hi,

I don't think there is any way to render a full latex document by 
javascript (or is there? https://github.com/kisonecat/web2js); you may have 
to actually run latex somehow, for example through php: 
https://github.com/scarfboy/phplatex There is a js library for rendering 
tikz that may be useful https://github.com/kisonecat/tikzjax

If making charts is more important than using latex, you can have a look at 
this 
short thread 
 about 
Charts.css  (although pie charts are not currently 
supported)

Best,
Anders

mandag 3. mai 2021 kl. 00:25:51 UTC+2 skrev muynars...@gmail.com:

> I know that with the KaTex Plugin I can partially use LaTex syntax by 
> adding $$ at the beginning of the phrase like:
>
> $$\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi 
> x}\,d\xi$$
>
> However, I'd like to put the entire LaTex syntax on my tiddlers like the 
> following:
>
> ```latex
> % Pie chart
> % Author: Robert Vollmert
> \documentclass{article}
>
> \usepackage{calc}
> \usepackage{ifthen}
> \usepackage{tikz}
> \begin{document}
> \newcommand{\slice}[4]{
>   \pgfmathparse{0.5*#1+0.5*#2}
>   \let\midangle\pgfmathresult
>
>   % slice
>   \draw[thick,fill=black!10] (0,0) -- (#1:1) arc (#1:#2:1) -- cycle;
>
>   % outer label
>   \node[label=\midangle:#4] at (\midangle:1) {};
>
>   % inner label
>   \pgfmathparse{min((#2-#1-10)/110*(-0.3),0)}
>   \let\temp\pgfmathresult
>   \pgfmathparse{max(\temp,-0.5) + 0.8}
>   \let\innerpos\pgfmathresult
>   \node at (\midangle:\innerpos) {#3};
> }
>
> \begin{tikzpicture}[scale=3]
>
> \newcounter{a}
> \newcounter{b}
> \foreach \p/\t in {20/type A, 4/type B, 11/type C,
>49/type D, 16/other}
>   {
> \setcounter{a}{\value{b}}
> \addtocounter{b}{\p}
> \slice{\thea/100*360}
>   {\theb/100*360}
>   {\p\%}{\t}
>   }
>
> \end{tikzpicture}
>
> \end{document}
> ```
>
> This is a pie chart made in LaTex language. Is there any way of making 
> TiddlyWiki show the result of what I write like that? Just by using the 
> same syntax that I use for choosing syntax? Or is there an alternative way 
> to reach this same goal?
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/88eb98bd-270e-465a-ba4c-3fe0d89aeb63n%40googlegroups.com.


[tw5] Re: Is there any way of using entire latex syntax inside TiddyWiki?

2021-05-02 Thread Ste
Hi, 
I think the short answer is no. :(
Katex supports a lot of LaTeX https://katex.org/docs/supported.html
But I don't think ticz drawings are supported. 
Im still kinda hoping https://github.com/pyramation/LaTeX2JS
takes goes viral and some mad genius makes a plugin out of it :) 
Maybe next it will week when I win the lotto! :)
I have used that with a free Dropbox hosting and Iframed it into a 
tiddlywiki. 
There are other diagramming plugins available for tiddlywiki. 
Have a search in the community vault: 
https://links.tiddlywiki.com/


On Sunday, 2 May 2021 at 23:25:51 UTC+1 muynars...@gmail.com wrote:

> I know that with the KaTex Plugin I can partially use LaTex syntax by 
> adding $$ at the beginning of the phrase like:
>
> $$\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi 
> x}\,d\xi$$
>
> However, I'd like to put the entire LaTex syntax on my tiddlers like the 
> following:
>
> ```latex
> % Pie chart
> % Author: Robert Vollmert
> \documentclass{article}
>
> \usepackage{calc}
> \usepackage{ifthen}
> \usepackage{tikz}
> \begin{document}
> \newcommand{\slice}[4]{
>   \pgfmathparse{0.5*#1+0.5*#2}
>   \let\midangle\pgfmathresult
>
>   % slice
>   \draw[thick,fill=black!10] (0,0) -- (#1:1) arc (#1:#2:1) -- cycle;
>
>   % outer label
>   \node[label=\midangle:#4] at (\midangle:1) {};
>
>   % inner label
>   \pgfmathparse{min((#2-#1-10)/110*(-0.3),0)}
>   \let\temp\pgfmathresult
>   \pgfmathparse{max(\temp,-0.5) + 0.8}
>   \let\innerpos\pgfmathresult
>   \node at (\midangle:\innerpos) {#3};
> }
>
> \begin{tikzpicture}[scale=3]
>
> \newcounter{a}
> \newcounter{b}
> \foreach \p/\t in {20/type A, 4/type B, 11/type C,
>49/type D, 16/other}
>   {
> \setcounter{a}{\value{b}}
> \addtocounter{b}{\p}
> \slice{\thea/100*360}
>   {\theb/100*360}
>   {\p\%}{\t}
>   }
>
> \end{tikzpicture}
>
> \end{document}
> ```
>
> This is a pie chart made in LaTex language. Is there any way of making 
> TiddlyWiki show the result of what I write like that? Just by using the 
> same syntax that I use for choosing syntax? Or is there an alternative way 
> to reach this same goal?
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/85359c51-0cfd-45d8-b152-0c6ea9949250n%40googlegroups.com.