Re: [O] [latex] Problems with old exporter (for Beamer) and with new exporter

2012-06-18 Thread Eric S Fraga
Sebastien Vauban wxhgmqzgw...@spammotel.com writes:

 Hello Nicolas,

 Nicolas Goaziou wrote:

[...]

 Note that even if it had one, it wouldn't work as expected since Beamer
 is not supported yet (but I'll probably implement a first draft for this
 back-end soon).

 I'll be glad to be your first Beamer tester -- as this is something I use a
 lot, even if I do use it in its simple form (no multicolumn parameters, and
 the like).

 Best regards,
   Seb

And I'd be happy to be one of your testers as well.  I use beamer *a
lot* and I use many of its features.

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.1.50.1 and Org release_7.8.11-69-ga2fd96




Re: [O] [latex] Problems with old exporter (for Beamer) and with new exporter

2012-06-15 Thread Nicolas Goaziou


Hello,

Sebastien Vauban
wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org writes:

 With the new exporter, most things work. What does not work:
 - macro does not get executed (no string in orange color),

 Macro are meant to produce contents, not to talk to back-ends. Every text
 they produce will be protected.

 Do you mean the template must be pure text?

Yes. Pure text or another macro.

 Do you mean that a thing such as
 http://frozenlock.org/2011/11/05/on-the-fly-key-sequence-insertion/ won't work
 anymore?

Not at the moment, but macros may change in the future. I'm unsure about
the best level to handle them, but it's probably too high at the moment.

On the other hand, I would like to avoid too much intersection with
inline Babel calls or src blocks.  For example, expansion could happen
before buffer is parsed, like in old exporter. But at the same time,
inline src blocks are executed, so I'm sure the macro could be replaced
with such a block.

I'm open to discussion about this.

 Though, now, when trying to export to LaTeX (with the new exporter and
 up-to-date Org[1]), I get an error:

This is because you're using beamer as your LaTeX class, which
probably doesn't have any association in `org-e-latex-classes'.

Note that even if it had one, it wouldn't work as expected since Beamer
is not supported yet (but I'll probably implement a first draft for this
back-end soon).


Regards,

-- 
Nicolas Goaziou




Re: [O] [latex] Problems with old exporter (for Beamer) and with new exporter

2012-06-15 Thread Sebastien Vauban
Hello Nicolas,

Nicolas Goaziou wrote:
 Sebastien Vauban
 wxhgmqzgw...@spammotel.com writes:

 With the new exporter, most things work. What does not work:
 - macro does not get executed (no string in orange color),

 Macro are meant to produce contents, not to talk to back-ends. Every text
 they produce will be protected.

 Do you mean the template must be pure text?

 Yes. Pure text or another macro.

 Do you mean that a thing such as
 http://frozenlock.org/2011/11/05/on-the-fly-key-sequence-insertion/ won't 
 work
 anymore?

 Not at the moment, but macros may change in the future. I'm unsure about
 the best level to handle them, but it's probably too high at the moment.

 On the other hand, I would like to avoid too much intersection with
 inline Babel calls or src blocks.  For example, expansion could happen
 before buffer is parsed, like in old exporter. But at the same time,
 inline src blocks are executed, so I'm sure the macro could be replaced
 with such a block.

 I'm open to discussion about this.

I think it makes a lot of sense to consider that macros can't be used in a
back-end specific way -- the first reason being that you have no way to tell
for which back-end they are written (unlike what we can do with
`org-add-link-type' where we can specify different back-end translations).

 Though, now, when trying to export to LaTeX (with the new exporter and
 up-to-date Org[1]), I get an error:

 This is because you're using beamer as your LaTeX class, which
 probably doesn't have any association in `org-e-latex-classes'.

OK. I thought I was working on a pure document. Sorry for the noise.

 Note that even if it had one, it wouldn't work as expected since Beamer
 is not supported yet (but I'll probably implement a first draft for this
 back-end soon).

I'll be glad to be your first Beamer tester -- as this is something I use a
lot, even if I do use it in its simple form (no multicolumn parameters, and
the like).

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] [latex] Problems with old exporter (for Beamer) and with new exporter

2012-06-14 Thread Sebastien Vauban
Hello Nicolas,

Nicolas Goaziou wrote:
 Sebastien Vauban writes:

 With the new exporter, most things work. What does not work:
 - macro does not get executed (no string in orange color),

 Macro are meant to produce contents, not to talk to back-ends. Every text
 they produce will be protected.

Do you mean the template must be pure text?

Do you mean that a thing such as
http://frozenlock.org/2011/11/05/on-the-fly-key-sequence-insertion/ won't work
anymore?

 - the =\end{verbatim}= disappears from the LaTeX output

 This is a limitation from LaTeX: you cannot have \end{verbatim} string
 within a verbatim environment.

