Re: [O] how putting \begin{document} at the right place to export a specific latex class ?

2018-06-12 Thread Joseph Vidal-Rosset
For this  very interesting setup,  many thanks Tim.  I am going  to test
it and I will inform you about the results and/or my difficulties.

Many thanks  again to Nick  and to John,  I always appreciate  your very
kind help. (This list is terrific.)

(The  problem  with  this  latex  class  is  that  it  uses
unconventional commands at unconventional places.)

 Best wishes,
-- 
Jo.



Re: [O] how putting \begin{document} at the right place to export a specific latex class ?

2018-06-11 Thread Tim Cross


Is this something you need on a permanent basis or is it just for one
document you need to produce?

If it is something you need on a permanent basis, then something like
what I have in my init.el file might work. (beware of the formatting
here - mail is likely to make a mess of it, so it may be easier to copy
the below into your *scratch* buffer and read it there.). This is just
an example of how you can 'tweak' the default org setup to use specific
Latex styles and classes. There are other ways to do it, but this one
has worked the best for me over the long term. 

<<
(setq org-latex-classes
  '(("beamer"
 "\\documentclass[presentation]{beamer}"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
("article"
 "\\documentclass[12pt]{hitec}
[DEFAULT-PACKAGES]
[PACKAGES]
[NO-EXTRA]
\\settextfraction{0.95}\n"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
("report"
 "\\documentclass[11pt]{report}"
 ("\\part{%s}" . "\\part*{%s}")
 ("\\chapter{%s}" . "\\chapter*{%s}")
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
("book"
 "\\documentclass[11pt]{book}"
 ("\\part{%s}" . "\\part*{%s}")
 ("\\chapter{%s}" . "\\chapter*{%s}")
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
("une-article"
 "\\documentclass[a4paper,12pt]{scrartcl}
[DEFAULT-PACKAGES]
[PACKAGES]
\\usepackage[margin=1.5cm]{geometry}
[EXTRA]\n"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
("une-logo"
 "\\documentclass[a4paper,12pt]{scrartcl}
[DEFAULT-PACKAGES]
[PACKAGES]
\\usepackage[margin=1.5cm]{geometry}
[EXTRA]
\\definecolor{unegreen}{HTML}{7AB800}
\\definecolor{Black}{HTML}{00}
\\definecolor{White}{HTML}{FF}
\\definecolor{dimgrey}{HTML}{696969}
\\makeatletter
\\def\\@maketitle{
 \\noindent \\begin{minipage}[c][4cm][t]{\\linewidth}
   \\colorbox{Black}{%
 \\begin{minipage}[t][4cm][c]{4cm}
 \\flushleft
 \\includegraphics{~/.emacs.d/img/unelogo_medium.png}
   \\end{minipage}}
   \\colorbox{unegreen}{%
 \\begin{minipage}[t][4cm][c]{13.5cm}
   \\flushright
   \\Large \\textbf{\\color{White}{\\@title}} 
\\vspace{4pt}
   \\small \\color{White}{\\@author} 
   \\small \\color{White}{\\@date}
 \\end{minipage}}
   \\end{minipage}}
\\makeatother\n"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
("old-article" "\\documentclass[11pt]{article}"
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
  )
>

The above defines a number of org document types I can use in
exports. You have

- beamer :: presentation
- article :: which is modified from default to use the 'hitec'
 Note the \settestfraction line used to modify the behaviour
 of the class.
- report :: standard report
- book :: standard book
- une-article :: customised work document using the scrartcl Korma
 script class
- une-logo :: A work document which includes a logo.

This last one uses - \maketitle and \minipage as well as other standard
commands, all of - which need to be inserted into the latex document
before the \begin{}. Essentially, you can replace this with whatever
latex commands you need before the \begin{document} line.

To use this new class, I put the following in my org document

#+LATEX_CLASS: une-logo

and lines for #+TITLE:, #+SUBTITLE: etc.

Obviously, you will need to work out what needs to be added and
depending on what it is, you may need to modify some of the 

Re: [O] how putting \begin{document} at the right place to export a specific latex class ?

2018-06-11 Thread Nick Dokos
Joseph Vidal-Rosset  writes:

> Here  is my  problem: for  a specific  latex class  (xxllp.cls), I  have
> difficulties  to get  the \begin{document}  at the  right place  in this
> add-to-list:
>
> (add-to-list 'org-latex-classes
>  '("xxllp"
>"\\documentclass\[oumk,xs]\{xxllp\}
>  [NO-DEFAULT-PACKAGES]
>  [NO-PACKAGES]
> \\usepackage{amsmath}
> \\usepackage{amssymb}
> \\usepackage{blabla}
> \\usepackage{blablabla}   
> \\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
>  \\LaLPonline{??} \\setcounter{page}{1} 
> \\thispagestyle{LLPrrobezissn} \\label{p}
> \\AuthorTitle{Joseph Vidal-Rosset}{\\uppercase{Title of the paper}}" 
>("\\section\{%s\} . \\section*\{%s\}")
>("\\subsection\{%s\} . \\subsection*\{%s\}")
>  ))
>
>
> For this class, the \begin{document} should be just after
> \\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
> and just before 
>  \\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn}
> \\label{p}
>

I don't think you can do that with org-latex-classes: you can define
the header part (i.e. some of what goes before the \begin{document}_
and you can define how to map headers at different depths to the latex
sectioning structure, but you cannot do precise placement the way that
you are trying to.

There may be a better way now, but in the old days I used to redefine
the org-latex-title-command variable. It gets emitted after the
\begin{document} so you can do something like this

  (setq org-latex-title-command "\\foo\\maketitle")

to insert additional stuff.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] how putting \begin{document} at the right place to export a specific latex class ?

2018-06-11 Thread John Kitchin
I mean to put this in your init file:

(add-to-list 'org-latex-classes
 '("xxllp"
   "\\documentclass[oumk,xs]{xxllp}
 [NO-DEFAULT-PACKAGES]
 [NO-PACKAGES]
\\usepackage{amsmath}
\\usepackage{amssymb}
\\usepackage{blabla}
\\usepackage{blablabla}
\\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
"
   ("\\section{%s}" . "\\section*{%s}")
   ("\\subsection{%s}" . "\\subsection*{%s}")
   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
   ("\\paragraph{%s}" . "\\paragraph*{%s}")
   ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))


And then in your org file:

#+latex_class: xxllp
#+options: toc:nil

#+BEGIN_EXPORT latex
\\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn}
\\label{p}
\AuthorTitle{Joseph Vidal-Rosset}{\uppercase{Title of the paper}}
#+END_EXPORT

plus rest of your document. That exports as:

% Created 2018-06-11 Mon 09:50
% Intended LaTeX compiler: pdflatex
\documentclass[oumk,xs]{xxllp}
 \usepackage{amsmath}
\usepackage{amssymb}
\usepackage{blabla}
\usepackage{blablabla}
\pagestyle{myheadings}\markboth{Author}{Title of the paper}
\author{John Kitchin}
\date{\today}
\title{}
\begin{document}

\\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn}
\\label{p}
\AuthorTitle{Joseph Vidal-Rosset}{\uppercase{Title of the paper}}

the rest of your document...

\end{document}




John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Mon, Jun 11, 2018 at 8:29 AM, Joseph Vidal-Rosset <
joseph.vidal.ros...@gmail.com> wrote:

> Le lun. 11 juin 2018 à 07:23:54 , John Kitchin 
> a envoyé ce message:
> > Why can’t you just put that last one in your org file?
>
> Dear John,
>
> I confess  that I  do not  understand the solution  you suggest.  Do you
> suggest to me to put all the headers of this class in an org file?
> Sorry to be so slow.
>
> Best wishes,
>
> --
> Joseph
>


Re: [O] how putting \begin{document} at the right place to export a specific latex class ?

2018-06-11 Thread Joseph Vidal-Rosset
Le lun. 11 juin 2018 à 07:23:54 , John Kitchin 
a envoyé ce message:
> Why can’t you just put that last one in your org file?

Dear John,

I confess  that I  do not  understand the solution  you suggest.  Do you
suggest to me to put all the headers of this class in an org file?
Sorry to be so slow. 

Best wishes, 

-- 
Joseph 



Re: [O] how putting \begin{document} at the right place to export a specific latex class ?

2018-06-11 Thread John Kitchin
Why can’t you just put that last one in your org file?

On Mon, Jun 11, 2018 at 7:17 AM Joseph Vidal-Rosset <
joseph.vidal.ros...@gmail.com> wrote:

> Thank you John. Therefore I am afraid I will have to give up the export of
> this latex class. Too bad.
>
> Jo.
>
> 2018-06-11 16:01 GMT+02:00 John Kitchin :
>
>> It looks like that is probably not possible.  By your description,
>> everything after \\pagestyle{myheadings}\\markboth{Author}{Title of the
>> paper} belongs in the document, and this variable is for setting the header.
>>
>>  \\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn}
>> \\label{p} should probably go in your org file as the first line.
>>
>> John
>>
>> ---
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>
>>
>> On Mon, Jun 11, 2018 at 5:42 AM, Joseph Vidal-Rosset <
>> joseph.vidal.ros...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> Here  is my  problem: for  a specific  latex class  (xxllp.cls), I  have
>>> difficulties  to get  the \begin{document}  at the  right place  in this
>>> add-to-list:
>>>
>>> (add-to-list 'org-latex-classes
>>>  '("xxllp"
>>>"\\documentclass\[oumk,xs]\{xxllp\}
>>>  [NO-DEFAULT-PACKAGES]
>>>  [NO-PACKAGES]
>>> \\usepackage{amsmath}
>>> \\usepackage{amssymb}
>>> \\usepackage{blabla}
>>> \\usepackage{blablabla}
>>> \\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
>>>\\LaLPonline{??} \\setcounter{page}{1}
>>> \\thispagestyle{LLPrrobezissn} \\label{p}
>>> \\AuthorTitle{Joseph Vidal-Rosset}{\\uppercase{Title of the paper}}"
>>>("\\section\{%s\} . \\section*\{%s\}")
>>>("\\subsection\{%s\} . \\subsection*\{%s\}")
>>>))
>>>
>>>
>>> For this class, the \begin{document} should be just after
>>> \\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
>>> and just before
>>>  \\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn}
>>> \\label{p}
>>>
>>> but because I do not understand  clearly the syntax of the function, I
>>> do not succeed and the export does not work correctly.
>>>
>>> Any suggestion?
>>>
>>> --
>>> Joseph
>>>
>>>
>>
> --
John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


