[IPython-User] py2tex magic

klo uo klonuo@gmail....
Sun Nov 11 03:03:49 CST 2012


OK, I hit Shift-Enter on the end of line line, and it dosn't end the code,
then I hit Shift-Enter again, but same result:

========================================
In [9]: %%tex a=1.0

   ...: b = -1.0

   ...: c = -1.0

   ...: x_1=(-b+sqrt(b**2-4*a*c))/(2*a)

   ...: x_2=(-b-sqrt(b**2-4*a*c))/(2*a)

   ...: varphi = x_1

   ...:

a=1.0

b = -1.0

c = -1.0

x_1=(-b+sqrt(b**2-4*a*c))/(2*a) = 1.618

x_2=(-b-sqrt(b**2-4*a*c))/(2*a) = -0.618

varphi = x_1 = 1.618

File "<string>", line 0

 ^

SyntaxError: unexpected EOF while parsing
========================================

Is this happening on Linux too?


On Sun, Nov 11, 2012 at 9:57 AM, Thomas Kluyver <takowl@gmail.com> wrote:

> Exactly. You need a blank line to end the cell, and I think it might be
> trying to process that. Can you try with shift-enter, to execute the cell
> without the blank line?
>
> Thomas
> On Nov 11, 2012 8:53 AM, "klo uo" <klonuo@gmail.com> wrote:
>
>> It's in Qt Console
>>
>>
>> On Sun, Nov 11, 2012 at 9:38 AM, Thomas Kluyver <takowl@gmail.com> wrote:
>>
>>> Is it choking on the blank line you used to end the cell?
>>> On Nov 11, 2012 8:25 AM, "klo uo" <klonuo@gmail.com> wrote:
>>>
>>>> Very interesting extension, but unfortunately it does not do on Windows:
>>>>
>>>> ========================================
>>>> In [5]: %%tex a=1.0
>>>>
>>>>    ...: b = -1.0
>>>>
>>>>    ...: c = -1.0
>>>>
>>>>    ...: x_1=(-b+sqrt(b**2-4*a*c))/(2*a)
>>>>
>>>>    ...: x_2=(-b-sqrt(b**2-4*a*c))/(2*a)
>>>>
>>>>    ...: varphi = x_1
>>>>
>>>>    ...:
>>>>
>>>> a=1.0
>>>>
>>>> b = -1.0
>>>>
>>>> c = -1.0
>>>>
>>>> x_1=(-b+sqrt(b**2-4*a*c))/(2*a) = 1.618
>>>>
>>>> x_2=(-b-sqrt(b**2-4*a*c))/(2*a) = -0.618
>>>>
>>>> varphi = x_1 = 1.618
>>>>
>>>> File "<string>", line 0
>>>>
>>>>  ^
>>>>
>>>> SyntaxError: unexpected EOF while parsing
>>>> ========================================
>>>>
>>>>
>>>> I looked at the code, but have no idea what's going on.
>>>> Any thoughts?
>>>>
>>>>
>>>> On Wed, Nov 7, 2012 at 6:35 PM, Johan Beke <johanbeke@hotmail.com>wrote:
>>>>
>>>>>  Hello all,
>>>>>
>>>>> I finally finished my magic function to provide python input to tex
>>>>> conversion. I uploaded it at https://gist.github.com/4032651
>>>>> Feel free to contribute.
>>>>>
>>>>> What is possible for now:
>>>>> - single and multi line magic functions can be displayed (with or
>>>>> without result)
>>>>> - numerical output format can be set as a C prinft like format string
>>>>> - support for unum unit package
>>>>> - conversion of variable names with the greek letters (rules: a_b_c
>>>>> everything after first _ is subscript. Next _ are converted to , remaining
>>>>> parts are converted to greek letters)
>>>>>
>>>>> I tested this function already for calculations at my work and
>>>>> everything seems to be working fine.
>>>>>
>>>>> For now, the file must be placed in the startup direction. Anyone
>>>>> willing to convert it to an extension?
>>>>> Can I set a link somewhere in the wiki to make this magic functions
>>>>> available to users not in the list?
>>>>>
>>>>> Johan
>>>>>
>>>>> _______________________________________________
>>>>> IPython-User mailing list
>>>>> IPython-User@scipy.org
>>>>> http://mail.scipy.org/mailman/listinfo/ipython-user
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> IPython-User mailing list
>>>> IPython-User@scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/ipython-user
>>>>
>>>>
>>> _______________________________________________
>>> IPython-User mailing list
>>> IPython-User@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-user
>>>
>>>
>>
>> _______________________________________________
>> IPython-User mailing list
>> IPython-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-user
>>
>>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20121111/e68fc8de/attachment.html 


More information about the IPython-User mailing list