OK, I thought it would be in a listings. But I did not customize the variable
`org-e-latex-listings' (well the old exporter one).

Though, now, when trying to export to LaTeX (with the new exporter and
up-to-date Org[1]), I get an error:

--8---cut here---start-8---
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match(^[  ]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ ]*\n? nil)
  (if (string-match ^[ ]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ ]*\n? 
tpl) (setq rpl (if (or (match-end 1) (not def-pkg))  
(org-latex-packages-to-string def-pkg snippets-p t)) tpl (replace-match rpl t t 
tpl)) (if def-pkg (setq end (org-latex-packages-to-string def-pkg snippets-p
  (let (rpl (end )) (if (string-match ^[ 
]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ ]*\n? tpl) (setq rpl (if (or 
(match-end 1) (not def-pkg))  (org-latex-packages-to-string def-pkg 
snippets-p t)) tpl (replace-match rpl t t tpl)) (if def-pkg (setq end 
(org-latex-packages-to-string def-pkg snippets-p (if (string-match 
\\[\\(NO-\\)?PACKAGES\\][ ]*\n? tpl) (setq rpl (if (or (match-end 1) (not 
pkg))  (org-latex-packages-to-string pkg snippets-p t)) tpl (replace-match 
rpl t t tpl)) (if pkg (setq end (concat end \n (org-latex-packages-to-string 
pkg snippets-p) (if (string-match \\[\\(NO-\\)?EXTRA\\][  ]*\n? tpl) 
(setq rpl (if (or (match-end 1) (not extra))  (concat extra \n)) tpl 
(replace-match rpl t t tpl)) (if (and extra (string-match \\S- extra)) (setq 
end (concat end \n extra (if (string-match \\S- end) (concat tpl \n 
end) tpl))
  org-splice-latex-header(nil (( fixltx2e nil) ( graphicx t) ( 
longtable nil) ( float nil) ( wrapfig nil) ( soul t) ( 
marvosym t) ( wasysym t) ( latexsym t) ( amssymb t) ( 
hyperref nil) \\tolerance=1000 ( listings) ( xcolor)) ((AUTO 
inputenc t) (T1 fontenc t) ( textcomp t)) nil 
\\lstdefinelanguage{org}{%\nmorekeywords={:results, :session, :var, :noweb, 
:exports},\nsensitive=false,\nmorestring=[b]\,\nmorecomment=[l]{\\#},\n}\n\\lstdefinelanguage{dot}{%\nmorekeywords={graph},\nsensitive=false,\n}\n\\lstset{%\nextendedchars=false,\ninputencoding=utf8x,\n%\nmathescape=false,\nescapechar=`,
 % allow escaping to (La)TeX mode within 
