Re: [O] [suggest] We should import latex template system

2013-06-13 Thread Viktor Rosenfeld
Hi Marcin,

Marcin Borkowski wrote:

> Dnia 2013-06-12, o godz. 08:46:43
> Viktor Rosenfeld  napisał(a):
> 
> > I would also like to have a template mechanism for my LaTeX exports.
> > However, I think the way to do it in LaTeX is to write custom *.sty
> > files which can then be included using #+LATEX_HEADER:
> > \usepackage{...} for individual exports or more generally using
> > org-latex-packages-alist.
> > 
> > I've been wanting to learn how to do it but I did not find the time
> > yet. (Any pointers to good tutorials would be appreciated.)
> 
> It's easier than you might think.
> 
> http://www.ctan.org/pkg/clsguide
> http://tex.stackexchange.com/questions/2416/reference-guide-to-begin-writing-a-class-and-or-a-package

Thanks for these links!

Cheers,
Viktor




Re: [O] [suggest] We should import latex template system

2013-06-13 Thread Marcin Borkowski
Dnia 2013-06-12, o godz. 08:46:43
Viktor Rosenfeld  napisał(a):

> I would also like to have a template mechanism for my LaTeX exports.
> However, I think the way to do it in LaTeX is to write custom *.sty
> files which can then be included using #+LATEX_HEADER:
> \usepackage{...} for individual exports or more generally using
> org-latex-packages-alist.
> 
> I've been wanting to learn how to do it but I did not find the time
> yet. (Any pointers to good tutorials would be appreciated.)

It's easier than you might think.

http://www.ctan.org/pkg/clsguide
http://tex.stackexchange.com/questions/2416/reference-guide-to-begin-writing-a-class-and-or-a-package

> Cheers,
> Viktor

Hth,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



Re: [O] [suggest] We should import latex template system

