Re: [O] LaTeX export -- Table with align option

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

 Hello,

 I want to customize a bit the layout of a table, using the =align= parameter 
 as
 explained on http://orgmode.org/manual/Tables-in-LaTeX-export.html.

 That works well for the first two common usages (see ECM) but not with
 @-expressions (see, for example, on

Actually, it's not the @ expressions as such that cause the problems,
it's the spaces you are trying to introduce within them, causing the org
parser to terminate the alignment term too soon.  Two solutions below.

[...]

 #+ATTR_LaTeX: align=r@{ : }r@{ }l

[...]

 gets INCORRECTLY translated to:

 #+begin_src latex
 \begin{tabular}{r@{}

[...]


I know this isn't pretty but you could use

  #+ATTR_LaTeX: align=r@{\hspace{1em}:\hspace{1em}}r@{\hspace{1em}}l

changing the 1em to whatever amount of space you actually want; probably
1ex is more likely...

The following also works but although it looks simpler here (in an
email), I don't like how Org hides the ~s in the first column
specification as it (incorrectly) interprets them as a verbatim style.

  #+ATTR_LaTeX: align=r@{~:~}r@{~}l

HTH,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org release_7.8.11-14-g4b0121




Re: [O] LaTeX export -- Table with align option

2012-06-05 Thread Sebastien Vauban
Hi Eric,

Eric Fraga wrote:
 Sebastien Vauban wxhgmqzgw...@spammotel.com writes:
 I want to customize a bit the layout of a table, using the =align= parameter 
 as
 explained on http://orgmode.org/manual/Tables-in-LaTeX-export.html.

 That works well for the first two common usages (see ECM) but not with
 @-expressions (see, for example, on

 Actually, it's not the @ expressions as such that cause the problems,
 it's the spaces you are trying to introduce within them, causing the org
 parser to terminate the alignment term too soon.  Two solutions below.

 #+ATTR_LaTeX: align=r@{ : }r@{ }l
 gets INCORRECTLY translated to:

 #+begin_src latex
 \begin{tabular}{r@{}

 I know this isn't pretty but you could use

   #+ATTR_LaTeX: align=r@{\hspace{1em}:\hspace{1em}}r@{\hspace{1em}}l

 changing the 1em to whatever amount of space you actually want; probably
 1ex is more likely...

 The following also works but although it looks simpler here (in an
 email), I don't like how Org hides the ~s in the first column
 specification as it (incorrectly) interprets them as a verbatim style.

   #+ATTR_LaTeX: align=r@{~:~}r@{~}l

I had tried backslashing the space, but that did not help. Your examples do
help working around the problem.

Thanks!

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] LaTeX export for numbered equations

2012-06-04 Thread Nick Dokos
Sebastien Vauban wxhgmqzgw...@spammotel.com wrote:

 Hello,
 
 I'm trying to get numbered equations in Beamer, hence using the begin_equation
 block, but the formula is not correctly translated to LaTeX, and I have no
 clue why...
 
 Here an ECM:
 ... 
 - These should be numbered:
 
 #+begin_equation
 \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
 #+end_equation
 
 #+begin_equation
 \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}
 #+end_equation
 ... 

The following workaround seems to be effective in both of these cases:

#+begin_equation
#+LATEX:  \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
#+end_equation

Nick




Re: [O] LaTeX export for numbered equations

2012-06-04 Thread Nick Dokos
Sebastien Vauban wxhgmqzgw...@spammotel.com wrote:

 Hello,
 
 I'm trying to get numbered equations in Beamer, hence using the begin_equation
 block, but the formula is not correctly translated to LaTeX, and I have no
 clue why...
 


Confirmed (except that I have to comment out hyperref in order to
process the latex file - I get fatal errors otherwise), plus the new
exporter chokes on the same example with the appended backtrace.

Nick

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 ((AUTO inputenc t) (T1 fontenc t) ( 
fixltx2e nil) ( graphicx t) ( longtable nil) ( float nil) ( 
wrapfig nil) ( soul t) ( textcomp t) ( marvosym t) ( wasysym 
t) ( latexsym t) ( amssymb t) (pdfborder={0,0,0},colorlinks=true 
hyperref nil) \\tolerance=1000) (( minted t)) nil nil)
  (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 :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 ... 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)) 