`..`\ncolumns=flexible,\nkeepspaces=true,\n%\nliterate=\n{á}{{\\'a}}1\n{à}{{\\`a}}1\n{â}{{\\^a}}1\n{ä}{{\\\a}}1\n{é}{{\\'e}}1\n{è}{{\\`e}}1\n{ê}{{\\^e}}1\n{ë}{{\\\e}}1\n{í}{{\\'i}}1\n{ì}{{\\`i}}1\n{î}{{\\^i}}1\n{ï}{{\\\i}}1\n{ó}{{\\'o}}1\n{ò}{{\\`o}}1\n{ô}{{\\^o}}1\n{ö}{{\\\o}}1\n{ú}{{\\'u}}1\n{ù}{{\\`u}}1\n{û}{{\\^u}}1\n{ü}{{\\\u}}1\n})
  (org-e-latex--guess-inputenc (org-splice-latex-header document-class-string 
org-export-latex-default-packages-alist org-export-latex-packages-alist nil 
(plist-get info :latex-header-extra)))
  (let* ((header (nth 1 (assoc class org-e-latex-classes))) 
(document-class-string (and (stringp header) (if class-options 
(replace-regexp-in-string ^[]*documentclass\\(\\[.*?\\]\\) 
class-options header t nil 1) header (org-e-latex--guess-inputenc 
(org-splice-latex-header document-class-string 
org-export-latex-default-packages-alist org-export-latex-packages-alist nil 
(plist-get info :latex-header-extra
  (org-element-normalize-string (let* ((header (nth 1 (assoc class 
org-e-latex-classes))) (document-class-string (and (stringp header) (if 
class-options (replace-regexp-in-string ^[  
]*documentclass\\(\\[.*?\\]\\) class-options header t nil 1) header 
(org-e-latex--guess-inputenc (org-splice-latex-header document-class-string 
org-export-latex-default-packages-alist org-export-latex-packages-alist nil 
(plist-get info :latex-header-extra)
  (let ((class (plist-get info :latex-class)) (class-options (plist-get info 
:latex-class-options))) (org-element-normalize-string (let* ((header (nth 1 
(assoc class org-e-latex-classes))) (document-class-string (and (stringp 
header) (if class-options (replace-regexp-in-string ^[   
]*documentclass\\(\\[.*?\\]\\) class-options header t nil 1) header 
(org-e-latex--guess-inputenc (org-splice-latex-header document-class-string 
org-export-latex-default-packages-alist org-export-latex-packages-alist nil 
(plist-get info :latex-header-extra))
  (concat (and (plist-get info :time-stamp-file) (format-time-string %% 
Created %Y-%m-%d %a %H:%M\n)) (let ((class (plist-get info 

Re: [O] [latex] Problems with old exporter (for Beamer) and with new exporter

2012-06-09 Thread Nicolas Goaziou


Hello,

Sebastien Vauban
wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org writes:

 With the new exporter, most things work. What does not work:
 - macro does not get executed (no string in orange color),

Macro are meant to produce contents, not to talk to back-ends. Every
text they produce will be protected.

 - the =\end{verbatim}= disappears from the LaTeX output

This is a limitation from LaTeX: you cannot have \end{verbatim} string
within a verbatim environment.


Regards,

-- 
Nicolas Goaziou




[O] [latex] Problems with old exporter (for Beamer) and with new exporter

2012-06-07 Thread Sebastien Vauban
Hello,

I want to write a document where I show:

- Org code to type in a buffer
- (sometimes) its LaTeX translation
- its effect in the output PDF

Though, I have big troubles outputting the Org code one is suppose to write in
the Org buffers. It often gets replaced or modified... See examples in the
following ECM.

With the old exporter (necessary for Beamer), all the below cases fail...

With the new exporter, most things work. What does not work:
- macro does not get executed (no string in orange color),
- the =\end{verbatim}= disappears from the LaTeX output

--8---cut here---start-8---
#+TITLE: Org mode examples
#+OPTIONS:   H:3 num:t toc:nil

#+LaTeX_HEADER: \lstdefinelanguage{org}{%
#+LaTeX_HEADER:   morekeywords={:results, :session, :var, :noweb, :exports},
#+LaTeX_HEADER:   sensitive=false,
#+LaTeX_HEADER:   morestring=[b],
#+LaTeX_HEADER:   morecomment=[l]{\#},
#+LaTeX_HEADER: }

#+LaTeX_HEADER: \lstset{%
#+LaTeX_HEADER:   extendedchars=false,
#+LaTeX_HEADER:   inputencoding=utf8x,
#+LaTeX_HEADER:   %
#+LaTeX_HEADER:   mathescape=false,
#+LaTeX_HEADER:   escapechar=`, % allow escaping to (La)TeX mode within `..`
#+LaTeX_HEADER:   columns=flexible,
#+LaTeX_HEADER:   keepspaces=true
#+LaTeX_HEADER: }

#+MACRO: key \textcolor{orange}{\texttt{$1}}

#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation,t]
#+BEAMER_HEADER_EXTRA: \usetheme{Madrid}\usecolortheme{default}
#+BEAMER_FRAME_LEVEL: 1

* Macros

- With the following macro definition

  #+begin_src org :exports code
  ,#+MACRO: key \textcolor{orange}{\texttt{$1}}
  #+end_src

- Every time we write

  #+begin_src org :exports code
  ,{{{key(C-c C-e)}}}
  #+end_src

  HERE ABOVE, WE SHOULD SEE THE MACRO NAME AND PARAMETER INSIDE CURLY
  BRACKETS. INSTEAD, WE SEE THE LATEX REPLACEMENT CODE.

- We get {{{key(C-c C-e)}}}

* Listings informatiques

- To input a block of code in Org, type it like this:

#+begin_src org :exports code
,#+begin_src sql
,SELECT *
,FROM inventory
,WHERE product = 'ABC123'
,#+end_src
#+end_src

  HERE, WE SHOULD SEE =#+begin_src sql=. INSTEAD, WE SEE =\begin{}sql=.

- And see the nice listing:

#+begin_src sql
SELECT *
FROM inventory
WHERE product = 'ABC123'
#+end_src

* Verbatim

- Same problem for verbatim... Here, the Org code

#+begin_src org :exports code
,#+begin_verbatim
,verbatim  d i s p l a y s  with spaces!
,#+end_verbatim
#+end_src

  HERE, THE META LINE IS CONVERTED INTO ITS LATEX FORM.

- And its translation into LaTeX:

#+begin_src latex :exports code
\begin{verbatim}
verbatim  d i s p l a y s  with spaces!
\end{verbatim}
#+end_src

* Comment

It is also impossible to show how to type a comment block:

#+begin_src org :exports code
#+begin_comment
Paragraph which will not appear in resulting PDF.
#+end_comment
#+end_src

THE ABOVE NEVER IS SHOWN!
--8---cut here---end---8---

Best regards,
  Seb

-- 
Sebastien Vauban