Re: [O] how putting \begin{document} at the right place to export a specific latex class ?

2018-06-11 Thread Joseph Vidal-Rosset
Thank you John. Therefore I am afraid I will have to give up the export of
this latex class. Too bad.

Jo.

2018-06-11 16:01 GMT+02:00 John Kitchin :

> It looks like that is probably not possible.  By your description,
> everything after \\pagestyle{myheadings}\\markboth{Author}{Title of the
> paper} belongs in the document, and this variable is for setting the header.
>
>  \\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn}
> \\label{p} should probably go in your org file as the first line.
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Mon, Jun 11, 2018 at 5:42 AM, Joseph Vidal-Rosset <
> joseph.vidal.ros...@gmail.com> wrote:
>
>> Hello,
>>
>> Here  is my  problem: for  a specific  latex class  (xxllp.cls), I  have
>> difficulties  to get  the \begin{document}  at the  right place  in this
>> add-to-list:
>>
>> (add-to-list 'org-latex-classes
>>  '("xxllp"
>>"\\documentclass\[oumk,xs]\{xxllp\}
>>  [NO-DEFAULT-PACKAGES]
>>  [NO-PACKAGES]
>> \\usepackage{amsmath}
>> \\usepackage{amssymb}
>> \\usepackage{blabla}
>> \\usepackage{blablabla}
>> \\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
>>\\LaLPonline{??} \\setcounter{page}{1}
>> \\thispagestyle{LLPrrobezissn} \\label{p}
>> \\AuthorTitle{Joseph Vidal-Rosset}{\\uppercase{Title of the paper}}"
>>("\\section\{%s\} . \\section*\{%s\}")
>>("\\subsection\{%s\} . \\subsection*\{%s\}")
>>))
>>
>>
>> For this class, the \begin{document} should be just after
>> \\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
>> and just before
>>  \\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn}
>> \\label{p}
>>
>> but because I do not understand  clearly the syntax of the function, I
>> do not succeed and the export does not work correctly.
>>
>> Any suggestion?
>>
>> --
>> Joseph
>>
>>
>


