summaryrefslogtreecommitdiff
path: root/modules/graphics/demos/textrendering
diff options
context:
space:
mode:
Diffstat (limited to 'modules/graphics/demos/textrendering')
-rwxr-xr-xmodules/graphics/demos/textrendering/latex/coloredlabel.dem.sce33
-rwxr-xr-xmodules/graphics/demos/textrendering/latex/fulltest.dem.sce26
-rwxr-xr-xmodules/graphics/demos/textrendering/latex/latexsubplot.dem.sce31
-rwxr-xr-xmodules/graphics/demos/textrendering/latex/simple.dem.sce37
-rwxr-xr-xmodules/graphics/demos/textrendering/mathml/simple.dem.sce24
-rwxr-xr-xmodules/graphics/demos/textrendering/textrendering.dem.gateway.sce17
6 files changed, 168 insertions, 0 deletions
diff --git a/modules/graphics/demos/textrendering/latex/coloredlabel.dem.sce b/modules/graphics/demos/textrendering/latex/coloredlabel.dem.sce
new file mode 100755
index 000000000..127a8f1e9
--- /dev/null
+++ b/modules/graphics/demos/textrendering/latex/coloredlabel.dem.sce
@@ -0,0 +1,33 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - Calixte DENIZET
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_coloredlabel()
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+ demo_viewCode("coloredlabel.dem.sce");
+
+ // DEMO START
+
+ x1 = -2:0.1:2;
+ x2 = -1:0.1:1;
+
+ plot2d(x1,2/sqrt(%pi)*exp(-x1.^2));
+ xpoly([-1 x2 1],[0 2/sqrt(%pi)*exp(-x2.^2) 0],"lines",1);
+ p=get("hdl");
+ p.polyline_style = 5;
+ p.foreground = 20;
+
+ xtitle("$\textstyle\mbox{Graph of }f:t\in[-2;2]\longmapsto\frac2{\sqrt\pi}\mathrm{e}^{-t^2}\in\mathbb{R}$","$t$")
+
+ xstring(-0.55,0.2,"$\fcolorbox{black}{Tan}{\frac2{\sqrt\pi}\int_{-1}^{1}\mathrm{e}^{-t^2}\,\mathrm{d}t\approx"+string(erf(1)-erf(-1))+"}$");
+
+ xstring(1.8,0.04,"$\mathscr{C}_f$");
+ // DEMO END
+
+endfunction
+
+demo_coloredlabel();
+clear demo_coloredlabel; \ No newline at end of file
diff --git a/modules/graphics/demos/textrendering/latex/fulltest.dem.sce b/modules/graphics/demos/textrendering/latex/fulltest.dem.sce
new file mode 100755
index 000000000..279d788c1
--- /dev/null
+++ b/modules/graphics/demos/textrendering/latex/fulltest.dem.sce
@@ -0,0 +1,26 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Sylvestre LEDRU
+// Copyright (C) 2009 - Calixte DENIZET
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_fulltest()
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+ demo_viewCode("fulltest.dem.sce");
+
+ // DEMO START
+ my_handle.figure_name="LaTeX Math";
+ //grosse chaine latex
+ square(0,0,15,15);
+ xtitle("$\scalebox{1.6}\JLaTeXMath$");
+ str="$\newcommand{\oa}{\left|}\newcommand{\fa}{\right|}\scalebox{1.6}{\begin{split}"+...
+ "|I_2| &= \oa\int_0^T\psi(t)\left\{ u(a,t)-\int_{\gamma(t)}^a \frac{d\theta}{k} (\theta,t) \int_a^\theta c(\xi) u_t (\xi,t)\,d\xi\right\}dt\fa\\&\\&\mathrm{Produced\ with\ Java\ and\ \textcolor{OliveGreen}{\LaTeX}\ by\ }\mathscr{C}\mathcal{A}\mathfrak{L}\mathbf{I}\mathtt{X}\mathbb{T}\mathsf{E}.\\&\mbox{It handles accents (éàçèêïö\oe\ae) or cyrillic (привет мир)}\\&\mbox{or greek (γειά κόσμο) for our international users.}\\&\begin{pmatrix}\alpha&\beta&\gamma\\\aleph&\beth&\gimel\\\mathfrak{A}&\mathfrak{B}&\mathfrak{C}\\\end{pmatrix}\quad{(a+b)}^{\frac{n}{2}}=\sqrt{\sum_{k=0}^n\tbinom{n}{k}a^kb^{n-k}}\quad\\&\forall\varepsilon\in\mathbb{R}_+^*\ \exists\eta>0\ |x-x_0|\leq\eta\Longrightarrow|f(x)-f(x_0)|\leq\varepsilon\\&\det\begin{bmatrix}a_{11}&a_{12}&\cdots&a_{1n}\\a_{21}&\ddots&&\vdots\\\vdots&&\ddots&\vdots\\a_{n1}&\cdots&\cdots&a_{nn}\end{bmatrix}\overset{\mathrm{def}}{=}\sum_{\sigma\in\mathfrak{S}_n}\varepsilon(\sigma)\prod_{k=1}^n a_{k\sigma(k)}\\&\Delta f(x,y)=\frac{\partial^2f}{\partial x^2}+\frac{\partial^2f}{\partial y^2}\qquad\qquad \boxed{n!\underset{n\rightarrow+\infty}{\sim} {\left(\frac{n}{e}\right)}^n\sqrt{2\pi n}}\\&\fcolorbox{black}{Bittersweet}{\sideset{_\alpha^\beta}{_\gamma^\delta}{\begin{pmatrix}a&b\\c&d\end{pmatrix}}}\xrightarrow[T]{n\pm i-j}\sideset{^t}{}A\xleftarrow{\overrightarrow{u}\wedge\overrightarrow{v}}\underleftarrow{\iint_{\mathds{R}^2}e^{-\left(x^2+y^2\right)}\,\mathrm{d}x\mathrm{d}y}\end{split}}$";
+ xstring(0,0,str);
+
+ // DEMO END
+endfunction
+
+demo_fulltest();
+clear demo_fulltest; \ No newline at end of file
diff --git a/modules/graphics/demos/textrendering/latex/latexsubplot.dem.sce b/modules/graphics/demos/textrendering/latex/latexsubplot.dem.sce
new file mode 100755
index 000000000..945a94710
--- /dev/null
+++ b/modules/graphics/demos/textrendering/latex/latexsubplot.dem.sce
@@ -0,0 +1,31 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Sylvestre LEDRU
+// Copyright (C) 2009 - DIGITEO - Yann COLLETTE
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_latexsubplot()
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+ demo_viewCode("latexsubplot.dem.sce");
+
+ // DEMO START
+
+ x = 1:0.25:10;
+ y1 = x + sin(4*%pi*x / 10);
+ y2 = 1 + cos(4*%pi*x / 10) * (4*%pi/10);
+
+ subplot(2,1,1);
+ plot(x,y1,"k-");
+ xstring(5,3,'$\leftarrow f \left( x \right) = x + \sin \left( \frac{x \cdot 4 \cdot \pi}{10} \right)$');
+
+ subplot(2,1,2);
+ plot(x,y2,"k-");
+ xstring(4.5,1.4,'$\leftarrow \frac{df \left( x \right)}{dx} = 1 + \frac{4 \cdot \pi}{10} \cdot \cos \left( \frac{x \cdot 4 \cdot \pi}{10} \right)$');
+
+ // DEMO END
+endfunction
+
+demo_latexsubplot();
+clear demo_latexsubplot; \ No newline at end of file
diff --git a/modules/graphics/demos/textrendering/latex/simple.dem.sce b/modules/graphics/demos/textrendering/latex/simple.dem.sce
new file mode 100755
index 000000000..39c827c22
--- /dev/null
+++ b/modules/graphics/demos/textrendering/latex/simple.dem.sce
@@ -0,0 +1,37 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Sylvestre LEDRU
+// Copyright (C) 2009 - DIGITEO - Michael BAUDIN
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_simple()
+
+ my_handle = scf(100001);
+ clf(my_handle,"reset");
+ demo_viewCode("simple.dem.sce");
+
+ // DEMO START
+
+ function y = myquad ( x )
+ y = x(1)^2+x(2)^2
+ endfunction
+
+ N = 50
+ xdata = linspace(-1,1,N);
+ ydata = linspace(-1,1,N);
+
+ for i=1:N
+ for j=1:N
+ zdata(i,j) = myquad( [xdata(i) ydata(j)] );
+ end
+ end
+
+ contour ( xdata , ydata , zdata , [0.1 0.5 1.0 1.5] )
+ gg = gce();
+ gg.title.text = "$f(\mathbf{x}) = x_1^2+x_2^2$";
+
+ // DEMO END
+endfunction
+
+demo_simple();
+clear demo_simple; \ No newline at end of file
diff --git a/modules/graphics/demos/textrendering/mathml/simple.dem.sce b/modules/graphics/demos/textrendering/mathml/simple.dem.sce
new file mode 100755
index 000000000..e146257e6
--- /dev/null
+++ b/modules/graphics/demos/textrendering/mathml/simple.dem.sce
@@ -0,0 +1,24 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Sylvestre LEDRU
+// Copyright (C) 2009 - Calixte DENIZET
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+my_handle = scf(100001);
+clf(my_handle,"reset");
+demo_viewCode("simple.dem.sce");
+
+// DEMO START
+
+f="<mrow><mi>&#x3b8;</mi><mo lspace=""0.278em"" rspace=""0.278em"">=</m"+...
+"o><mi>sin</mi><mspace width=""0.167em""/><mi>&#x3b1;</mi><mo"+...
+" lspace=""0.222em"" rspace=""0.222em"">&#xd7;</mo><mi>cos</mi><mspace width=""0.167em""/><mi>&#x3b2;</mi></mrow>";
+
+a="<mi>&#x3b1;</mi>";
+b="<mi>&#x3b2;</mi>";
+t="<mi>&#x3b8;</mi>";
+
+xtitle(f,a,b,t);
+plot3d;
+
+// DEMO END
diff --git a/modules/graphics/demos/textrendering/textrendering.dem.gateway.sce b/modules/graphics/demos/textrendering/textrendering.dem.gateway.sce
new file mode 100755
index 000000000..c915def29
--- /dev/null
+++ b/modules/graphics/demos/textrendering/textrendering.dem.gateway.sce
@@ -0,0 +1,17 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Sylvestre LEDRU
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+demopath = get_absolute_file_path("textrendering.dem.gateway.sce");
+
+subdemolist = [ ..
+"Full LaTeX demo" , "latex/fulltest.dem.sce" ; ..
+"LaTeX demo with subplots" , "latex/latexsubplot.dem.sce" ; ..
+"LaTeX with graphics" , "latex/simple.dem.sce" ; ..
+"LaTeX with colored box" , "latex/coloredlabel.dem.sce" ; ..
+"MathML with graphics" , "mathml/simple.dem.sce" ];
+
+
+subdemolist(:,2) = demopath + subdemolist(:,2);
+clear demopath;