[IPython-dev] More complicated LaTeX output in IPython notebook cells.

Rick Muller rpmuller@gmail....
Tue Jun 18 14:27:40 CDT 2013


Yeah, I was afraid of that. On to other solutions, then.


On Tue, Jun 18, 2013 at 10:55 AM, Aron Ahmadia <aron@ahmadia.net> wrote:

> I don't believe MathJax even supports \input :)
>
> I think if you want to have dynamic art online, you'll need to switch to a
> solution that provides more of TeX (you could check to see if
> writelatex.com does what you want), or as you suggested yourself, learn
> how to generate SVG or other online graphics using a Javascript library.
>
> A
>
>
> On Tue, Jun 18, 2013 at 5:48 PM, Rick Muller <rpmuller@gmail.com> wrote:
>
>> I'm interested in getting working quantum circuit drawings in IPython
>> notebook cells. The current approaches that do this use latex to draw these
>> circuits, so I was hoping this wouldn't be too difficult to make work.
>>
>> Ike Chuang has a python program called [qasm2circ](
>> http://www.media.mit.edu/quanta/qasm2circ/). I wrote a lightweight
>> python class around the object that wraps the basic parsing methods and
>> presents a _repr_latex_ method so that I could display the circuit. This
>> outputs something that looks like:
>>
>> \input{xyqcirc.tex}
>>
>> % definitions for the circuit elements
>>
>> \def\gAxA{\op{H}\w\A{gAxA}}
>> \def\gBxA{\b\w\A{gBxA}}
>> \def\gBxB{\o\w\A{gBxB}}
>>
>> % definitions for bit labels and initial states
>>
>> \def\bA{ \q{q_{0}}}
>> \def\bB{ \q{q_{1}}}
>>
>> % The quantum circuit as an xymatrix
>>
>> \xymatrix@R=5pt@C=10pt{
>>     \bA & \gAxA &\gBxA &\n
>> \\  \bB & \n   &\gBxB &\n
>> %
>> % Vertical lines and other post-xymatrix latex
>> %
>> \ar@{-}"gBxB";"gBxA"
>> }
>>
>> which doesn't display, I think because the xyqcirc.tex stuff isn't
>> supported by mathjax.
>> Does anyone know of a workaround for this, or should I start honing my SVG
>> skills to generate a more native option?
>>
>> --
>> Rick Muller
>> rpmuller@gmail.com
>> 505-750-7557
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>


-- 
Rick Muller
rpmuller@gmail.com
505-750-7557
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20130618/3ec08d2e/attachment-0001.html 


More information about the IPython-dev mailing list