Re: [O] how putting \begin{document} at the right place to export a specific latex class ?

2018-06-11 Thread John Kitchin
It looks like that is probably not possible.  By your description,
everything after \\pagestyle{myheadings}\\markboth{Author}{Title of the
paper} belongs in the document, and this variable is for setting the header.

 \\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn}
\\label{p} should probably go in your org file as the first line.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Mon, Jun 11, 2018 at 5:42 AM, Joseph Vidal-Rosset <
joseph.vidal.ros...@gmail.com> wrote:

> Hello,
>
> Here  is my  problem: for  a specific  latex class  (xxllp.cls), I  have
> difficulties  to get  the \begin{document}  at the  right place  in this
> add-to-list:
>
> (add-to-list 'org-latex-classes
>  '("xxllp"
>"\\documentclass\[oumk,xs]\{xxllp\}
>  [NO-DEFAULT-PACKAGES]
>  [NO-PACKAGES]
> \\usepackage{amsmath}
> \\usepackage{amssymb}
> \\usepackage{blabla}
> \\usepackage{blablabla}
> \\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
>\\LaLPonline{??} \\setcounter{page}{1}
> \\thispagestyle{LLPrrobezissn} \\label{p}
> \\AuthorTitle{Joseph Vidal-Rosset}{\\uppercase{Title of the paper}}"
>("\\section\{%s\} . \\section*\{%s\}")
>("\\subsection\{%s\} . \\subsection*\{%s\}")
>))
>
>
> For this class, the \begin{document} should be just after
> \\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
> and just before
>  \\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn}
> \\label{p}
>
> but because I do not understand  clearly the syntax of the function, I
> do not succeed and the export does not work correctly.
>
> Any suggestion?
>
> --
> Joseph
>
>


