Displaying binomials and matrices using asciimath with mathjax - python-3.x

I'm trying to display different math problems using asciimath and mathjax. However some things does not seem to be supported in asciimath. For instance I'm trying to display a binomial/matrix and I can't really figure out how to do it. Would I have to use latex or mathml to do this, or is there a way to use asciimath for this?
update: I found a kinda cheeky way to show binomials in asciimath: (""_1^2) This works, but it is kinda hacky.

You can use
([1],[3])
to get a matrix with two rows of one element each surrounded by parentheses. That may be what you want, though it may be too tall for use with in-line expressions.

Related

WebVR show html content

I'd like to create a virtual space where I want to mix 3D elements and html content. I have seem some demos with WebVR but didn't work for me. WebAR is also an interesting option.
Thanks
Unfortunately, this isn't possible at the moment, because
there is no proper way to get your hands on the rastered output of the HTML in order to use it as a texture in WebGL and
there is no way to get any html-element shown in a WebVR-context
There is certainly work being done in both directions, but your best bets would probably be a-frame (https://aframe.io/) or reactVR (https://developer.oculus.com/blog/introducing-the-react-vr-pre-release/) which both at least have a bit of that html-feeling to it and can handle text pretty well (nothing compared to the power of html+css, but they will get there at some point).
Another option is to use a library like html2canvas (https://html2canvas.hertzen.com/) to get some rendered output from a piece of html which you can then use as a texture. Also has it's limits but might be worth a try...
Have fun!

How can you combine Mathjax with Mathplayer?

This site http://accessiblemath.dessci.com/2010/09/mathplayer-mathjax-more-accessible-math.html is telling me it's possible to combine Mathjax with Mathplayer to make mathematics display faster.
A great feature of MathJax is that it can turn the display of math
over to a native MathML renderer such as MathPlayer. This results in
much faster display of the math.
Is this a good idea and if so, how should one go about doing this?
You don't have to do anything. MathJax will recognize the presence of MathPlayer automatically and hand over rendering of any MathML. (MathJax will still convert TeX or AsciiMath to MathML first.)

Advanced CSS Circles

I'm trying to make 3 different circles to my website. I don't want to insert it as a graphic/image file. So I've been trying to achieve it using CSS3, but I can't really work my fingers around it.
What will it look like?
I have uploaded a picture of what I'm trying to achieve at: www.sp34k.com/etc/circles.jpg
I can't really show the code I've been trying to use to achieve this, as it all looks totally weird and nothing floats currectly.
What I've tried
What I've tried is to make 3 circles with position absolute and then use % (percentage) to determine the width of the colored parts, but I can't twist my mind around how it should be set up.
Any suggestions is appreciated,
Mike
Here is a simple try of me to achieve the effect you want:
DEMO
edit: css-only solution
It can be easily animated with javascript or keyframes. Arbitrary content would go into the inner div. To change the percentage, simply adjust the angle of the pseudo-elements.
With a little more effort this could be easily refined I guess;)
Note: the transform has the webkit-prefix, so it works only in chrome/safari - to see it in firefox or other browsers, you need to change the prefix.
P.S. I will animate it when I'm home from work.
Good one by Christoph but he is using SASS/SCSS which are comparatively slow then normal CSS because they have to be converted to CSS before browser render it so I have have a different Solution for you
try this fiddle

How to put a figure on the top of a page on its own in latex?

One of the figures appear in the middle of a page (on its own) when the figure does not fit the other text. How to show it on top of the new page?
If all else fails, just add \vspace*{3in} to the bottom of your figure below the \caption. Then by trial and error change the 3in dimension until you get the look you want. This is of course pure brute force, but sometimes that's a lot easier than trying to get LaTeX to do things the "right" way.
When in doubt, use brute force.
--- Ken Thompson
I think I misunderstood your question. Are you asking "how do I get floats on pages by themselves to be at the top of the page, rather than vertically centred?"?.
If so, here's how to customise the float page. From source2e, glue is inserted at the top and bottom of the page, and between each float on the page. This inserted glue is given by the following parameters:
\setlength\#fptop{0\p# \#plus 1fil}
\setlength\#fpsep{8\p# \#plus 2fil}
\setlength\#fpbot{0\p# \#plus 1fil}
Simply redefine these to get the output you like. For example, for top- and bottom- aligned floats: (untested)
\makeatletter
\setlength\#fptop{0pt}
\setlength\#fpsep{8pt plus 1fil}
\setlength\#fpbot{0pt}
\makeatother
You can insert a pagebreak via \clearpage or \newpage, then use the t option on the figure environment:
...
\clearpage
\begin{figure}[t!]
\centering
\includegraphics[scale=.75]{graphic/...}
\caption{}
\label{fig:}
\end{figure}
...
If there's nowhere for the figure to fit then it will go on a page by itself. See the FAQ answer on floats for more information on how to customise this behaviour.

Alternatives to using text() to adding text to a plot

This may be a naive question, but I was wondering if there's a better way than using text() to adding text to a plot. Note, I'm also using layout() as well. Specifically, I have a section of a plot where I would like to add some text with headings followed by regular text.
text() is fine it seems for simple annotations, but to get the spacing right for several lines of text seems to require a lot of manual manipulation of the x and y and cex parameters. Any suggestions?
Here are some alternative options to consider:
- the gplots package has a textplot function to add some text output in a base graphics plot.
- plotrix has a function addtable2plot
- for grid graphics grid.text() is available and in gridExtra there is a function grid.table() (see, e.g., R-Wiki)
If you're using base graphics, then text() is probably your best bet, and fiddling with coordinates etc is part of the game. If you want to learn a new framework, the lattice package is a reworking of the basic approach to plotting in R. It be installed by default so help(package='lattice') will get you started.
Here's a pretty good guide (pdf) to graphics in general in R, with a substantial section on lattice:
download

Resources