# Xelatex and Sage notebook

20 views

### Kwankyu

Mar 6, 2010, 3:09:40 AM3/6/10
to sage-support
Hi,

Sage notebook provides a useful remote latex system. For international
users, how about providing xelatex as one of the options of latex
engine. Perhaps Sage may opt for xelatex if present rather than
pdflatex.

I want some expert who knows internals to tell if this suggestion is
reasonable and an implementation might not be difficult currently.

Kwankyu

### ma...@mendelu.cz

Mar 6, 2010, 6:39:05 AM3/6/10
to sage-support
Hi,

do you want to use Sage exclusively for xelatex? If so, it would be
better to port http://www.tlhiv.org/ltxpreview/ to xelatex.

Does xelatex need some extra packages? If not, replacing latex binary
with xelatex could help.

Robert Marik

### Kwankyu

Mar 6, 2010, 7:49:14 AM3/6/10
to sage-support
I think I want, e.g., the following works in Sage notebook.

%xelatex
실수 $x$에 대해서 다음이 성립한다.
$\sqrt{x^2}=|x|$

Kwankyu

### Dan Drake

Mar 6, 2010, 10:57:33 PM3/6/10

I've recently learned about xelatex and think it's awesome -- I can
*finally* include Hangeul in my documents! We should definitely have a
%xelatex function, although it would usually be necessary to add stuff
to the preamble to get the right fonts set up. But we already have
latex.add_to_preamble(), so it should be easy to get
%xelatex working.

Dan

--
--- Dan Drake
----- http://mathsci.kaist.ac.kr/~drake
-------

signature.asc

### Kwankyu

Mar 7, 2010, 6:04:41 AM3/7/10
to sage-support
Hi Dan,

Thank you for your positive opinion.

Xelatex is THE solution for documents with math and Hangul (or any non-
English scripts).

Perhaps we need to retain only %latex, and add a way to change the
active' latex engine from latex or pdflatex to xelatex. Currently it
seems Sage automatically choose either latex or pdflatex (with
friends) whichever is installed in the user's system. As xelatex
contains pdflatex in functionality (as far as I know), I think Sage
may default to xelatex if both are installed.

I also think there is not much to modify in the Sage code to implement
the above.

This is just another step toward Sage's internationalization.

Kwankyu
Kwankyu

### ma...@mendelu.cz

Mar 7, 2010, 9:49:18 AM3/7/10
to sage-support

On 7 bře, 12:04, Kwankyu <ekwan...@gmail.com> wrote:
> Hi Dan,
>
> Thank you for your positive opinion.
>
> Xelatex is THE solution for documents with math and Hangul (or any non-
> English scripts).
>
> Perhaps we need to retain only %latex, and add a way to change the
> active' latex engine from latex or pdflatex to xelatex. Currently it
> seems Sage automatically choose either latex or pdflatex (with
> friends) whichever is installed in the user's system. As xelatex
> contains pdflatex in functionality (as far as I know), I think Sage
> may default to xelatex if both are installed.
>

Is xelatex 100% compatible with latex? If not, this could cause
problems (with graphs, for example). Is it faster or slower when
processing graph picture (tkz-graph.sty)?

>
> This is just another step toward Sage's internationalization.

And what about LuaTeX? I think that it is better to keep "normal"
latex (which is usually pdflatex in dvi mode), pdflatex and add other
TeX's as option.

btw: Why do we have %latex in Sage? Does anybody use it hevily in her/
his notebooks?

Robert

### Andrzej Giniewicz

Mar 7, 2010, 11:01:53 AM3/7/10
> And what about LuaTeX? I think that it is better to keep "normal"
> latex (which is usually pdflatex in dvi mode), pdflatex and add other
> TeX's as option.

I'd vote for LuaTeX instead of XeTeX, it's lot more compatible, iirc
only 2 options from microtype package do not work with it and it's
soft failure that really don't stop compilation (package is aware of
luatex and can check for it). It too support utf8 formatted documents
and OpenType fonts I think and is "next pdfTeX", so probably better of
two.

> btw: Why do we have %latex in Sage? Does anybody use it hevily in her/
> his notebooks?

I personally use SageTeX if I need to work like that and almost no
%latex. But I would use %latex if there was way to hide it without
using %hide that's visible in cell, for example when it would work
like TinyMCE edited text cells with double-click to edit or similar.
Then it would be sweet to embed TeX in notebook, making it look nice
especially in published worksheets.

Andrzej.

### Kwankyu

Mar 7, 2010, 11:06:28 PM3/7/10
to sage-support
Hi,

On Mar 8, 1:01 am, Andrzej Giniewicz <ggi...@gmail.com> wrote:
> > And what about LuaTeX? I think that it is better to keep "normal"
> > latex (which is usually pdflatex in dvi mode), pdflatex and add other
> > TeX's as option.
>
> I'd vote for LuaTeX instead of XeTeX, it's lot more compatible, iirc
> only 2 options from microtype package do not work with it and it's
> soft failure that really don't stop compilation (package is aware of
> luatex and can check for it). It too support utf8 formatted documents
> and OpenType fonts I think and is "next pdfTeX", so probably better of
> two.

I don't have experience in LuaTeX. Anyway my suggestion is to let a
user to select the latex engine used in Sage.

> I would use %latex if there was way to hide it without
> using %hide that's visible in cell, for example when it would work
> like TinyMCE edited text cells with double-click to edit or similar.
> Then it would be sweet to embed TeX in notebook, making it look nice
> especially in published worksheets.
>
> Andrzej.

This is a good idea.

Kwankyu

### Jason Grout

Mar 8, 2010, 10:42:55 PM3/8/10
On 03/07/2010 10:06 PM, Kwankyu wrote:

>> I would use %latex if there was way to hide it without
>> using %hide that's visible in cell, for example when it would work
>> like TinyMCE edited text cells with double-click to edit or similar.
>> Then it would be sweet to embed TeX in notebook, making it look nice
>> especially in published worksheets.
>>
>> Andrzej.
>
> This is a good idea.

I think we should have text cells of different types. For example,
there has also been talk of having a ReST cell type, with the same sort
of double-click editing functionality, which would process ReST into
HTML to display.

Jason

### Kwankyu

Mar 10, 2010, 2:51:21 AM3/10/10
to sage-support
Hi Dan,

I worked on this. Would you review Trac 8486?

http://trac.sagemath.org/sage_trac/ticket/8486