[O] how putting \begin{document} at the right place to export a specific latex class ?

2018-06-11 Thread Joseph Vidal-Rosset
Hello,

Here  is my  problem: for  a specific  latex class  (xxllp.cls), I  have
difficulties  to get  the \begin{document}  at the  right place  in this
add-to-list:

(add-to-list 'org-latex-classes
 '("xxllp"
   "\\documentclass\[oumk,xs]\{xxllp\}
 [NO-DEFAULT-PACKAGES]
 [NO-PACKAGES]
\\usepackage{amsmath}
\\usepackage{amssymb}
\\usepackage{blabla}
\\usepackage{blablabla}   
\\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
   \\LaLPonline{??} \\setcounter{page}{1} 
\\thispagestyle{LLPrrobezissn} \\label{p}
\\AuthorTitle{Joseph Vidal-Rosset}{\\uppercase{Title of the paper}}" 
   ("\\section\{%s\} . \\section*\{%s\}")
   ("\\subsection\{%s\} . \\subsection*\{%s\}")
   ))


For this class, the \begin{document} should be just after
\\pagestyle{myheadings}\\markboth{Author}{Title of the paper}
and just before 
 \\LaLPonline{??} \\setcounter{page}{1} \\thispagestyle{LLPrrobezissn}
\\label{p}

but because I do not understand  clearly the syntax of the function, I
do not succeed and the export does not work correctly. 

Any suggestion? 

-- 
Joseph