\\providecommand{\\alert}[1]{\\textbf{#1}}\n (let ((sec-num (plist-get info 
:section-numbers))) (when (integerp sec-num) (format 
\\setcounter{secnumdepth}{%d}\n sec-num))) (let ((author (and (plist-get info 
:with-author) (let ((auth ...)) (and auth (org-export-data auth info) 
(email (and (plist-get info :with-email) (org-export-data (plist-get info 
:email) info (cond ((and author email (not (string=  email))) 
 (format \\author{%s\\thanks{%s}}\n author email)) (author (format 
\\author{%s}\n author)) (t \\author{}\n))) (let ((date (plist-get info 
:date))) (and date (format \\date{%s}\n date))) (format \\title{%s}\n 
title) (format \\hypersetup{\n  pdfkeywords={%s},\n  pdfsubject={%s},\n  

Re: [O] LaTeX export for numbered equations

2012-06-04 Thread Sebastien Vauban
Hi Nick,

Nick Dokos wrote:
 Sebastien Vauban wxhgmqzgw...@spammotel.com wrote:
 
 I'm trying to get numbered equations in Beamer, hence using the
 begin_equation block, but the formula is not correctly translated to LaTeX,
 and I have no clue why...

 Confirmed (except that I have to comment out hyperref in order to process
 the latex file - I get fatal errors otherwise),

Weird. I do use hyperref...

 plus the new exporter chokes on the same example with the appended
 backtrace.

Regarding the new exporter (which I can't test -- I have problems when
activating it, still have to look why with emacs -Q and dichotomic search...),
IIRC Beamer is not supported (yet?).

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] LaTeX export for numbered equations

2012-06-04 Thread Sebastien Vauban
Hi Nick,

Nick Dokos wrote:
 Sebastien Vauban wxhgmqzgw...@spammotel.com wrote:

 I'm trying to get numbered equations in Beamer, hence using the 
 begin_equation
 block, but the formula is not correctly translated to LaTeX, and I have no
 clue why...
 
 Here an ECM:
 ... 
 - These should be numbered:
 
 #+begin_equation
 \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
 #+end_equation
 
 #+begin_equation
 \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}
 #+end_equation
 ... 

 The following workaround seems to be effective in both of these cases:

 #+begin_equation
 #+LATEX:  \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
 #+end_equation

I confirm your workaround is working in my case as well -- I would never have
thought doing that. Thanks!

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] LaTeX export for numbered equations

2012-06-04 Thread suvayu ali
Hey Seb,

On Mon, Jun 4, 2012 at 9:41 AM, Sebastien Vauban
wxhgmqzgw...@spammotel.com wrote:
 Hi Nick,

 Nick Dokos wrote:
 Sebastien Vauban wxhgmqzgw...@spammotel.com wrote:

 I'm trying to get numbered equations in Beamer, hence using the 
 begin_equation
 block, but the formula is not correctly translated to LaTeX, and I have no
 clue why...

 Here an ECM:
 ...
 - These should be numbered:

 #+begin_equation
 \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
 #+end_equation

 #+begin_equation
 \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}
 #+end_equation
 ...

 The following workaround seems to be effective in both of these cases:

 #+begin_equation
 #+LATEX:  \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
 #+end_equation

 I confirm your workaround is working in my case as well -- I would never have
 thought doing that. Thanks!


I know it should work, but is there any particular reason you need to
use #+begin_equation .. #+end_equation ? The following seems to work for
me well.

  #+begin_latex
\begin{equation}
  \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
\end{equation}
  #+end_latex

If you want fontlocking you can even use

  #+begin_src latex :eval yes
\begin{equation}
  \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
\end{equation}
  #+end_src

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] LaTeX export for numbered equations

2012-06-04 Thread Carsten Dominik

On 4.6.2012, at 08:14, Nick Dokos wrote:

 Sebastien Vauban wxhgmqzgw...@spammotel.com wrote:
 
 Hello,
 
 I'm trying to get numbered equations in Beamer, hence using the 
 begin_equation
 block, but the formula is not correctly translated to LaTeX, and I have no
 clue why...
 
 Here an ECM:
 ... 
 - These should be numbered:
 
 #+begin_equation
 \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
 #+end_equation
 
 #+begin_equation
 \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}
 #+end_equation
 ... 
 
 The following workaround seems to be effective in both of these cases:
 
 #+begin_equation
 #+LATEX:  \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
 #+end_equation

You just use

   \begin{equation}
   \frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
   \end{equation}

Entire LaTeX environments should be automatically
protected and passed through for LaTeX export.

- Carsten




 
 Nick
 
 




[O] LaTeX export -- Table with align option

2012-06-04 Thread Sebastien Vauban
Hello,

I want to customize a bit the layout of a table, using the =align= parameter as
explained on http://orgmode.org/manual/Tables-in-LaTeX-export.html.

That works well for the first two common usages (see ECM) but not with
@-expressions (see, for example, on
https://en.wikibooks.org/wiki/LaTeX/Tables#.40-expressions)

* Table with normal spacing

#+ATTR_LaTeX: align=rrl
| Janvier | 1300 | \EUR |
| Février | 1280 | \EUR |
|-+--+--|
| Total   | 2580 | \EUR |
#+TBLFM: @3$2=vsum(@1..@2)

gets correctly translated to:

#+begin_src latex
\begin{tabular}{rrl}
 Janvier1300\EUR  \\
 Février1280\EUR  \\
\hline
 Total  4080\EUR  \\
\end{tabular}
#+end_src

* Table with no spacing

#+ATTR_LaTeX: align=r@{:}r@{}l
| Janvier | 1300 | \EUR |
| Février | 1280 | \EUR |
|-+--+--|
| Total   | 2580 | \EUR |
#+TBLFM: @3$2=vsum(@1..@2)

gets correctly translated to:

#+begin_src latex
\begin{tabular}{r@{:}r@{}l}
 Janvier1300\EUR  \\
 Février1280\EUR  \\
\hline
 Total  4080\EUR  \\
\end{tabular}
#+end_src

* Table with more spacing

#+ATTR_LaTeX: align=r@{ : }r@{ }l
| Janvier | 1300 | \EUR |
| Février | 1280 | \EUR |
|-+--+--|
| Total   | 2580 | \EUR |
#+TBLFM: @3$2=vsum(@1..@2)

gets INCORRECTLY translated to:

#+begin_src latex
\begin{tabular}{r@{}
 Janvier1300\EUR  \\
 Février1280\EUR  \\
\hline
 Total  4080\EUR  \\
\end{tabular}
#+end_src

which can't be compiled...

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] LaTeX export for numbered equations

2012-06-04 Thread Bastien


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

 Regarding the new exporter (which I can't test -- I have problems when
 activating it, still have to look why with emacs -Q and dichotomic search...),
 IIRC Beamer is not supported (yet?).

Yes, it is not.

-- 
 Bastien




[O] LaTeX export for numbered equations

2012-06-03 Thread Sebastien Vauban
Hello,

I'm trying to get numbered equations in Beamer, hence using the begin_equation
block, but the formula is not correctly translated to LaTeX, and I have no
clue why...

Here an ECM:

--8---cut here---start-8---
#+TITLE: ECM Equations
#+DATE:  2012-06-13
#+Time-stamp: 2012-06-03 Sun 23:13 Fabrice on MEDIACENTER

#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation,t]
#+BEAMER_HEADER_EXTRA: \usetheme{default}\usecolortheme{default}
#+BEAMER_FRAME_LEVEL: 1
#+COLUMNS: %40ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) 
%4BEAMER_col(Col) %8BEAMER_extra(Extra)

* Equations

- This is a displayed formula, not numbered:
  \[\frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }\]

- These should be numbered:

#+begin_equation
\frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }
#+end_equation

#+begin_equation
\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}
#+end_equation

* LaTeX output

- The first equation, unnumbered, is correctly translated to:

\[\frac{1}{\sqrt{2\pi\sigma^2}}e^{ -\frac{(x-\mu)^2}{2\sigma^2} }\]

- The two other are wrongly translated:

  + the first one with two curly brackets escaped:
   v   v
\begin{equation}
\frac{1}{\sqrt{2\pi\sigma^2}}e^\{ -\frac{(x-\mu)^2}{2\sigma^2} \}
\end{equation}

  + the last one with one curly bracket escaped:
   v
\begin{equation}
\frac{1}{\sqrt{2\pi\sigma^2}}e^\{-\frac{(x-\mu)^2}{2\sigma^2}}
\end{equation}
--8---cut here---end---8---

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Latex export : newlines in footnotes.

2012-05-29 Thread Jonathan BISSON
Jonathan BISSON bissonjonathan at gmail.com writes:

 
 Hello,
 
 When I try to export my org file using latest git (1 month ago version
 got this problem too) to a tex file, I have problems with footnotes.
 
 * Orgfile
 
 Hello [fn:foo: bar]
 
 - Latex Output
 
 Hello \footnote{bar
 }
 
 So I got a newline after bar, which causes big troubles in tables as the
 latex exporter puts the closing } at the end of the table, not a the end
 of the current cell.
 
 Any clue on how to get rid of this new line, and get the closing element
 at the right place ?
 
 Thanks !
 
 

In function org-export-latex-preprocess (file org-latex.el) 

I relace the (setq def …) on the beginning of the function by :
  (setq def
(concat (replace-regexp-in-string \n  def)
(if (string-match ORG-LIST-END-MARKER\\' def)
\n  )))

And now the footnotes are exported correctly.

I can't find where in org-export-footnotes-seen the things are added with a \n
inside. If anyone can take a look at this.


Thanks,

J.





[O] Latex export : newlines in footnotes.

2012-05-28 Thread Jonathan BISSON
Hello,

When I try to export my org file using latest git (1 month ago version
got this problem too) to a tex file, I have problems with footnotes.


* Orgfile

Hello [fn:foo: bar]




- Latex Output

Hello \footnote{bar
}



So I got a newline after bar, which causes big troubles in tables as the
latex exporter puts the closing } at the end of the table, not a the end
of the current cell.



Any clue on how to get rid of this new line, and get the closing element
at the right place ?



Thanks !




signature.asc
Description: OpenPGP digital signature


Re: [O] LaTeX-export to ACM SIG Proceedings format

2012-04-25 Thread Mike McLean
On Wednesday, April 25, 2012, Achim Gratz wrote:


 Here's my chance to upsell the new build system to you: to use code from
 contrib, just link or copy it into lisp, then do whatever you let make
 normally do.  You usually don't need any extra requires since the
 autoload cookies do their magic.  If it turns out you don't want or need
 that code from contrib, simply remove the files from lisp and re-make.


So if I do not copy/move/link code from contrib/lisp/ to lisp/ I could
still be using old contrib code from my Emacs system directories?


Re: [O] LaTeX-export to ACM SIG Proceedings format

2012-04-25 Thread Achim Gratz
Mike McLean writes:
 So if I do not copy/move/link code from contrib/lisp/ to lisp/ I could
 still be using old contrib code from my Emacs system directories?

There is no contrib code in Emacs unless you yourself installed it
there.  The advantage of copying to lisp is that you don't need to add
contrib to the load-path and mostly don't need any further setup beyond
(require 'org-install).  Also, the new files in lisp will be compiled
and installed just like anything else in lisp without further
configuration.  The latter of course means that you have to do a make
cleaninstall if you later decide you don't want to have them installed
anymore.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] LaTeX-export to ACM SIG Proceedings format

2012-04-25 Thread Mike McLean
On Wednesday, April 25, 2012, Achim Gratz wrote:

 Mike McLean writes:
  So if I do not copy/move/link code from contrib/lisp/ to lisp/ I could
  still be using old contrib code from my Emacs system directories?

 There is no contrib code in Emacs unless you yourself installed it
 there.  The advantage of copying to lisp is that you don't need to add
 contrib to the load-path and mostly don't need any further setup beyond
 (require 'org-install).


Sorry for the noise, I completely forgot that I added two directories (lisp
and contrib/lisp) to my load path. If I had thought a few more seconds
before replying, I would not have :(


[O] LaTeX-export to ACM SIG Proceedings format

2012-04-24 Thread Karl Voit
Hi!

For a short demo at a conference I tried to configure Org-mode LaTeX
export to generate a tex file which complies to the ACM SIG
Proceedings format[1].

The tutorial on [2] is great but unfortunately, I could not achieve
several things :-(

Maybe it might be a cool idea to work on this template together and
publish it on Worg? I can imagine that several people are trying to
meet those ACM template requirements ...


If not, I can summarize each problem I faced one by one if you are
interested: overruling \author{}, modifying \maketitle,
abstract-environment not working, bibtex not working, «#+name:
setup»-settings not working, ... and I did not even get started
working on the content :-)

  1. http://www.acm.org/sigs/publications/proceedings-templates
  2. http://orgmode.org/worg/org-tutorials/org-latex-export.html
-- 
Karl Voit




Re: [O] LaTeX-export to ACM SIG Proceedings format

2012-04-24 Thread Thomas S. Dye
Karl Voit devn...@karl-voit.at writes:

 Hi!

 For a short demo at a conference I tried to configure Org-mode LaTeX
 export to generate a tex file which complies to the ACM SIG
 Proceedings format[1].

 The tutorial on [2] is great but unfortunately, I could not achieve
 several things :-(

 Maybe it might be a cool idea to work on this template together and
 publish it on Worg? I can imagine that several people are trying to
 meet those ACM template requirements ...

This seems like a good idea.  Would it be possible to target Nicolas
Goaziou's experimental LaTeX exporter, instead of the old exporter?



 If not, I can summarize each problem I faced one by one if you are
 interested: overruling \author{}, modifying \maketitle,
 abstract-environment not working, bibtex not working, «#+name:
 setup»-settings not working, ... and I did not even get started
 working on the content :-)

   1. http://www.acm.org/sigs/publications/proceedings-templates
   2. http://orgmode.org/worg/org-tutorials/org-latex-export.html

Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] LaTeX-export to ACM SIG Proceedings format

2012-04-24 Thread Karl Voit
* Thomas S. Dye t...@tsdye.com wrote:
 Karl Voit devn...@karl-voit.at writes:

 Maybe it might be a cool idea to work on this template together and
 publish it on Worg? I can imagine that several people are trying to
 meet those ACM template requirements ...

 This seems like a good idea.  Would it be possible to target Nicolas
 Goaziou's experimental LaTeX exporter, instead of the old exporter?

Since I was using the PDF/LaTeX export just to make quick and dirty
files to send other people or pretty print, I was not aware that
there is another LaTeX exporter.

What would be the consequence of choosing the new one?

-- 
Karl Voit




Re: [O] LaTeX-export to ACM SIG Proceedings format

2012-04-24 Thread Jambunathan K
Karl Voit devn...@karl-voit.at writes:

 * Thomas S. Dye t...@tsdye.com wrote:
 Karl Voit devn...@karl-voit.at writes:

 Maybe it might be a cool idea to work on this template together and
 publish it on Worg? I can imagine that several people are trying to
 meet those ACM template requirements ...

 This seems like a good idea.  Would it be possible to target Nicolas
 Goaziou's experimental LaTeX exporter, instead of the old exporter?

 Since I was using the PDF/LaTeX export just to make quick and dirty
 files to send other people or pretty print, I was not aware that
 there is another LaTeX exporter.

 What would be the consequence of choosing the new one?

This should be obvious.  It will make it better.
-- 



Re: [O] LaTeX-export to ACM SIG Proceedings format

2012-04-24 Thread Thomas S. Dye
Jambunathan K kjambunat...@gmail.com writes:

 Karl Voit devn...@karl-voit.at writes:

 * Thomas S. Dye t...@tsdye.com wrote:
 Karl Voit devn...@karl-voit.at writes:

 Maybe it might be a cool idea to work on this template together and
 publish it on Worg? I can imagine that several people are trying to
 meet those ACM template requirements ...

 This seems like a good idea.  Would it be possible to target Nicolas
 Goaziou's experimental LaTeX exporter, instead of the old exporter?

 Since I was using the PDF/LaTeX export just to make quick and dirty
 files to send other people or pretty print, I was not aware that
 there is another LaTeX exporter.

 What would be the consequence of choosing the new one?

 This should be obvious.  It will make it better.

One of the ideas behind the new exporter is that Org-mode source
prepared for one target can be easily exported to other targets.  I'm
keen to learn how to use it for the possibility of also exporting to a
target such as ODT that converts easily to Word, which I think all of my
clients use.  My brief experience with the LaTeX exporter so far has
been very positive and I'm relatively certain that it will be the
default export engine in the not too distant future.  If the ACM
template is written for the new exporter, then its use life will likely
be enhanced.

Also, I agree with Jambunathan's comment that exercising the new
exporter on a practical project might possibly indicate how it could be
made better.

On a practical note, using the new exporter is easy.  I have these
two lines (along with other configuration) in an Org-babel code block
that I use to setup Org-mode:

(require 'org-export)
(require 'org-e-latex)

Then, I can access the dispatcher with M-x org-export-dispatch and
choose the target.  It feels easy and natural from the get go.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Latex export postamble

2012-04-14 Thread Pedro Silva
Pedro Silva psilva+...@pedrosilva.pt writes:

 Is it possible to insert text just before \end{document} on export,
 similarly to org-export-html-postamble?

 I'd like to do this on a capture target file that contains the following
 at the end:

   \bibliography{references}

 New capture entries keep getting inserted below it, which makes the
 references section appear in the middle of the document if I forget to
 move it to the end again.

 Or maybe there is another way to make this work?

Looking at the relevant code in contrib/org-exp-bibtex.el, I managed to
produce the following, which *almost* works:

(defun org-export-bibliography-preprocess ()
Insert \bibliography and \bibliographystyle commands at end
of buffer if keyword `#+BIBLIOGRAPHY file style' is present in
buffer when exporting via latex backend.
(interactive)
(save-excursion
(goto-char (point-min))
(while (re-search-forward ^#\\+BIBLIOGRAPHY:[ \t]+\\(\\S-+\\)[ 
\t]+\\(\\S-+\\)\\([^\r\n]*\\) nil t)
(let ((file  (match-string 1))
  (style (match-string 2)))  
(when (eq org-export-current-backend 'latex)
(goto-char (point-max))
(insert
 (concat \n#+LATEX: \\bibliographystyle{ style }
 \n#+LATEX: \\bibliography{ file }\n)))

(add-hook 'org-export-preprocess-hook 'org-export-bibliography-preprocess)

Unfortunately, it inserts the latex directives twice, one near the top
of the buffer, and the other one at its end, as expected.  Any ideas why
that is?

Pedro
-- 
Any government will work if authority and responsibility are equal and
coordinate. This does not insure good government; it simply insures
that it will work. But such governments are rare--most people want to
run things but want no part of the blame. This used to be called the
backseat-driver syndrome.
-- Lazarus Long



[O] Latex export postamble

2012-04-13 Thread Pedro Silva
Is it possible to insert text just before \end{document} on export,
similarly to org-export-html-postamble?

I'd like to do this on a capture target file that contains the following
at the end:

\bibliography{references}

New capture entries keep getting inserted below it, which makes the
references section appear in the middle of the document if I forget to
move it to the end again.

Or maybe there is another way to make this work?

Pedro
-- 
Don't try to have the last word. You might get it.
-- Lazarus Long



[O] LaTeX export should honor CUSTOM_ID property

2012-03-28 Thread Truong Nghiem
I'm using orgmode version 7.8.06.  Right now, whenever an org file is
exported to LaTeX, each heading is assigned an automatic label (e.g.
sec-1).  All hyperlinks to the heading will also use this label.
There is a standard orgmode property for assigning custom ID to
headings for hyperlinks: CUSTOM_ID.  Exporting a heading with
CUSTOM_ID produces two labels, one automatic label by the LaTeX
exporter and one by CUSTOM_ID.  However all hyperlinks to the heading
use the automatic label.  For example, the following org code:

 BEGIN =
* Section 1
  :PROPERTIES:
  :CUSTOM_ID: sec:section-1
  :END:

This is section 1.

* Section 2
Refer [[Section 1]].
 END ===

produces LaTeX code:

 BEGIN =
\section{Section 1}
\label{sec-1}
\label{sec:section-1}


This is section 1.
\section{Section 2}
\label{sec-2}

Refer \hyperref[sec-1]{Section 1}.
 END ===

Although this is not a bug, I think the LaTeX exporter should honor
the CUSTOM_ID property, and only assign an automatic label in the
absent of this property.  The above LaTeX should read:

 BEGIN =
\section{Section 1}
\label{sec:section-1}


This is section 1.
\section{Section 2}
\label{sec-2}

Refer \hyperref[sec:section-1]{Section 1}.
 END ===


If the hyperlink is changed to using the CUSTOM_ID instead of the
heading text, it produces wrong LaTeX code:
\hyperref[sec-section-1]{\#sec:section-1}.  This is definitely a bug.
--
Truong Nghiem



Re: [O] LaTeX export - can't skip a heading level

2012-03-21 Thread Achim Gratz
Nick Dokos nicholas.do...@hp.com writes:
 
 Especially as this is a limitation of LaTeX, not the exporter.
 
 :-)

 Not true - the following compiles with no problems:

Yes, LaTeX doesn't really enforce it, but it makes the assumption of
correct nesting.  It's been a few years since I tried something like
you've posted, but I've quickly learned that funny things happen when
your document grows to a more realistic size (it had to do with how the
counters are interacting).  So I've stopped doing it and have never
looked back.  If you must, you can provide your own sectioning commands
in LaTeX that handle this situation more gracefully, but that's really a
bit much to ask of an org exporter, don't you think?


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] LaTeX export - can't skip a heading level

2012-03-21 Thread Nick Dokos
Achim Gratz strom...@nexgo.de wrote:

 Nick Dokos nicholas.do...@hp.com writes:
  
  Especially as this is a limitation of LaTeX, not the exporter.
  
  :-)
 
  Not true - the following compiles with no problems:
 
 Yes, LaTeX doesn't really enforce it, but it makes the assumption of
 correct nesting.  It's been a few years since I tried something like
 you've posted, but I've quickly learned that funny things happen when
 your document grows to a more realistic size (it had to do with how the
 counters are interacting).  So I've stopped doing it and have never
 looked back.  If you must, you can provide your own sectioning commands
 in LaTeX that handle this situation more gracefully, but that's really a
 bit much to ask of an org exporter, don't you think?
 

Certainly - I did not argue that the exporter should do this. I just
pointed out its limitation and that the limitation would be tough to
lift.

Nick



[O] LaTeX export - can't skip a heading level

2012-03-20 Thread Richard Stanton
Using org-mode 7.8.03, I've found that exporting to LaTeX has a tough time
if you try to skip a header level. For example, to prevent my TODO items
being numbered, one method is to make them a lower-level heading, and then
make that level un-numbered.

However, if I try the following:

* To Do List
*** TODO First item
*** TODO Second item

Then when exported to LaTeX, only the title appears (both TODO items are
excluded).

I tried make the first title one level lower, like this:

** To Do List
*** TODO First item
*** TODO Second item

* Next Section

Now the TODO list exports, though it now treats ** as the section header,
so it hasn't solved that problem, and moreover, the next section is
omitted entirely.










Re: [O] LaTeX export - can't skip a heading level

2012-03-20 Thread Nick Dokos
Richard Stanton stan...@haas.berkeley.edu wrote:

 Using org-mode 7.8.03, I've found that exporting to LaTeX has a tough time
 if you try to skip a header level. For example, to prevent my TODO items
 being numbered, one method is to make them a lower-level heading, and then
 make that level un-numbered.
 
 However, if I try the following:
 
 * To Do List
 *** TODO First item
 *** TODO Second item
 

Does this do what you want?

--8---cut here---start-8---

#+OPTIONS: num:1

* To Do List
** TODO First item
** TODO Second item
--8---cut here---end---8---

Nick

PS. Not sure why the third level headlines are skipped if the second level
headline is absent. This feels like a bug to me.

 Then when exported to LaTeX, only the title appears (both TODO items are
 excluded).
 
 I tried make the first title one level lower, like this:
 
 ** To Do List
 *** TODO First item
 *** TODO Second item
 
 * Next Section
 
 Now the TODO list exports, though it now treats ** as the section header,
 so it hasn't solved that problem, and moreover, the next section is
 omitted entirely.
 
 
 
 
 
 
 
 



Re: [O] LaTeX export - can't skip a heading level

2012-03-20 Thread Richard Stanton
 From: nicholas.do...@hp.com [mailto:nicholas.do...@hp.com]
 Sent: Tuesday, March 20, 2012 12:55 PM
 To: Richard Stanton
 Cc: emacs-orgmode@gnu.org; nicholas.do...@hp.com
 Subject: Re: [O] LaTeX export - can't skip a heading level
 
 Richard Stanton stan...@haas.berkeley.edu wrote:
 
  Using org-mode 7.8.03, I've found that exporting to LaTeX has a tough
  time if you try to skip a header level. For example, to prevent my
  TODO items being numbered, one method is to make them a lower-level
  heading, and then make that level un-numbered.
 
  However, if I try the following:
 
  * To Do List
  *** TODO First item
  *** TODO Second item
 
 
 Does this do what you want?
 
 --8---cut here---start-8---
 
 #+OPTIONS: num:1
 
 * To Do List
 ** TODO First item
 ** TODO Second item
 --8---cut here---end---8---

Not quite, I don't think, as it removes numbers from *all* second level headers.



Re: [O] LaTeX export - can't skip a heading level

2012-03-20 Thread Nick Dokos
Nick Dokos nicholas.do...@hp.com wrote:

 Richard Stanton stan...@haas.berkeley.edu wrote:
 
  Using org-mode 7.8.03, I've found that exporting to LaTeX has a tough time
  if you try to skip a header level. For example, to prevent my TODO items
  being numbered, one method is to make them a lower-level heading, and then
  make that level un-numbered.
  
  However, if I try the following:
  
  * To Do List
  *** TODO First item
  *** TODO Second item
  
 
  Then when exported to LaTeX, only the title appears (both TODO items are
  excluded).
  
 PS. Not sure why the third level headlines are skipped if the second level
 headline is absent. This feels like a bug to me.
 

The latex exporter is very rigid about what it will accept: it wants the
levels to be in strict sequence. So this has to be chalked down as a
fairly deeply ingrained limitation of the exporter. I don't see an easy way
to lift it.

Nick



Re: [O] LaTeX export - can't skip a heading level

2012-03-20 Thread Achim Gratz
Nick Dokos nicholas.do...@hp.com writes:
 The latex exporter is very rigid about what it will accept: it wants the
 levels to be in strict sequence. So this has to be chalked down as a
 fairly deeply ingrained limitation of the exporter. I don't see an easy way
 to lift it.

Especially as this is a limitation of LaTeX, not the exporter.

:-)


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

DIY Stuff:
http://Synth.Stromeko.net/DIY.html




Re: [O] LaTeX export - can't skip a heading level

2012-03-20 Thread Nick Dokos
Achim Gratz strom...@nexgo.de wrote:

 Nick Dokos nicholas.do...@hp.com writes:
  The latex exporter is very rigid about what it will accept: it wants the
  levels to be in strict sequence. So this has to be chalked down as a
  fairly deeply ingrained limitation of the exporter. I don't see an easy way
  to lift it.
 
 Especially as this is a limitation of LaTeX, not the exporter.
 
 :-)
 
 

Not true - the following compiles with no problems:

--8---cut here---start-8---
...
\begin{document}

\maketitle

\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}

\section{foo}
\label{sec-1}

\subsubsection{baz}
\label{sec-1-1-1}
\subsubsection{hunoz}
\label{sec-1-1-2}

\end{document}
--8---cut here---end---8---

Nick



[O] latex export R code syntax highlighting with minted

2012-03-16 Thread Ista Zahn
Hi all,

I'm having trouble modifying the example at
http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-12-3
to highlight R code blocks. The trouble seems to be that org-mode
identifies R blocks using uppercase R, while pygments looks for
lowercase r.

For example, org exports

\begin{minted}{R}
 2+2
\end{minted}

but pygments doesn't know how to highlight R. If I change to

\begin{minted}{r}
 2+2
\end{minted}

(note the lower case r) then it works, but of course I don't want to
have to perform a find-and-replace every time.

Do you know how to either a) make org-mode identify R blocks with a
lowercase r, or b) make pygments recognize uppercase R, or c) some
other solution I've overlooked?

Thanks!
Ista



Re: [O] latex export R code syntax highlighting with minted

2012-03-16 Thread Christophe Pouzat
Ista Zahn istaz...@gmail.com writes:

 Hi all,

 I'm having trouble modifying the example at
 http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-12-3
 to highlight R code blocks. The trouble seems to be that org-mode
 identifies R blocks using uppercase R, while pygments looks for
 lowercase r.

 For example, org exports

 \begin{minted}{R}
  2+2
 \end{minted}

 but pygments doesn't know how to highlight R. If I change to

 \begin{minted}{r}
  2+2
 \end{minted}

 (note the lower case r) then it works, but of course I don't want to
 have to perform a find-and-replace every time.

 Do you know how to either a) make org-mode identify R blocks with a
 lowercase r, or b) make pygments recognize uppercase R, or c) some
 other solution I've overlooked?

 Thanks!
 Ista



Hi Ista,

Put the following expression:

(add-to-list 'org-export-latex-minted-langs '(R r))  

in an emacs-lisp code block at the beginning of your org file (or in the
*scratch* buffer) and evaluate it.

Christophe
  
-- 

Président, Nicolas Sarkozy représente une sorte de triomphe bouffon de 
l'égalitarisme français ; pour la première fois de notre histoire, nous avons 
un chef de l'État qui se comporte comme s'il ne valait pas mieux que les 
citoyens. C'est en réalité toujours le cas, mais cette vérité doit être cachée 
pour que les institutions et le système social tournent de façon, si ce n'est 
harmonieuse, du moins raisonnable.

E. Todd, Après la démocratie. 
--

Christophe Pouzat
MAP5 - Mathématiques Appliquées à Paris 5
CNRS UMR 8145
45, rue des Saints-Pères
75006 PARIS
France

tel: +33142863828
mobile: +33662941034
web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html



Re: [O] latex export R code syntax highlighting with minted

2012-03-16 Thread Ista Zahn
Ah, perfect! Thank you.

On Fri, Mar 16, 2012 at 5:13 PM, Christophe Pouzat
christophe.pou...@gmail.com wrote:
 (add-to-list 'org-export-latex-minted-langs '(R r))



Re: [O] latex export R code syntax highlighting with minted

2012-03-16 Thread Nick Dokos
Ista Zahn istaz...@gmail.com wrote:

 Hi all,
 
 I'm having trouble modifying the example at
 http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-12-3
 to highlight R code blocks. The trouble seems to be that org-mode
 identifies R blocks using uppercase R, while pygments looks for
 lowercase r.
 
 For example, org exports
 
 \begin{minted}{R}
  2+2
 \end{minted}
 
 but pygments doesn't know how to highlight R. If I change to
 
 \begin{minted}{r}
  2+2
 \end{minted}
 
 (note the lower case r) then it works, but of course I don't want to
 have to perform a find-and-replace every time.
 
 Do you know how to either a) make org-mode identify R blocks with a
 lowercase r, or b) make pygments recognize uppercase R, or c) some
 other solution I've overlooked?
 

Christophe provided the org solution a) and obviously that's the way to go
(maybe one of you could provide a patch to change the default value of
org-export-latex-minted-langs to add the R setting?)

For completeness, and of theoretical interest only, here's how to do b).

o Find the directory where pygments is installed. I just started python
  imported pygments and asked for help:

,
| $ python
| Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
| [GCC 4.5.2] on linux2
| Type help, copyright, credits or license for more information.
|  import pygments
|  help(pygments)
| Help on package pygments:
| 
| NAME
| pygments
| 
| FILE
| /usr/lib/python2.7/dist-packages/pygments/__init__.py
| ...  
`

o cd /path/to/pygments/lexers, edit the file math.py (you probably have
  to be root) and add the 'R' alias for 'S':

,
| ...
| name = 'S'
| aliases = ['splus', 's', 'r', 'R']
| filenames = ['*.S', '*.R']
| mimetypes = ['text/S-plus', 'text/S', 'text/R']
| ...
`

o run (as root) the _mapping.py script to regenerate stuff:

,
| $ sudo python _mapping.py
`

Nick





  



[O] LaTeX-export: letters after $..$ turn off math-mode

2012-02-06 Thread Daniel Schoepe
Hi,

I have the following issue: If I write something like `$n$th' in an org
file and then export it to LaTeX, it will produce `\$n\$th', whereas I
would like it to export this as `$n$th'. Is there some way I can disable
escaping of dollar signs entirely (Leaving it to me to escape them, when
I don't use them as math-mode delimiters)?

I did not find any option to that end in the documentation, but it's of
course possible that I just overlooked it.

Cheers,
Daniel



pgpn8BUV09jkx.pgp
Description: PGP signature


Re: [O] LaTeX-export: letters after $..$ turn off math-mode

2012-02-06 Thread Achim Gratz
Daniel Schoepe dan...@schoepe.org writes:
 I have the following issue: If I write something like `$n$th' in an org
 file and then export it to LaTeX, it will produce `\$n\$th', whereas I
 would like it to export this as `$n$th'. Is there some way I can disable
 escaping of dollar signs entirely (Leaving it to me to escape them, when
 I don't use them as math-mode delimiters)?

Using proper LaTeX math delimiters instead of that TeXism works nicely:
\(n\)th (the other TeXism, $n${}th also doesn't work).  In an UTF-8
document, a zero-width space would probably work too, but that's
devious.


HTH,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




Re: [O] LaTeX export: Keep point position in TeX file

2012-01-24 Thread Eric S Fraga
Michael Bach pha...@gmail.com writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 If so, I suggest you could achieve what you want by using the
 org-export-* hooks to, for instance, save current position before export
 and then jump to that position after export?  Maybe
 org-export-first-hook and org-export-latex-final-hook could be used?


 Thanks for your thoughts on this and sorry for being late to reply.  I

No problem!

 stumbled upon your reply and have tried it today with this:

[...]

 The switching to latex file works, but `(goto-char temppoint)' does not
 - for a reason I do not understand.  The only benefit of this is that

I do not understand either.  Putting in some (message ...) lines, it is
trying to (goto-char ...) to the right place in the buffer but that goto
doesn't seem to have any effect.

Have you looked at the code in org that actually invokes that hook to
see if maybe position is being changed afterwards?

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.8.03 (release_7.8.03.206.g10b06)



Re: [O] latex export of #+header: lines

2012-01-24 Thread Bastien
Hi Jambunathan,

Jambunathan K kjambunat...@gmail.com writes:

 I think the problem is not with the latex or odt backends as such but in
 the export pre-processor.

Just to make sure: are you suggesting `org-export-preprocess-string'
should normalize comment lines like ^.+#header.*) and move them to 
column 0 of the buffer?

Thanks in advance for any detail!

-- 
 Bastien



Re: [O] LaTeX export: Keep point position in TeX file

2012-01-23 Thread Michael Bach
Eric S Fraga e.fr...@ucl.ac.uk writes:

 If so, I suggest you could achieve what you want by using the
 org-export-* hooks to, for instance, save current position before export
 and then jump to that position after export?  Maybe
 org-export-first-hook and org-export-latex-final-hook could be used?


Thanks for your thoughts on this and sorry for being late to reply.  I
stumbled upon your reply and have tried it today with this:

--8---cut here---start-8---
(defun my-org-latex-export-save-point ()
  (interactive)
  (let ((latexfile (concat (file-name-sans-extension (buffer-name)) .tex))
(orgfile (buffer-name)))
(if (get-buffer latexfile)
(save-excursion (set-buffer latexfile)
(setq temppoint (point)))
  (message Open exported LaTeX file to save point position
--8---cut here---end---8---

`(interactive)' is only for testing purposes.  Saving of point in .tex
file under `temppoint' works this way.

I tried further restoring point but failed.  For reference:

--8---cut here---start-8---
(defun my-org-latex-export-restore-point ()
  (interactive)
  (let ((latexfile (concat (file-name-sans-extension (buffer-name)) .tex))
(orgfile (concat (file-name-sans-extension (buffer-name)) .org)))
(progn
  (switch-to-buffer-other-frame (get-buffer latexfile))
  (goto-char temppoint
--8---cut here---end---8--- 

The switching to latex file works, but `(goto-char temppoint)' does not
- for a reason I do not understand.  The only benefit of this is that
after export, emacs switches to the latex file automatically, which may
or may not be wanted (in my case, it is).

The last thing is to bind the functions to the correct hooks.  I found
this worked:

--8---cut here---start-8---
(add-hook 'org-export-latex-after-initial-vars-hook
  'my-org-latex-export-save-point)
(add-hook 'org-export-latex-after-save-hook
  'my-org-latex-export-restore-point)
--8---cut here---end---8---

 Untried and obviously untested!  And likely beyond my elisp capabilities
 so I'd be very keen on seeing a solution.  This behaviour has also
 bothered me (well, very minor irritation) for a long time as I often
 export to latex when debugging the export to PDF.


It is also a minor irritation to me.  And even if I could get my
solution to work as intended, this approach only helps for minor edits,
since the org-export could insert arbitrarily many new lines into the
latex file, making the restore by previous point position rather
useless.

What would be needed is a context sensitive position check which can
check for environments and contents simultaneously.  Just guessing and
thinking aloud here.  A solution by hobby-elispers like me will be
necessarily cumbersome, but maybe someone more skilled can pick up the
scraps and make it work better :-)

Best,
Michael



Re: [O] latex export of #+header: lines

2012-01-20 Thread Andreas Leha
Jambunathan K kjambunat...@gmail.com writes:

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Sebastien Vauban
 wxhgmqzgw...@spammotel.com writes:


 Hi Andreas,

 Andreas Leha wrote:
 I am experiencing a problem with the latex exporter:  #+header: lines
 are visible in the exported file.

 Example:

 /==\
 * test header tag 
   #+caption: foo  
   #+label: fig:fig1   
   #+name: foo 
   #+header: :file foo.png 
   #+header: :width 3600 :height 3600 :res 600 
   #+begin_src R :exports results :results graphics
 plot(1:10, 1:10)  
   #+end_src   
 \==/

 Try using #+LaTeX_HEADER: lines, instead.

 Best regards,
   Seb


 Hi Seb,

 thanks for the reply!

 But as far as I know, #+LaTeX_HEADER (as described
 here http://orgmode.org/org.html#Header-and-sectioning) is a different
 thing from babel source block header arguments (as described here
 http://orgmode.org/org.html#Code-block-specific-header-arguments)

 I use both quite extensively.

 The #+header: tags can be avoided by creating lng #+begin_src
 lines.  But still, they should not appear in the exported tex code, I
 think.

 Best,
 Andreas

 Just tried, and the odt export has them as well.  Maybe a problem on my
 test file?  Or is the #+header(s): tag somehow deprecated?

 If you remove the indentation of #+header: line (and thereby force it
 to start at column 0) you will see that (atleast) the ODT export doesn't
 have the header lines.

 I think the problem is not with the latex or odt backends as such but in
 the export pre-processor.


Hi Jambunathan,

thanks for this work-around with the removal of the indentation.  Works
for #+ATTR_ODT: in the LaTeX export as well.

Cheers,
Andreas




Re: [O] latex export of #+header: lines

2012-01-19 Thread Jambunathan K
Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Sebastien Vauban
 wxhgmqzgw...@spammotel.com writes:


 Hi Andreas,

 Andreas Leha wrote:
 I am experiencing a problem with the latex exporter:  #+header: lines
 are visible in the exported file.

 Example:

 /==\
 * test header tag 
   #+caption: foo  
   #+label: fig:fig1   
   #+name: foo 
   #+header: :file foo.png 
   #+header: :width 3600 :height 3600 :res 600 
   #+begin_src R :exports results :results graphics
 plot(1:10, 1:10)  
   #+end_src   
 \==/

 Try using #+LaTeX_HEADER: lines, instead.

 Best regards,
   Seb


 Hi Seb,

 thanks for the reply!

 But as far as I know, #+LaTeX_HEADER (as described
 here http://orgmode.org/org.html#Header-and-sectioning) is a different
 thing from babel source block header arguments (as described here
 http://orgmode.org/org.html#Code-block-specific-header-arguments)

 I use both quite extensively.

 The #+header: tags can be avoided by creating lng #+begin_src
 lines.  But still, they should not appear in the exported tex code, I
 think.

 Best,
 Andreas

 Just tried, and the odt export has them as well.  Maybe a problem on my
 test file?  Or is the #+header(s): tag somehow deprecated?

If you remove the indentation of #+header: line (and thereby force it
to start at column 0) you will see that (atleast) the ODT export doesn't
have the header lines.

I think the problem is not with the latex or odt backends as such but in
the export pre-processor.

 - Andreas




-- 



[O] latex export of #+header: lines

2012-01-17 Thread Andreas Leha
Hi all,

I am experiencing a problem with the latex exporter:  #+header: lines
are visible in the exported file.

Example:

/==\
* test header tag 
  #+caption: foo  
  #+label: fig:fig1   
  #+name: foo 
  #+header: :file foo.png 
  #+header: :width 3600 :height 3600 :res 600 
  #+begin_src R :exports results :results graphics
plot(1:10, 1:10)  
  #+end_src   
\==/

Results (LaTeX):

/=\
\section{test header tag}
\label{sec-1}
\#+header: :file foo.png 
  \#+header: :width 3600 :height 3600 :res 600   
\begin{figure}[htb]  
\centering   
\includegraphics[width=.9\linewidth]{foo.png}
\caption{\label{fig:fig1}foo}
\end{figure} 
\=/

The header arguments seem to take their effect, though.

Regards,
Andreas




Re: [O] latex export of #+header: lines

2012-01-17 Thread Sebastien Vauban
Hi Andreas,

Andreas Leha wrote:
 I am experiencing a problem with the latex exporter:  #+header: lines
 are visible in the exported file.

 Example:

 /==\
 * test header tag 
   #+caption: foo  
   #+label: fig:fig1   
   #+name: foo 
   #+header: :file foo.png 
   #+header: :width 3600 :height 3600 :res 600 
   #+begin_src R :exports results :results graphics
 plot(1:10, 1:10)  
   #+end_src   
 \==/

Try using #+LaTeX_HEADER: lines, instead.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] latex export of #+header: lines

2012-01-17 Thread Andreas Leha
Sebastien Vauban
wxhgmqzgw...@spammotel.com writes:


 Hi Andreas,

 Andreas Leha wrote:
 I am experiencing a problem with the latex exporter:  #+header: lines
 are visible in the exported file.

 Example:

 /==\
 * test header tag 
   #+caption: foo  
   #+label: fig:fig1   
   #+name: foo 
   #+header: :file foo.png 
   #+header: :width 3600 :height 3600 :res 600 
   #+begin_src R :exports results :results graphics
 plot(1:10, 1:10)  
   #+end_src   
 \==/

 Try using #+LaTeX_HEADER: lines, instead.

 Best regards,
   Seb


Hi Seb,

thanks for the reply!

But as far as I know, #+LaTeX_HEADER (as described
here http://orgmode.org/org.html#Header-and-sectioning) is a different
thing from babel source block header arguments (as described here
http://orgmode.org/org.html#Code-block-specific-header-arguments)

I use both quite extensively.

The #+header: tags can be avoided by creating lng #+begin_src
lines.  But still, they should not appear in the exported tex code, I
think.

Best,
Andreas




Re: [O] latex export of #+header: lines

2012-01-17 Thread Andreas Leha
Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Sebastien Vauban
 wxhgmqzgw...@spammotel.com writes:


 Hi Andreas,

 Andreas Leha wrote:
 I am experiencing a problem with the latex exporter:  #+header: lines
 are visible in the exported file.

 Example:

 /==\
 * test header tag 
   #+caption: foo  
   #+label: fig:fig1   
   #+name: foo 
   #+header: :file foo.png 
   #+header: :width 3600 :height 3600 :res 600 
   #+begin_src R :exports results :results graphics
 plot(1:10, 1:10)  
   #+end_src   
 \==/

 Try using #+LaTeX_HEADER: lines, instead.

 Best regards,
   Seb


 Hi Seb,

 thanks for the reply!

 But as far as I know, #+LaTeX_HEADER (as described
 here http://orgmode.org/org.html#Header-and-sectioning) is a different
 thing from babel source block header arguments (as described here
 http://orgmode.org/org.html#Code-block-specific-header-arguments)

 I use both quite extensively.

 The #+header: tags can be avoided by creating lng #+begin_src
 lines.  But still, they should not appear in the exported tex code, I
 think.

 Best,
 Andreas

Just tried, and the odt export has them as well.  Maybe a problem on my
test file?  Or is the #+header(s): tag somehow deprecated?

- Andreas




Re: [O] latex export of #+header: lines

2012-01-17 Thread Eric S Fraga
Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 Sebastien Vauban
 wxhgmqzgw...@spammotel.com writes:


 Hi Andreas,

 Andreas Leha wrote:
 I am experiencing a problem with the latex exporter:  #+header: lines
 are visible in the exported file.

Confirmation, exporting to latex.  Also happens with #+headers: lines.

The code actually executes as it should so the lines are being
interpreted correctly by babel so it's the exporting that is wrong.

org up to date from git.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.139.g94f1)



Re: [O] latex export of #+header: lines

2012-01-17 Thread Sebastien Vauban
Hi Andreas,

Andreas Leha wrote:
 Andreas Leha andreas.l...@med.uni-goettingen.de writes:
 Sebastien Vauban writes:
 Andreas Leha wrote:
 I am experiencing a problem with the latex exporter:  #+header: lines
 are visible in the exported file.

 Example:

 /==\
 * test header tag 
   #+caption: foo  
   #+label: fig:fig1   
   #+name: foo 
   #+header: :file foo.png 
   #+header: :width 3600 :height 3600 :res 600 
   #+begin_src R :exports results :results graphics
 plot(1:10, 1:10)  
   #+end_src   
 \==/

 Try using #+LaTeX_HEADER: lines, instead.

 But as far as I know, #+LaTeX_HEADER (as described
 here http://orgmode.org/org.html#Header-and-sectioning) is a different
 thing from babel source block header arguments (as described here
 http://orgmode.org/org.html#Code-block-specific-header-arguments)

Yes, they are. Sorry... I just read too quickly...

 I use both quite extensively.

 The #+header: tags can be avoided by creating lng #+begin_src
 lines.  But still, they should not appear in the exported tex code, I
 think.

They should not appear in the exported TeX code. You're right about that.

 Just tried, and the odt export has them as well.  Maybe a problem on my
 test file?  Or is the #+header(s): tag somehow deprecated?

I never used #+header (without the s). But that's not the problem...

This must be related to the new variable `org-babel-exp-code-template'.
See discussion at http://osdir.com/ml/emacs-orgmode-gnu/2012-01/msg00544.html.

Though, I must admit not yet having time for testing it...

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] LaTeX export problem

2012-01-17 Thread Piotr Kaźmierczak
Wiadomość napisana przez Nick Dokos w dniu 10 sty 2012, o godz. 01:13:

 Have you tried exporting a simple file to latex? Perhaps something as simple
 as:
 
 ---
 * Foo
 Bar
 ---
 
 
 Nick

Yes I have, it still produces a one-line TeX file. 


Re: [O] LaTeX export problem

2012-01-17 Thread Nick Dokos
Piotr Kaźmierczak p.h.kazmierc...@gmail.com wrote:

 Wiadomość napisana przez Nick Dokos w dniu 10 sty 2012, o godz. 01:13:
 
  Have you tried exporting a simple file to latex? Perhaps something as simple
  as:
  
  ---
  * Foo
  Bar
  ---
  
  
  Nick
 
 Yes I have, it still produces a one-line TeX file. 

In that case, it seems like your orgmode install is hosed - have you tried
reinstalling from scratch?

Nick



Re: [O] LaTeX export problem

2012-01-17 Thread Piotr Kaźmierczak
Wiadomość napisana przez Nick Dokos w dniu 17 sty 2012, o godz. 18:00:

 In that case, it seems like your orgmode install is hosed - have you tried
 reinstalling from scratch?

I did, but no luck. There must be something else I'm missing here, but I don't 
have time to investigate now. 

Thanks for your help, I'll post a solution here once I find one.

Piotr


Re: [O] LaTeX export problem

2012-01-17 Thread Eric S Fraga
Piotr Kaźmierczak p.h.kazmierc...@gmail.com writes:

 Wiadomość napisana przez Nick Dokos w dniu 10 sty 2012, o godz. 01:13:

 Have you tried exporting a simple file to latex? Perhaps something as simple
 as:
 
 ---
 * Foo
 Bar
 ---
 
 
 Nick

 Yes I have, it still produces a one-line TeX file. 

can you, just in case, post to the mailing list with both org and
resulting tex files attached?

Also, what do M-x find-library RET org RET and M-x org-version RET
say?

What operating system are you using?  I'm assuming a Mac from your
previous message.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.144.g7233)



[O] LaTeX export: Keep point position in TeX file

2012-01-12 Thread Michael Bach
Hello everyone,

The way I am now doing LaTeX export is that I have the exported tex
buffer below the org buffer.  When I do an export via `C-c C-e l' the
.tex buffer gets updated, but point jumps to beginning of buffer instead
of staying where it was.  (How) Can I changed that so point stays near
where it was before I exported again?

Best Regards,
Michael





Re: [O] LaTeX export: Keep point position in TeX file

2012-01-12 Thread Eric S Fraga
Michael Bach pha...@gmail.com writes:

 Hello everyone,

 The way I am now doing LaTeX export is that I have the exported tex
 buffer below the org buffer.  When I do an export via `C-c C-e l' the
 .tex buffer gets updated, but point jumps to beginning of buffer instead
 of staying where it was.  (How) Can I changed that so point stays near
 where it was before I exported again?

 Best Regards,
 Michael

I think this behaviour arises because the exporter exports to a buffer
which it first empties.  So the behaviour you see is very different from
when Emacs reverts a buffer when the file changes out from under it.

If so, I suggest you could achieve what you want by using the
org-export-* hooks to, for instance, save current position before export
and then jump to that position after export?  Maybe
org-export-first-hook and org-export-latex-final-hook could be used?

Untried and obviously untested!  And likely beyond my elisp capabilities
so I'd be very keen on seeing a solution.  This behaviour has also
bothered me (well, very minor irritation) for a long time as I often
export to latex when debugging the export to PDF.

HTH,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.106.gc835)



[O] LaTeX export: how to customize date format?

2012-01-09 Thread Carlos Russo
Hello,

Is there a way to customize how a date is exported into LaTeX?
Google couldn't help me on this.

For example, if an org file contains a timestamp 2012-01-09 Mon, I'm
getting an italicized version in the .tex file, i.e. \textit{2012-01-09
Mon}.

I would like to be able to change how dates are displayed in a global
way. In particular, I'm interested in automatically formatting the dates
in my documents using \usepackage[option]{isodate}?

So, in other words, I'd like to tell orgmode that it should output the
following
\printdate{2012-01-09}
or
\date-range{2012-01-01}{2012-01-09}
for date ranges.

I could use then use
#+LATEX_HEADER: \usepackage[option]{isodate}
to quickly change the date format, which could produce results as
diverse as:
Jan 9, 2012
January 9, 2012
Janvier 9, 2012
2012/01/09
2012/09/01
and so on...

Any hints on how to do this?

Cheers,
Carlos








Re: [O] LaTeX export: how to customize date format?

2012-01-09 Thread Bastien
Hi Carlos,

Carlos Russo mestre.adamas...@gmail.com writes:

 Is there a way to customize how a date is exported into LaTeX?

You cannot do this right now.

See these variables:

org-export-latex-timestamp-markup:
  A printf format string to be applied to time stamps.

org-export-latex-timestamp-inactive-markup:
  A printf format string to be applied to inactive time stamps.

org-export-latex-timestamp-keyword-markup:
  A printf format string to be applied to time stamps.

HTH,

-- 
 Bastien



Re: [O] LaTeX export: how to customize date format?

2012-01-09 Thread Bastien
Bastien b...@altern.org writes:

 Is there a way to customize how a date is exported into LaTeX?

 You cannot do this right now.

Er.. forget this sentence -- perhaps my subconscious is trying
to tell me there are too many variables in Org now :) 

-- 
 Bastien



Re: [O] LaTeX export: how to customize date format?

2012-01-09 Thread Carlos Russo
Thanks, it seems that
(setq org-export-latex-timestamp-markup \\printdate{%s})
does half of the job already.

 Er.. forget this sentence -- perhaps my subconscious is trying
 to tell me there are too many variables in Org now :) 


I suppose this means there are no plans of creating a variable containing the 
markup associated with a date range, right :-p?

Cheers,
Carlos




Re: [O] LaTeX export: how to customize date format?

2012-01-09 Thread Bastien
Carlos Russo mestre.adamas...@gmail.com writes:

 I suppose this means there are no plans of creating a variable containing
 the markup associated with a date range, right :-p?

Not that I know -- but beware of the conspiracy, as the LaTeX exporter
is currently being rewritten by Nicolas...  see org-e-latex.el in the 
EXPERIMENTAL/ directory.  I guess configuring the format for dates range 
is not beyond possibility.

-- 
 Bastien



[O] LaTeX export problem

2012-01-09 Thread Piotr Kaźmierczak
Hi,   

I have a very strange problem: I can no longer process an org file with all my 
notes to LaTeX. I've been using org-mode this way for some time now, and I was 
always able to get a nice tex file I could later process to PDF. Now all I get 
is a TeX file with absolutely no new-line symbols (a huge one-line file), and 
pdflatex obviously can't process that. I haven't updated org for a while, and 
it doesn't seem to matter which Emacs version I try (GNU 23, GNU 24, Aquamacs 
2.4), I still can't get the correct output. The only difference from the last 
time I managed to get a correct tex output is that I added some more notes to 
the org file.  

I'm using Org 7.8.

Any ideas?

regards,
Piotr Kaźmierczak





Re: [O] LaTeX export problem

2012-01-09 Thread Nick Dokos

Piotr Kaźmierczak p.h.kazmierc...@gmail.com wrote:


 I have a very strange problem: I can no longer process an org file
 with all my notes to LaTeX. I've been using org-mode this way for some
 time now, and I was always able to get a nice tex file I could later
 process to PDF. Now all I get is a TeX file with absolutely no
 new-line symbols (a huge one-line file), and pdflatex obviously can't
 process that. I haven't updated org for a while, and it doesn't seem
 to matter which Emacs version I try (GNU 23, GNU 24, Aquamacs 2.4), I
 still can't get the correct output. The only difference from the last
 time I managed to get a correct tex output is that I added some more
 notes to the org file.
 

Have you tried exporting a simple file to latex? Perhaps something as simple
as:

---
* Foo
Bar
---


Nick



Re: [O] LaTeX export

2012-01-01 Thread York Zhao
 Read Chapter 14 of the Org-mode manual. And go to
 http://orgmode.org/worg/ and search with the keyword literate.

Thanks, I've read these already, they are helpful.

Happy New Year
York



Re: [O] LaTeX export

2011-12-31 Thread Bastien
Hi York,

York Zhao gtdplatf...@gmail.com writes:

 I'm wondering if there is a way to export ONLY the LaTeX code within
 #+begin_latex and #+end_latex. I want the exact literal export without
 adding anything before and after my code. The result should be exactly the 
 same
 as if I have copied the block between #+begin_latex and #+end_latex and
 pasted to a new buffer.

I would use code blocks tangling

,
| #+TITLE: Test
| 
| * Test headline
| 
| #+begin_src tex :tangle yes
| \documentclass{article}
| \begin{document}
| ...
| \end{document}
| #+end_src
`

`C-c C-v t' on the block will create a .tex file with the exact content
of the #+begin_src block.

HTH,

-- 
 Bastien



Re: [O] LaTeX export

2011-12-31 Thread York Zhao
 I would use code blocks tangling

 ,
 | #+TITLE: Test
 |
 | * Test headline
 |
 | #+begin_src tex :tangle yes
 | \documentclass{article}
 | \begin{document}
 | ...
 | \end{document}
 | #+end_src
 `

 `C-c C-v t' on the block will create a .tex file with the exact content
 of the #+begin_src block.

 HTH,

 --
  Bastien

Hi Bastien,

Thanks a lot, this really works, and it sounds like literate programming. Can
you suggest some quick reading on using org-mode for literate programming?

Happy new year,

York



Re: [O] LaTeX export

2011-12-31 Thread Steve Hafner

 Hi Bastien,

 Thanks a lot, this really works, and it sounds like literate programming. Can
 you suggest some quick reading on using org-mode for literate programming?

 Happy new year,

 York


Read Chapter 14 of the Org-mode manual. And go to
http://orgmode.org/worg/ and search with the keyword literate.



[O] LaTeX export

2011-12-30 Thread York Zhao
Hi there,

I'm wondering if there is a way to export ONLY the LaTeX code within
#+begin_latex and #+end_latex. I want the exact literal export without
adding anything before and after my code. The result should be exactly the same
as if I have copied the block between #+begin_latex and #+end_latex and
pasted to a new buffer.

Thanks,


York



Re: [O] LaTeX export keyword coloring

2011-11-27 Thread Michael Bach
Michael Bach pha...@gmail.com writes:

 Can someone give me a hint on where to look for a solution?  Do I miss
 something obvious?

Indeed I missed something obvious.  Once again: More thinking, less
typing.

Sorry for the noise



[O] LaTeX export keyword coloring

2011-11-25 Thread Michael Bach
Hello,

I am having trouble controlling what org's LaTeX export does with my
keyword markup.  I have set

org-export-latex-todo-keyword-markup (quote ((NEW . \\new{%s}) 
 (TODO . \\todo{%s})
 (DONE . \\done{%s})))

In the org file, I got

#+OPTIONS: todo:t
#+LATEX_HEADER: \usepackage[usenames, dvipsnames]{color}
#+LATEX_HEADER: \def\done#1{{\color{ForestGreen}#1}}

I am using the standard latex export class.  When I export to a
temporary buffer via C-c C-e L, I see this below my inserted
#+LATEX_HEADER lines

\usepackage[usenames, dvipsnames]{color}
\def\done#1{{\color{ForestGreen}#1}}
\usepackage{color}
\def\todo#1{{\color{red}#1}}
\def\done#1{{\color{green}#1}}
\providecommand{\alert}[1]{\textbf{#1}}

Now I wonder where the last 4 lines (which overrule the coloring) came
from and am at a loss.  I could not find it in the docs and googled
around to no avail.  Also, I do not think this is caused by my other
org-mode configuration settings.

Can someone give me a hint on where to look for a solution?  Do I miss
something obvious?

Thanks in advance,
Michael Bach



Re: [O] LaTeX export: footnotes vs. angle brackets in Babel snippets

2011-11-19 Thread Nicolas Goaziou
Hello,

l...@gnu.org (Ludovic Courtès) writes:


 The LaTeX exporter of Org 7.7 from a recent Emacs snapshot improperly
 interprets sequences with angle brackets in Babel snippets as if they
 were footnote references, as in:

   #+BEGIN_src C
 int array[2];
   #+END_src

 This leads to a wrong-type-arg error in ‘org-export-latex-preprocess’.

This bug has been fixed in the development version. You may upgrade or
wait for Org 7.8.


Regards,

-- 
Nicolas Goaziou



[O] LaTeX export: footnotes vs. angle brackets in Babel snippets

2011-11-18 Thread Ludovic Courtès
Hello,

The LaTeX exporter of Org 7.7 from a recent Emacs snapshot improperly
interprets sequences with angle brackets in Babel snippets as if they
were footnote references, as in:

  #+BEGIN_src C
int array[2];
  #+END_src

This leads to a wrong-type-arg error in ‘org-export-latex-preprocess’.

It’s a regression compared to Org 7.5.

Thanks,
Ludo’.



[O] LaTeX export log

2011-10-18 Thread Andrei Jirnyi
Is there any way to see (in a temporary buffer) the log generated by 
pdflatex when compiling the exported document with C-e p ?

--aj




Re: [O] LaTeX export crashes

2011-10-17 Thread Ken Williams
On Thu, Oct 13, 2011 at 4:48 PM, Ken Williams kena...@gmail.com wrote:
 Hi, the following document makes a LaTeX export (C-c C-e d) crash with
 Args out of range: , -1, 0.  After that, exporting (to any format)
 dies with the same error.
 [snip]

Then Sebastien Vauban wrote:
 Works for me, with Org-mode version 7.7 (release_7.7.381.ge8629.dirty).

Here's a full stack trace, does this make it any more evident what's going on?

 -Ken

Debugger entered--Lisp error: (args-out-of-range  -1 0)
  substring( -1)
  (string= \n (substring body sub-length))
  (if (string= \n (substring body sub-length)) (substring body 0
sub-length) body)
  (let* ((body ...) (sub-length ...)) (if (string= \n ...)
(substring body 0 sub-length) body))
  (org-babel-clean-text-properties (let* (... ...) (if ... ... body)))
  (let* ((block-indentation ...) (lang ...) (lang-headers ...)
(switches ...) (body ...) (preserve-indentation ...)) (list lang
(with-temp-buffer ...) (org-babel-merge-params
org-babel-default-header-args ... ... ... ...) switches
block-indentation))
  org-babel-parse-src-block-match()
  (setq info (org-babel-parse-src-block-match))
  (save-excursion (goto-char head) (setq info
(org-babel-parse-src-block-match)) (setq indent (car ...)) (setq info
(butlast info)) (while (and ... ...) (setf ... ...)) (when (looking-at
org-babel-src-name-w-name-regexp) (setq name ...) (when ... ...)))
  (if (setq head (org-babel-where-is-src-block-head)) (save-excursion
(goto-char head) (setq info ...) (setq indent ...) (setq info ...)
(while ... ...) (when ... ... ...)) (when (save-excursion ... ...)
(setq info ...)))
  (let ((case-fold-search t) head info name indent) (if (setq head
...) (save-excursion ... ... ... ... ... ...) (when ... ...)) (when
(and info ...) (setf ... ...)) (when info (append info ...)))
  org-babel-get-src-block-info(light)
  (let* ((info ...) (lang ...) (raw-params ...) hash) (when info (when
... ... ...) (setf ... ...) (org-babel-exp-do-export info ... hash)))
  (save-excursion (goto-char (match-beginning 0)) (let* (... ... ...
hash) (when info ... ... ...)))
  org-babel-exp-src-block( #(R 0 1 (font-lock-fontified t fontified nil)))
  apply(org-babel-exp-src-block  #(R 0 1 (font-lock-fontified t
fontified nil)))
  (if (memq type org-export-blocks-witheld)  (apply func body headers))
  (progn (if (memq type org-export-blocks-witheld)  (apply func body
headers)))
  (unwind-protect (progn (if ...  ...)) (set-match-data
save-match-data-internal (quote evaporate)))
  (let ((save-match-data-internal ...)) (unwind-protect (progn ...)
(set-match-data save-match-data-internal ...)))
  (save-match-data (if (memq type org-export-blocks-witheld)  (apply
func body headers)))
  (let ((replacement ...)) (when replacement (delete-region
match-start match-end) (goto-char match-start) (insert replacement)
(unless preserve-indent ...)))
  (progn (let (...) (when replacement ... ... ... ...)))
  (if (setq func (cadr ...)) (progn (let ... ...)))
  (when (setq func (cadr ...)) (let (...) (when replacement ... ... ... ...)))
  (let* ((match-start ...) (body-start ...) (indentation ...)
(inner-re ...) (type ...) (headers ...) (balanced 1) (preserve-indent
...) match-end) (while (and ... ...) (if ... ... ...)) (when (not ...)
(error unbalanced begin/end_%s blocks with %S type ...)) (setq
match-end (match-end 0)) (unless preserve-indent (setq body ...))
(unless (memq type types) (setq types ...)) (save-match-data
(interblock start match-start)) (when (setq func ...) (let ... ...)))
  (while (re-search-forward beg-re nil t) (let* (... ... ... ... ...
... ... ... match-end) (while ... ...) (when ... ...) (setq match-end
...) (unless preserve-indent ...) (unless ... ...) (save-match-data
...) (when ... ...)) (setq start (point)))
  (let ((beg-re ^\\([  ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[
\n])) (while (re-search-forward beg-re nil t) (let* ... ... ... ...
... ... ... ...) (setq start ...)))
  (progn (fset (quote interblock) (function* ...)) (goto-char
(point-min)) (setq start (point)) (let (...) (while ... ... ...))
(interblock start (point-max)) (run-hooks (quote
org-export-blocks-postblock-hook)))
  (unwind-protect (progn (fset ... ...) (goto-char ...) (setq start
...) (let ... ...) (interblock start ...) (run-hooks ...)) (if
--cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...)))
  (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...))
(unwind-protect (progn ... ... ... ... ... ...) (if --cl-letf-bound--
... ...)))
  (letf ((... ...)) (goto-char (point-min)) (setq start (point)) (let
(...) (while ... ... ...)) (interblock start (point-max)) (run-hooks
(quote org-export-blocks-postblock-hook)))
  (letf* ((... ...)) (goto-char (point-min)) (setq start (point)) (let
(...) (while ... ... ...)) (interblock start (point-max)) (run-hooks
(quote org-export-blocks-postblock-hook)))
  (flet ((interblock ... ...)) (goto-char (point-min)) (setq start
(point)) (let (...) (while ... ... ...)) (interblock start
(point-max)) 

Re: [O] LaTeX export crashes

2011-10-17 Thread Nick Dokos
Ken Williams kena...@gmail.com wrote:

 On Thu, Oct 13, 2011 at 4:48 PM, Ken Williams kena...@gmail.com wrote:
  Hi, the following document makes a LaTeX export (C-c C-e d) crash with
  Args out of range: , -1, 0.  After that, exporting (to any format)
  dies with the same error.
  [snip]
 
 Then Sebastien Vauban wrote:
  Works for me, with Org-mode version 7.7 (release_7.7.381.ge8629.dirty).
 
 Here's a full stack trace, does this make it any more evident what's going on?
 

Not really: you have not mentioned what version you are using. Chances are
you are running an older version which has the problem, Seb is running
a recent 7.7 which does not exhibit the problem (I tried it too: works for
me as well with Org-mode version 7.7 (release_7.7.392.g35d92)).
So upgrade to latest and see if you can reproduce the problem.

Nick



Re: [O] LaTeX export crashes

2011-10-17 Thread Nick Dokos
Nick Dokos nicholas.do...@hp.com wrote:

 Ken Williams kena...@gmail.com wrote:
 
  On Thu, Oct 13, 2011 at 4:48 PM, Ken Williams kena...@gmail.com wrote:
   Hi, the following document makes a LaTeX export (C-c C-e d) crash with
   Args out of range: , -1, 0.  After that, exporting (to any format)
   dies with the same error.
   [snip]
  
  Then Sebastien Vauban wrote:
   Works for me, with Org-mode version 7.7 (release_7.7.381.ge8629.dirty).
  
  Here's a full stack trace, does this make it any more evident what's going 
  on?
  
 
 Not really: you have not mentioned what version you are using. Chances are
 you are running an older version which has the problem, Seb is running
 a recent 7.7 which does not exhibit the problem (I tried it too: works for
 me as well with Org-mode version 7.7 (release_7.7.392.g35d92)).
 So upgrade to latest and see if you can reproduce the problem.
 

BTW, I suspect that commit 597e1eb4fe7b2674c2d5233f215217f7b35e4035 is what
fixed this problem. Given that this was done on Sept. 13, you need to run
something later than that to pick up the fix (or cherry pick the patch and
apply it to your version, but I wouldn't recommend this course of action).
The recommendation stands: upgrade!

Nick





Re: [O] LaTeX export crashes

2011-10-17 Thread Ken Williams
On Mon, Oct 17, 2011 at 4:52 PM, Nick Dokos nicholas.do...@hp.com wrote:
 Ken Williams kena...@gmail.com wrote:

 Here's a full stack trace, does this make it any more evident what's going 
 on?


 Not really: you have not mentioned what version you are using.

I did post my complete config, which this message was a direct reply to:

  http://article.gmane.org/gmane.emacs.orgmode/47841

I probably confused matters by posting first without my config, from
the wrong address, so I thought it wouldn't make it to the list.

 Chances are you are running an older version which has the problem, Seb is 
 running
 a recent 7.7 which does not exhibit the problem (I tried it too: works for
 me as well with Org-mode version 7.7 (release_7.7.392.g35d92)).
 So upgrade to latest and see if you can reproduce the problem.

Nope, I'm already running 7.7.

 -Ken



Re: [O] LaTeX export crashes

2011-10-17 Thread Nick Dokos
Ken Williams kena...@gmail.com wrote:

 On Mon, Oct 17, 2011 at 4:52 PM, Nick Dokos nicholas.do...@hp.com wrote:
  Ken Williams kena...@gmail.com wrote:
 
  Here's a full stack trace, does this make it any more evident what's going 
  on?
 
 
  Not really: you have not mentioned what version you are using.
 
 I did post my complete config, which this message was a direct reply to:
 
   http://article.gmane.org/gmane.emacs.orgmode/47841
 
 I probably confused matters by posting first without my config, from
 the wrong address, so I thought it wouldn't make it to the list.
 

Sorry about that - not sure what I did: I searched the list and found a
thread but it did not have a config but I may not have gone back far
enough. 

  Chances are you are running an older version which has the problem, Seb is 
  running
  a recent 7.7 which does not exhibit the problem (I tried it too: works for
  me as well with Org-mode version 7.7 (release_7.7.392.g35d92)).
  So upgrade to latest and see if you can reproduce the problem.
 
 Nope, I'm already running 7.7.
 
  -Ken
 

As I pointed out in the subsequent message, that's not good enough: 7.7 came out
on July 28 and the fix (at least what I *think* is the fix) did not go in until
September 13.

Nick



Re: [O] LaTeX export crashes

2011-10-17 Thread Nick Dokos
Nick Dokos nicholas.do...@hp.com wrote:

 Ken Williams kena...@gmail.com wrote:
 
  On Mon, Oct 17, 2011 at 4:52 PM, Nick Dokos nicholas.do...@hp.com wrote:
   Ken Williams kena...@gmail.com wrote:
  
   Here's a full stack trace, does this make it any more evident what's 
   going on?
  
  
   Not really: you have not mentioned what version you are using.
  
  I did post my complete config, which this message was a direct reply to:
  
http://article.gmane.org/gmane.emacs.orgmode/47841
  
  I probably confused matters by posting first without my config, from
  the wrong address, so I thought it wouldn't make it to the list.
  

Yup - that's what it was. I found the *other* thread:

  http://thread.gmane.org/gmane.emacs.orgmode/47842

 
 Sorry about that - not sure what I did: I searched the list and found a
 thread but it did not have a config but I may not have gone back far
 enough. 
 
   Chances are you are running an older version which has the problem, Seb 
   is running
   a recent 7.7 which does not exhibit the problem (I tried it too: works for
   me as well with Org-mode version 7.7 (release_7.7.392.g35d92)).
   So upgrade to latest and see if you can reproduce the problem.
  
  Nope, I'm already running 7.7.
  
   -Ken
  
 
 As I pointed out in the subsequent message, that's not good enough: 7.7 came 
 out
 on July 28 and the fix (at least what I *think* is the fix) did not go in 
 until
 September 13.
 
 Nick
 



Re: [O] LaTeX export crashes

2011-10-17 Thread Ken Williams
On Mon, Oct 17, 2011 at 8:31 PM, Nick Dokos nicholas.do...@hp.com wrote:

 As I pointed out in the subsequent message, that's not good enough: 7.7 came 
 out
 on July 28 and the fix (at least what I *think* is the fix) did not go in 
 until
 September 13.

Ah, I see - I was thinking 7.7 came out at the end of September, not
sure why I thought that.

Looking at commit 597e1eb it does seem on target.  I'll probably hold
off upgrading until 7.8, since I'm running in a corporate environment
 I can survive fine with workarounds.

Thanks for your help.

 -Ken



[O] LaTeX export crashes

2011-10-14 Thread Ken Williams
Hi, the following document makes a LaTeX export (C-c C-e d) crash with
Args out of range: , -1, 0.  After that, exporting (to any format)
dies with the same error.

--
#+TITLE: Test doc
#+AUTHOR: Ken Williams

Some stuff.

#+begin_src R
5+5
#+end_src
--

Is this a known problem?

If I either omit the R source block, or add a top-level outline
element to the document, then the export succeeds.  For now as a
workaround I guess I'll add a header.

Thanks,

 -Ken



Emacs  : GNU Emacs 23.3.1 (i386-mingw-nt6.1.7600)
 of 2011-03-10 on 3249CTO
Package: Org-mode version 7.7

current state:
==
(setq
 org-log-done 'time
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-babel-load-languages '((emacs-lisp) (R . t))
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-alphabetical-lists t
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-export-html-style style type=\text/css\\n
!--/*--![CDATA[/*!--*/\n  .src {
background-color: #F5FFF5; position: relative; overflow: visible;
margin-right: auto; }\n  .src:before  { position: absolute;
top: -15px; background: #ff; padding: 1px; border: 1px solid
#00; font-size: small; }\n  .src-sh:before   { content: 'sh';
}\n  .src-bash:before { content: 'sh'; }\n  .src-R:before{
content: 'R'; }\n  .src-perl:before { content: 'Perl'; }\n
.src-sql:before  { content: 'SQL'; }\n  .example {
background-color: #FFF5F5; }\n/*]]*/--\n/style
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-export-preprocess-hook '((lambda nil
   (org-set-local (quote
 org-complex-heading-regexp)
^\\(\\*+\\)[
 ]+\\(?:\\(TODO\\|DONE\\))?\\(?:[  ]*\\(\\[#.\\]\\)\\)?[
 ]*\\(.*?\\)\\(?:[  ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[]*$)
   )
  )
 org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees
 org-cycle-hide-drawers org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook
'(org-remove-file-link-modifiers)
 org-mode-hook '(#[nil \300\301\302\303\304$\207 [org-add-hook
 change-major-mode-hook org-show-block-all append local]
   5]
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook
 org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src
org-babel-exp-inline-src-blocks))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-occur-hook '(org-first-headline-recenter)
 org-from-is-user-regexp nil
 org-export-babel-evaluate nil
 org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)
 org-confirm-babel-evaluate nil
 org-export-latex-final-hook '(org-beamer-amend-header
 org-beamer-fix-toc org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-blocks '((src org-babel-exp-src-block nil) (comment
 org-export-blocks-format-comment t)
 (ditaa org-export-blocks-format-ditaa nil) (dot
org-export-blocks-format-dot nil))
 )



[O] LaTeX export crashes

2011-10-14 Thread Ken Williams
Hi, the following document makes a LaTeX export (C-c C-e d) crash with Args 
out of range: , -1, 0.  After that,

--
#+TITLE: Test doc
#+AUTHOR: Ken Williams

Some stuff.

#+begin_src R
5+5
#+end_src
--

Is this a known problem?

If I either omit the R source block, or add a top-level outline element to the 
document, then the export succeeds.  For now as a workaround I guess I'll add a 
header.

Thanks,

 -Ken

CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. Any 
unauthorized review, use, disclosure or distribution of any kind is strictly 
prohibited. If you are not the intended recipient, please contact the sender 
via reply e-mail and destroy all copies of the original message. Thank you.



Re: [O] LaTeX export crashes

2011-10-14 Thread Sebastien Vauban
Hi Ken,

Ken Williams wrote:
 Hi, the following document makes a LaTeX export (C-c C-e d) crash with Args
 out of range: , -1, 0. After that,

 --
 #+TITLE: Test doc
 #+AUTHOR: Ken Williams

 Some stuff.

 #+begin_src R
 5+5
 #+end_src
 --

 Is this a known problem?

Works for me, with Org-mode version 7.7 (release_7.7.381.ge8629.dirty).

Best regards,
  Seb

-- 
Sebastien Vauban




[O] Latex Export: Place Caption Below Table

2011-09-28 Thread Jakob Lombacher
Hi,

if I export a document to latex, the caption of a table is always on the top.

How can I place it at the bottom? Is there a parameter to config it?

Thanks

Jakob

Examaple

#+LABEL: tbl:asdf
#+CAPTION: ?
| | |

leads to:
---

\begin{table}[htb]
\caption{?} \label{tbl:datenstrukturen}
.
\end{table}

I need:
--

\begin{table}[htb]
.
\caption{?} \label{tbl:datenstrukturen}
\end{table}



Re: [O] Latex Export: Place Caption Below Table

2011-09-28 Thread Eric S Fraga
Jakob Lombacher kont...@lombacher.net writes:

 Hi,

 if I export a document to latex, the caption of a table is always on the top.

 How can I place it at the bottom? Is there a parameter to config it?

No, the placement is (currently) fixed to come before the tabular (or
alternative) environment.  Line 1970 or thereabouts in
org-latex.el.  Should be straightforward to modify although it is a
quite common convention to have the caption above the table...

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.7 (release_7.7.329.g15c3)



Re: [O] Latex Export: Place Caption Below Table

2011-09-28 Thread Thomas S. Dye
Eric S Fraga e.fr...@ucl.ac.uk writes:

 Jakob Lombacher kont...@lombacher.net writes:

 Hi,

 if I export a document to latex, the caption of a table is always on the top.

 How can I place it at the bottom? Is there a parameter to config it?

 No, the placement is (currently) fixed to come before the tabular (or
 alternative) environment.  Line 1970 or thereabouts in
 org-latex.el.  Should be straightforward to modify although it is a
 quite common convention to have the caption above the table...

Hi Eric,

Are you able to propose a patch?  This came up in my work recently with
a journal that puts captions below a table (and ends them with a
period!).  

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] Latex Export: Place Caption Below Table

2011-09-28 Thread Nick Dokos
Thomas S. Dye t...@tsdye.com wrote:

 Eric S Fraga e.fr...@ucl.ac.uk writes:
 
  Jakob Lombacher kont...@lombacher.net writes:
 
  Hi,
 
  if I export a document to latex, the caption of a table is always on the 
  top.
 
  How can I place it at the bottom? Is there a parameter to config it?
 
  No, the placement is (currently) fixed to come before the tabular (or
  alternative) environment.  Line 1970 or thereabouts in
  org-latex.el.  Should be straightforward to modify although it is a
  quite common convention to have the caption above the table...
 
 Hi Eric,
 
 Are you able to propose a patch?  This came up in my work recently with
 a journal that puts captions below a table (and ends them with a
 period!).  
 

It's just a matter of emitting the \caption after the contents of the
table, rather than before:

,
| \begin{table}[htb]
| \begin{center}
| \begin{tabular}{rr}
| ...
| \end{tabular}
| \end{center}
| \caption{Squares}
| \end{table}
`

instead of

,
| \begin{table}[htb]
| \caption{Squares}
| \begin{center}
| \begin{tabular}{rr}
| ...
| \end{tabular}
| \end{center}
| \end{table}
`


The following patch (deliberately hidden as a binary octet-stream to keep it
out of patchwork) will do that - but IMO, it would be better to have yet another
user-settable option to control the placement.

Nick



caption-below-table.patch
Description: caption below table patch


Re: [O] LaTeX export of lists

2011-08-24 Thread Eric S Fraga
t...@tsdye.com (Thomas S. Dye) writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 t...@tsdye.com (Thomas S. Dye) writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:
 That raises an interesting question: can a list belong to a paragraph in
 Org? According to paragraph-related regexps, it can't, for now. And your
 request is more a LaTeXism than an Orgism (!).

 I probably don't understand your question fully, but it seems obvious to
 me that a list can either belong to a paragraph or it can be separate.
 I'm not certain why Org-mode would want to choose one over the other.

 It isn't obvious. For example, in HTML, a list within a paragraph
 doesn't even make sense[1].

 There's no harm in it, but you're basically faking Org and its LaTeX
 exporter, as lists and paragraphs are two distinct entities[2].

[...]


 Aloha Nicolas,

 Interesting observations.  Thanks.

 The relation seems obvious to me because my model comes from printed
 works, which commonly include enumerated lists typeset within
 paragraphs.  

 Perhaps given the limitation of the HTML spec and the structure of
 paragraphs in Org-mode it will always be necessary to have the LaTeX
 exporter take care of setting lists inside paragraphs.

 Thanks again for your help with this.

 All the best,
 Tom

Latex does have the concept of lists within paragraphs in that
paragraph boundaries are defined by blank lines.  So, if you have a
begin{itemize}...end{itemize} with no blank lines before and after, the
list implicitly is part of the enclosing paragraph.

whether lists exported from org should automatically be within
paragraphs or not is unclear.  I personally prefer having them outside
but that's because, in latex, I tend to have 0 paragraph separation with
indented first lines.  If I want a list to look like it's embedded
within a paragraph, I put a \nonindent on the paragraph following the
list.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.7 (release_7.7.175.g8478)



Re: [O] LaTeX export of lists

2011-08-24 Thread Nicolas Goaziou
Hello,

Eric S Fraga e.fr...@ucl.ac.uk writes:

 Latex does have the concept of lists within paragraphs in that
 paragraph boundaries are defined by blank lines.  So, if you have a
 begin{itemize}...end{itemize} with no blank lines before and after, the
 list implicitly is part of the enclosing paragraph.

That's why I talked about LaTeXism.

 whether lists exported from org should automatically be within
 paragraphs or not is unclear.

For the record:

From Org view, lists and paragraphs are distinct elements. More
accurately, lists can hold paragraphs, but not the opposite.

From LaTeX view, it's true that a list can belong to a paragraph. But,
again, such a thing is impossible in HTML, in OpenDocument, where the
list is a paragraph-level element[1], and in DocBook.

So this is consistent with most of the exporters encountered in
Org. Now, to provide compatibility with LaTeX, Org export system has to
respect blank lines (or the absence thereof) in the buffer.


Regards,

[1] 
http://docs.oasis-open.org/office/v1.1/OS/OpenDocument-v1.1-html/OpenDocument-v1.1.html#4.3.Lists|outline

-- 
Nicolas Goaziou



Re: [O] LaTeX export of lists

2011-08-24 Thread Achim Gratz
Eric S Fraga e.fr...@ucl.ac.uk writes:
 Latex does have the concept of lists within paragraphs in that
 paragraph boundaries are defined by blank lines.  So, if you have a
 begin{itemize}...end{itemize} with no blank lines before and after, the
 list implicitly is part of the enclosing paragraph.

It can probably be argued that LaTeX merely agnostic of the issue, but
has a way to infer where \parskip\indent should go.  This distinction
may seem to be a too fine one to make, but as far as the formatting
machinery of TeX is concerned, it becomes all vmode and hmode boxes
anyway.

Importantly however, in the HTML4 document model paragraphs cannot
contain any blocklevel elements and that includes lists and paragraphs
themselves.  The visual result could be faked much in the same way that
LaTeX does by having two different classes for the P element, but this
adds another level of complexity that all export backends need to deal
with when the construct should be portable.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

SD adaptation for Waldorf Blofeld V1.15B11:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] LaTeX export of lists

2011-08-24 Thread Thomas S. Dye
Eric S Fraga e.fr...@ucl.ac.uk writes:

 t...@tsdye.com (Thomas S. Dye) writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 t...@tsdye.com (Thomas S. Dye) writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:
 That raises an interesting question: can a list belong to a paragraph in
 Org? According to paragraph-related regexps, it can't, for now. And your
 request is more a LaTeXism than an Orgism (!).

 I probably don't understand your question fully, but it seems obvious to
 me that a list can either belong to a paragraph or it can be separate.
 I'm not certain why Org-mode would want to choose one over the other.

 It isn't obvious. For example, in HTML, a list within a paragraph
 doesn't even make sense[1].

 There's no harm in it, but you're basically faking Org and its LaTeX
 exporter, as lists and paragraphs are two distinct entities[2].

 [...]


 Aloha Nicolas,

 Interesting observations.  Thanks.

 The relation seems obvious to me because my model comes from printed
 works, which commonly include enumerated lists typeset within
 paragraphs.  

 Perhaps given the limitation of the HTML spec and the structure of
 paragraphs in Org-mode it will always be necessary to have the LaTeX
 exporter take care of setting lists inside paragraphs.

 Thanks again for your help with this.

 All the best,
 Tom

 Latex does have the concept of lists within paragraphs in that
 paragraph boundaries are defined by blank lines.  So, if you have a
 begin{itemize}...end{itemize} with no blank lines before and after, the
 list implicitly is part of the enclosing paragraph.

 whether lists exported from org should automatically be within
 paragraphs or not is unclear.  I personally prefer having them outside
 but that's because, in latex, I tend to have 0 paragraph separation with
 indented first lines.  If I want a list to look like it's embedded
 within a paragraph, I put a \nonindent on the paragraph following the
 list.

Hi Eric,

I'm thinking of enumerated lists inside paragraphs, of the kind (i)
found frequently in print, and (ii) made possible in LaTeX with the
paralist package's =inpara= commands.  Here the list can either end
the paragraph, or not.  If Org-mode's lists are going to serve this
purpose, then there will need to be some way to indicate that the list
is to be part of the paragraph.  

LaTeX uses blank lines (which is how I typically get paragraph breaks in
Org-mode, though perhaps this isn't the only way to do so?) and a year
or so ago the presence/absence of a blank line following an Org-mode
list was used to trigger whether or not the following text would be set
as a continuation of the paragraph or set as a new paragraph.  A blank
line feels natural to me because I've written in LaTeX for a long time,
but I'd be happy with some other solution if the blank line turns out to
be too difficult to maintain in the Org-mode code.

IIUC, you are describing the case where a displayed (not set within a
paragraph) list is followed immediately by flush left text.  I agree
that it is useful to be able to do this, but it wasn't what I had in
mind.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] LaTeX export of lists

2011-08-24 Thread Thomas S. Dye
Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 Latex does have the concept of lists within paragraphs in that
 paragraph boundaries are defined by blank lines.  So, if you have a
 begin{itemize}...end{itemize} with no blank lines before and after, the
 list implicitly is part of the enclosing paragraph.

 That's why I talked about LaTeXism.

 whether lists exported from org should automatically be within
 paragraphs or not is unclear.

 For the record:

 From Org view, lists and paragraphs are distinct elements. More
 accurately, lists can hold paragraphs, but not the opposite.

 From LaTeX view, it's true that a list can belong to a paragraph. But,
 again, such a thing is impossible in HTML, in OpenDocument, where the
 list is a paragraph-level element[1], and in DocBook.

 So this is consistent with most of the exporters encountered in
 Org. Now, to provide compatibility with LaTeX, Org export system has to
 respect blank lines (or the absence thereof) in the buffer.

Aloha Nicolas,

I've just browsed the Document Structure chapter of the Org-mode manual:
paragraphs aren't mentioned!  

I've always indicated paragraph breaks in Org-mode with a blank line,
but I realize that this might just be a holdover from my long use of
LaTeX.  Are there other ways to indicate a paragraph break in Org-mode?

As for lists within paragraphs being a Latexism, I would say that the
other specs you cite appear to lack a structured way to accomplish
something that is, in fact, quite common in printed text.  There is
nothing wrong with leaving a common print structure like this
unstructured, but I find it very convenient to use a structured
approach, as provided by the paralist package in LaTeX.

I'm not trying to be pedantic here and hold out for the presence or
absence of blank lines to indicate a paragraph break in Org-mode.  For
the use case of lists set within a paragraph some other mechanism might
be more appropriate.

But this circles back to the more general question of how paragraphs are
indicated in Org-mode.  Is it the blank line alone, or the blank line and
other mechanisms?

All the best,
Tom


 Regards,

 [1] 
 http://docs.oasis-open.org/office/v1.1/OS/OpenDocument-v1.1-html/OpenDocument-v1.1.html#4.3.Lists|outline

-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



Re: [O] LaTeX export of lists

2011-08-24 Thread Nicolas Goaziou
t...@tsdye.com (Thomas S. Dye) writes:

 I've just browsed the Document Structure chapter of the Org-mode manual:
 paragraphs aren't mentioned!

They are in 11.1 Structural markup elements

 I'm not trying to be pedantic here and hold out for the presence or
 absence of blank lines to indicate a paragraph break in Org-mode.  For
 the use case of lists set within a paragraph some other mechanism might
 be more appropriate.

I would suggest #+begin_latex #+end_latex for such specific needs
(paralist).

 But this circles back to the more general question of how paragraphs are
 indicated in Org-mode.  Is it the blank line alone, or the blank line and
 other mechanisms?

There is no strict definition of a paragraph in Org core, yet. That's
why every exporter comes out with its own.

Though, a blank line is definitely seen as a paragraph break, as any
paragraph starter. So, what are these paragraph starters? Here are some:
  - any line starting with #+, maybe indented. That includes keywords,
blocks, comments...
  - fixed-width lines
  - items
  - headlines.

Now, defining a paragraph in Org wouldn't necessary be a bad thing for
exporters. This would just add information they could deliberately throw
away. That's why, again, keeping the exact number of blank lines is
important (for when they will throw the information away).

Regards,

-- 
Nicolas Goaziou



Re: [O] LaTeX export of lists

2011-08-24 Thread Thomas S. Dye
Nicolas Goaziou n.goaz...@gmail.com writes:

 t...@tsdye.com (Thomas S. Dye) writes:

 I've just browsed the Document Structure chapter of the Org-mode manual:
 paragraphs aren't mentioned!

 They are in 11.1 Structural markup elements


Yes, somewhat incongruously.  To my mind, the markup elements are blank
lines and \\, not paragraphs.

 I'm not trying to be pedantic here and hold out for the presence or
 absence of blank lines to indicate a paragraph break in Org-mode.  For
 the use case of lists set within a paragraph some other mechanism might
 be more appropriate.


 I would suggest #+begin_latex #+end_latex for such specific needs
 (paralist).


Yes, but this solution misses the great pleasure and convenience of
working with Org-mode lists.  It is something I can live with if it
proves impractical to keep the current configuration, however.

 But this circles back to the more general question of how paragraphs are
 indicated in Org-mode.  Is it the blank line alone, or the blank line and
 other mechanisms?

 There is no strict definition of a paragraph in Org core, yet. That's
 why every exporter comes out with its own.

 Though, a blank line is definitely seen as a paragraph break, as any
 paragraph starter. So, what are these paragraph starters? Here are some:
   - any line starting with #+, maybe indented. That includes keywords,
 blocks, comments...
   - fixed-width lines
   - items
   - headlines.

 Now, defining a paragraph in Org wouldn't necessary be a bad thing for
 exporters. This would just add information they could deliberately throw
 away. That's why, again, keeping the exact number of blank lines is
 important (for when they will throw the information away).


Thanks very much for this, to me, clear explanation of the issue.  I'm
convinced that I've been able to make my points understood and will
happily use the Org-mode that you and others are so kind to develop,
with or without the ability to set Org-mode lists within paragraphs via
LaTeX.

All the best,
Tom

 Regards,

-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



Re: [O] LaTeX Export Packages

2011-07-30 Thread Scott Randby
On 07/29/2011 04:59 PM, Ista Zahn wrote:
 Hi Scott,
 Untested, but I think you can use
 #+LATEX_HEADER: \hypersetup{colorlinks=true,urlcolor=blue,linkcolor=blue}

That worked. Thanks.

Scott

 
 Best,
 Ista
 
 On Fri, Jul 29, 2011 at 4:55 PM, Scott Randby sran...@gmail.com wrote:
 The package hyperref is one of the default packages listed in
 org-export-latex-default-packages-alist. I want to add some options to
 this package for some files but not for others.

 I have tried adding the following to my file:

 #+LATEX_HEADER:
 \usepackage[colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref}

 When I export, I get an error because hyperref appears twice in the TEX
 file.

 1. I don't want to edit the exported LaTeX file to add the hyperref
 options.

 2. I don't want to customize org-export-latex-default-packages-alist to
 include the options for hyperref because I don't always want those options.

 3. I don't want to delete hyperref from
 org-export-latex-default-packages-alist because I might forget to add it
 in some file that will be exported to LaTeX.

 4. I'd rather not customize my .emacs because the options I want for
 hyperref vary from file to file.

 I would like some way to add options in an org-mode file to the packages
 that appear in org-export-latex-default-packages-alist. Maybe something
 similar to #+LaTeX_CLASS_OPTIONS: will be possible. But this doesn't
 look easy to me. Should I learn how to do publishing?

 Scott Randby


 
 
 



[O] LaTeX Export Packages

2011-07-29 Thread Scott Randby
The package hyperref is one of the default packages listed in
org-export-latex-default-packages-alist. I want to add some options to
this package for some files but not for others.

I have tried adding the following to my file:

#+LATEX_HEADER:
\usepackage[colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref}

When I export, I get an error because hyperref appears twice in the TEX
file.

1. I don't want to edit the exported LaTeX file to add the hyperref
options.

2. I don't want to customize org-export-latex-default-packages-alist to
include the options for hyperref because I don't always want those options.

3. I don't want to delete hyperref from
org-export-latex-default-packages-alist because I might forget to add it
in some file that will be exported to LaTeX.

4. I'd rather not customize my .emacs because the options I want for
hyperref vary from file to file.

I would like some way to add options in an org-mode file to the packages
that appear in org-export-latex-default-packages-alist. Maybe something
similar to #+LaTeX_CLASS_OPTIONS: will be possible. But this doesn't
look easy to me. Should I learn how to do publishing?

Scott Randby



Re: [O] LaTeX Export Packages

2011-07-29 Thread Ista Zahn
Hi Scott,
Untested, but I think you can use
#+LATEX_HEADER: \hypersetup{colorlinks=true,urlcolor=blue,linkcolor=blue}

Best,
Ista

On Fri, Jul 29, 2011 at 4:55 PM, Scott Randby sran...@gmail.com wrote:
 The package hyperref is one of the default packages listed in
 org-export-latex-default-packages-alist. I want to add some options to
 this package for some files but not for others.

 I have tried adding the following to my file:

 #+LATEX_HEADER:
 \usepackage[colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref}

 When I export, I get an error because hyperref appears twice in the TEX
 file.

 1. I don't want to edit the exported LaTeX file to add the hyperref
 options.

 2. I don't want to customize org-export-latex-default-packages-alist to
 include the options for hyperref because I don't always want those options.

 3. I don't want to delete hyperref from
 org-export-latex-default-packages-alist because I might forget to add it
 in some file that will be exported to LaTeX.

 4. I'd rather not customize my .emacs because the options I want for
 hyperref vary from file to file.

 I would like some way to add options in an org-mode file to the packages
 that appear in org-export-latex-default-packages-alist. Maybe something
 similar to #+LaTeX_CLASS_OPTIONS: will be possible. But this doesn't
 look easy to me. Should I learn how to do publishing?

 Scott Randby





-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org



Re: [O] LaTeX export of lists

2011-07-25 Thread Nicolas Goaziou
Hello,

t...@tsdye.com (Thomas S. Dye) writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:
 That raises an interesting question: can a list belong to a paragraph in
 Org? According to paragraph-related regexps, it can't, for now. And your
 request is more a LaTeXism than an Orgism (!).

 I probably don't understand your question fully, but it seems obvious to
 me that a list can either belong to a paragraph or it can be separate.
 I'm not certain why Org-mode would want to choose one over the other.

It isn't obvious. For example, in HTML, a list within a paragraph
doesn't even make sense[1].

There's no harm in it, but you're basically faking Org and its LaTeX
exporter, as lists and paragraphs are two distinct entities[2].

Regards,


Footnotes:

[1] You can't have ul within p, according to
http://www.w3.org/TR/html401/struct/text.html#h-9.3.1

[2] If you try to `mark-paragraph' in your file, it won't mark both
the text and the list in one go.


-- 
Nicolas Goaziou



Re: [O] LaTeX export of lists

2011-07-25 Thread Thomas S. Dye
Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 t...@tsdye.com (Thomas S. Dye) writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:
 That raises an interesting question: can a list belong to a paragraph in
 Org? According to paragraph-related regexps, it can't, for now. And your
 request is more a LaTeXism than an Orgism (!).

 I probably don't understand your question fully, but it seems obvious to
 me that a list can either belong to a paragraph or it can be separate.
 I'm not certain why Org-mode would want to choose one over the other.

 It isn't obvious. For example, in HTML, a list within a paragraph
 doesn't even make sense[1].

 There's no harm in it, but you're basically faking Org and its LaTeX
 exporter, as lists and paragraphs are two distinct entities[2].

 Regards,


 Footnotes:

 [1] You can't have ul within p, according to
 http://www.w3.org/TR/html401/struct/text.html#h-9.3.1

 [2] If you try to `mark-paragraph' in your file, it won't mark both
 the text and the list in one go.

Aloha Nicolas,

Interesting observations.  Thanks.

The relation seems obvious to me because my model comes from printed
works, which commonly include enumerated lists typeset within
paragraphs.  

Perhaps given the limitation of the HTML spec and the structure of
paragraphs in Org-mode it will always be necessary to have the LaTeX
exporter take care of setting lists inside paragraphs.

Thanks again for your help with this.

All the best,
Tom

-- 
T.S. Dye  Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



[O] LaTeX export of lists

2011-07-24 Thread Thomas S. Dye
Aloha all,

LaTeX export of lists appears to be inserting an extraneous blank line.

This snippet from the Org-mode document:

first-order cultural history sequence for Hawai`i can be expressed
with model (\ref{eq:first-order}), which states that 
   1. the pre-colonization period began at a time too old for the
  \rc\space method to date;

is exported to LaTeX as:

first-order cultural history sequence for Hawai`i can be expressed
with model \ref{eq:first-order}, which states that 

\begin{enumerate}
\item the pre-colonization period began at a time too old for the
  \rc\  method to date;

The blank line before \begin{enumerate} is interpreted by LaTeX as a
paragraph break, which I don't want here because I'm setting the
enumerated list within the paragraph and not displayed separately.

IIRC, this represents an old behavior that was corrected a while back.
I'm not sure when the blank line snuck back in.

I'm using Org-mode version 7.6 (release_7.6.102.g05c6).

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] LaTeX export of lists

2011-07-24 Thread Nick Dokos
Thomas S. Dye t...@tsdye.com wrote:

 Aloha all,
 
 LaTeX export of lists appears to be inserting an extraneous blank line.
 
 This snippet from the Org-mode document:
 
 first-order cultural history sequence for Hawai`i can be expressed
 with model (\ref{eq:first-order}), which states that 
1. the pre-colonization period began at a time too old for the
   \rc\space method to date;
 
 is exported to LaTeX as:
 
 first-order cultural history sequence for Hawai`i can be expressed
 with model \ref{eq:first-order}, which states that 
 
 \begin{enumerate}
 \item the pre-colonization period began at a time too old for the
   \rc\  method to date;
 
 The blank line before \begin{enumerate} is interpreted by LaTeX as a
 paragraph break, which I don't want here because I'm setting the
 enumerated list within the paragraph and not displayed separately.
 
 IIRC, this represents an old behavior that was corrected a while back.
 I'm not sure when the blank line snuck back in.
 
 I'm using Org-mode version 7.6 (release_7.6.102.g05c6).
 
 All the best,
 Tom
 

Bisected it to this commit:

,
| 69e02a73de7423bafa4df473cb746865c305b7ae is the first bad commit
| commit 69e02a73de7423bafa4df473cb746865c305b7ae
| Author: Nicolas Goaziou n.goaz...@gmail.com
| Date:   Sun Jan 2 13:52:16 2011 +0100
| 
| Modified export engines for lists
| 
| * lisp/org-exp.el (org-export-mark-lists): new function, replacing
|   org-export-mark-list-ending. It adds information as text properties
|   to every list, before changes done by exporter destruct them.
| 
| * lisp/org-html.el (org-export-as-html): delegate list handling to
|   external function org-html-export-list-line.
| (org-html-export-list-line): new function.
| 
| * lisp/org-latex.el (org-export-latex-lists): small modification.
| 
| :04 04 5c6d7691e72af31680c5560171cc46bea56112ea 
4de9fe5e7c954b31ab23a9e84ba28fa818c368c8 Mlisp
`

Nick



<    1   2   3   4   5   >