2013-06-12 Thread Feng Shu
>
> (eval-after-load 'ox-latex
>   '(add-to-list 'org-latex-classes
>   '("myclass" "\\documentclass{article}
> [NO-DEFAULT-PACKAGES]
> [NO-PACKAGES]
> [EXTRA]
> \\usepackage{mychinesestylefile}"
>   ("\\section{%s}" . "\\section*{%s}")
>   ("\\subsection{%s}" . "\\subsection*{%s}")
>   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>   ("\\paragraph{%s}" . "\\paragraph*{%s}")
>   ("\\subparagraph{%s}" . "\\subparagraph*{%s}"
>
> And then in any given document:
>
> #+LaTeX_CLASS: myclass

At the moment, I am using the similar solution!  

If you use this way,  org-mode fragement previewing  may be broken if
you setting \pagestyle{fancy}. 


>
> If I need to layer another project-specific style file on top of that, I
> add a second line in the header:
>
> #+LaTeX_HEADER: \usepackage{someparticularpackage}
>
> Any document that might require Chinese starts as a "myclass", and then
> goes from there. I set this up a year ago, and haven't needed to mess
> with it since.

There are many, the first one is "ctex", which may be the most popular
latex solution of  chinese users.

All the university latex templates in China seem to be writen as
"class", instead of "style".

and nearly all  of them are derive from  class "article" or "book"

It is the reason that I want this feature:

#+LaTeX_CLASS: article:myclass

It will use default "article" template, and replace class name to myclass!

>
> Hope that helps,
> Eric

-- 



Re: [O] [suggest] We should import latex template system

2013-06-12 Thread Rasmus
Feng Shu  writes:

>>> 1. I don't need customize 'org-latex-classes
>>
>> I don't see why customizing `org-latex-classes' _once_ would be
>> a nightmare.
>
> If all the CJKV org-mode users need customize this virable _once_ ,
> It's a nightmare for org-mode, for all the CJKV org-mode users need to
> know how to customize this virable!
>
> If we add all the "class" common used in the world, `org-latex-classes
> will be very very long!

Org ships with like three or four classes. . .  Not all classes in the
world. You can add your own.  With add-to-list it's not even
'dangerous'.  Are you looking for a system to your custom classes?

I have at least five classes that I use, e.g. #+LATEX_CLASS:
problemset loads lots of math stuff and tikz. . .  This seems pretty
close to optimal to me less the fact that you need to escape '\', but
that's just Emacs Lisp.

–Rasmus

-- 
May the Force be with you




Re: [O] [suggest] We should import latex template system

2013-06-12 Thread Feng Shu
Nicolas Goaziou  writes:

> Hello,
>
> Feng Shu  writes:
>
>> I don't know other language users, for Chinese latex user, the first
>> thing of write a document may  change the document class, for example,
>> change "article" to "ctexart". If I want use org-mode ,I should add all
>> the "class" common used  to the "org-latex-classes", It will be  a
>> nightmare.
>>
>> In org-latex-class, "article"  and  "ctexart" elements are  very similar, the
>> only different may be their class names.
>>
>> I want such result:
>>
>> 1. I don't need customize 'org-latex-classes
>
> I don't see why customizing `org-latex-classes' _once_ would be
> a nightmare.

If all the CJKV org-mode users need customize this virable _once_ ,
It's a nightmare for org-mode, for all the CJKV org-mode users need to
know how to customize this virable!

If we add all the "class" common used in the world, `org-latex-classes
will be very very long!

>
>
> Regards,

-- 



Re: [O] [suggest] We should import latex template system

2013-06-12 Thread Eric Abrahamsen
Feng Shu  writes:

> Feng Shu  writes:
>
>> Viktor Rosenfeld  writes:
>>
>>> Hi,
>>>
>>> Feng Shu wrote:
>>>
 org-mode odt exporter are using 'org-odt-styles-file, which are odt
 templetes, I think latex exporter should do like this. for example:
>>>
>>> I would also like to have a template mechanism for my LaTeX exports.
>>> However, I think the way to do it in LaTeX is to write custom *.sty
>>> files which can then be included using #+LATEX_HEADER: \usepackage{...}
>>> for individual exports or more generally using org-latex-packages-alist.
>>
>> .sty can be easily resolved.
>>
>> The problem is that many template should be writen as "class" instead of
>> "style".   If I want to use a custom class , I need to do:
>>
>> 1. (add-to-list 'org-latex-classes ...)
>> 2. (setq org-latex-default-class ...)
>>
>>
>> I don't know other language users, for Chinese latex user, the first
>> thing of write a document may  change the document class, for example,
>> change "article" to "ctexart". If I want use org-mode ,I should add all
>> the "class" common used  to the "org-latex-classes", It will be  a
>> nightmare.
>>
>> In org-latex-class, "article"  and  "ctexart" elements are  very similar, the
>> only different may be their class names.
>>
>> I want such result:
>>
>> 1. I don't need customize 'org-latex-classes
>> 2. #+LATEX_CLASS: ctexart  can work!
>
> #+LATEX_ARTICLE_CLASS: ctexart   ?
> #+LATEX_CLASS:  article:ctexart  ?

I do Chinese documents using xelatex, and it works just fine (with the
xeCJK package). I make a "mychinesestylefile.sty" file with all my
xelatex and Chinese font stuff. Then:

(eval-after-load 'ox-latex
  '(add-to-list 'org-latex-classes
  '("myclass" "\\documentclass{article}
[NO-DEFAULT-PACKAGES]
[NO-PACKAGES]
[EXTRA]
\\usepackage{mychinesestylefile}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"

And then in any given document:

#+LaTeX_CLASS: myclass

If I need to layer another project-specific style file on top of that, I
add a second line in the header:

#+LaTeX_HEADER: \usepackage{someparticularpackage}

Any document that might require Chinese starts as a "myclass", and then
goes from there. I set this up a year ago, and haven't needed to mess
with it since.

Hope that helps,
Eric




Re: [O] [suggest] We should import latex template system

2013-06-12 Thread Nicolas Goaziou
Hello,

Feng Shu  writes:

> I don't know other language users, for Chinese latex user, the first
> thing of write a document may  change the document class, for example,
> change "article" to "ctexart". If I want use org-mode ,I should add all
> the "class" common used  to the "org-latex-classes", It will be  a
> nightmare.
>
> In org-latex-class, "article"  and  "ctexart" elements are  very similar, the
> only different may be their class names.
>
> I want such result:
>
> 1. I don't need customize 'org-latex-classes

I don't see why customizing `org-latex-classes' _once_ would be
a nightmare.


Regards,

-- 
Nicolas Goaziou



Re: [O] [suggest] We should import latex template system

2013-06-12 Thread Feng Shu
Feng Shu  writes:

> Viktor Rosenfeld  writes:
>
>> Hi,
>>
>> Feng Shu wrote:
>>
>>> org-mode odt exporter are using 'org-odt-styles-file, which are odt
>>> templetes, I think latex exporter should do like this. for example:
>>
>> I would also like to have a template mechanism for my LaTeX exports.
>> However, I think the way to do it in LaTeX is to write custom *.sty
>> files which can then be included using #+LATEX_HEADER: \usepackage{...}
>> for individual exports or more generally using org-latex-packages-alist.
>
> .sty can be easily resolved.
>
> The problem is that many template should be writen as "class" instead of
> "style".   If I want to use a custom class , I need to do:
>
> 1. (add-to-list 'org-latex-classes ...)
> 2. (setq org-latex-default-class ...)
>
>
> I don't know other language users, for Chinese latex user, the first
> thing of write a document may  change the document class, for example,
> change "article" to "ctexart". If I want use org-mode ,I should add all
> the "class" common used  to the "org-latex-classes", It will be  a
> nightmare.
>
> In org-latex-class, "article"  and  "ctexart" elements are  very similar, the
> only different may be their class names.
>
> I want such result:
>
> 1. I don't need customize 'org-latex-classes
> 2. #+LATEX_CLASS: ctexart  can work!

#+LATEX_ARTICLE_CLASS: ctexart   ?
#+LATEX_CLASS:  article:ctexart  ?

>
>>
>> I've been wanting to learn how to do it but I did not find the time yet.
>> (Any pointers to good tutorials would be appreciated.)
>>
>> Cheers,
>> Viktor
>>
>>> 
>>>
>>> org-latex-styles-file  or  org-latex-templete-file
>>> 
>>> 
>>> we can include many different language's templates into org, and no need
>>> touch the ox-latex.el and the user can write theirs template easily,
>>> 
>>> 
>>> 
>>> we can use "locale" to determine which template will be used
>>> 
>>> 
>>> 
>>> converting latex fragements can use templates too, like:
>>> 
>>> 
>>> org-latex-fragment-templete-file
>>> 
>>> 
>>> 
>>> -- 
>>> 

-- 



Re: [O] [suggest] We should import latex template system

2013-06-12 Thread Feng Shu
Viktor Rosenfeld  writes:

> Hi,
>
> Feng Shu wrote:
>
>> org-mode odt exporter are using 'org-odt-styles-file, which are odt
>> templetes, I think latex exporter should do like this. for example:
>
> I would also like to have a template mechanism for my LaTeX exports.
> However, I think the way to do it in LaTeX is to write custom *.sty
> files which can then be included using #+LATEX_HEADER: \usepackage{...}
> for individual exports or more generally using org-latex-packages-alist.

.sty can be easily resolved.

The problem is that many template should be writen as "class" instead of
"style".   If I want to use a custom class , I need to do:

1. (add-to-list 'org-latex-classes ...)
2. (setq org-latex-default-class ...)


I don't know other language users, for Chinese latex user, the first
thing of write a document may  change the document class, for example,
change "article" to "ctexart". If I want use org-mode ,I should add all
the "class" common used  to the "org-latex-classes", It will be  a
nightmare.

In org-latex-class, "article"  and  "ctexart" elements are  very similar, the
only different may be their class names.

I want such result:

1. I don't need customize 'org-latex-classes
2. #+LATEX_CLASS: ctexart  can work!

>
> I've been wanting to learn how to do it but I did not find the time yet.
> (Any pointers to good tutorials would be appreciated.)
>
> Cheers,
> Viktor
>
>> 
>>
>> org-latex-styles-file  or  org-latex-templete-file
>> 
>> 
>> we can include many different language's templates into org, and no need
>> touch the ox-latex.el and the user can write theirs template easily,
>> 
>> 
>> 
>> we can use "locale" to determine which template will be used
>> 
>> 
>> 
>> converting latex fragements can use templates too, like:
>> 
>> 
>> org-latex-fragment-templete-file
>> 
>> 
>> 
>> -- 
>> 

-- 



Re: [O] [suggest] We should import latex template system

2013-06-11 Thread Viktor Rosenfeld
Hi,

Feng Shu wrote:

> org-mode odt exporter are using 'org-odt-styles-file, which are odt
> templetes, I think latex exporter should do like this. for example:

I would also like to have a template mechanism for my LaTeX exports.
However, I think the way to do it in LaTeX is to write custom *.sty
files which can then be included using #+LATEX_HEADER: \usepackage{...}
for individual exports or more generally using org-latex-packages-alist.

I've been wanting to learn how to do it but I did not find the time yet.
(Any pointers to good tutorials would be appreciated.)

Cheers,
Viktor

> 
>
> org-latex-styles-file  or  org-latex-templete-file
> 
> 
> we can include many different language's templates into org, and no need
> touch the ox-latex.el and the user can write theirs template easily,
> 
> 
> 
> we can use "locale" to determine which template will be used
> 
> 
> 
> converting latex fragements can use templates too, like:
> 
> 
> org-latex-fragment-templete-file
> 
> 
> 
> -- 
> 



[O] [suggest] We should import latex template system

2013-06-11 Thread Feng Shu

Hi:

org-mode odt exporter are using 'org-odt-styles-file, which are odt
templetes, I think latex exporter should do like this. for example:

   
org-latex-styles-file  or  org-latex-templete-file


we can include many different language's templates into org, and no need
touch the ox-latex.el and the user can write theirs template easily,



we can use "locale" to determine which template will be used



converting latex fragements can use templates too, like:


org-latex-fragment-templete-file



--