Re: [O] Bug in latex export tutorial on worg ?

2011-05-10 Thread Robert Goldman
On 5/10/11 May 10 -12:25 AM, Thomas S. Dye wrote:
 Robert Goldman rpgold...@sift.info writes:
 
 On 5/9/11 May 9 -11:22 PM, Nick Dokos wrote:
 Robert Goldman rpgold...@sift.info wrote:

 On 5/9/11 May 9 -9:54 PM, Nick Dokos wrote:
 Robert Goldman rpgold...@sift.info wrote:

 There is the following code block there:

 #+begin_src emacs-lisp :results silent
   (add-to-list 'org-export-latex-classes
   '(per-file-class
  \\documentclass{scrartcl}
  [NO-DEFAULT-PACKAGES]
  [EXTRA]
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s})))
 #+end_src

 Is this still correct?  Or should this be :exports none instead of
 :results silent?


 ``:results silent'' works for me and keeps the result from appearing in
 the org buffer. I don't think :exports can do that - it can only affect
 what's exported.

 Nick

 I must be doing something wrong then --- I had the :results silent and
 found the source block in verbatim in my latex export file  Changing
 to :exports none made that go away for me.  Maybe that was a
 coincidence.  I will have to investigate further, I guess.


 No, you are not doing anything wrong: the default :exports value is
 code, so the code ends up in your export. ``:exports none'' keeps it
 (and any results) from being exported.

 OTOH, try evaluating (C-c C-c) the code block, with and without
 ``:results silent''. There is a behavior difference and *that* difference
 is not affected by how you set :exports.

 Nick

 Ah.  I get it now.  But then surely the above IS a bug -- presumably
 it's not usual for a person to wish their latex export configuration to
 appear, in verbatim block, in their org-generated latex document!

 Best,
 Robert



 
 Aloha Robert,
 
 I've added :exports none to the example, which came from a document
 about how to export LaTeX documents from Org-mode.  Thanks for pointing
 out that it could be used in a way that yields unexpected results.
 
 In my usual setup I put this kind of configuration in a heading of its
 own that is protected by a :noexport: tag.  This works for me because I
 often have notes about why things are in there and what I think they
 might be doing.

Great!  Thanks.  Your tutorial has been very helpful to me.  I needed to
figure out how to set up a special-purpose format for my document and in
a moment I had just the solution I needed.

I suppose one could do...

(unless (find per-file-class org-export-latex-classes :key 'car
   :test 'equal)
  (add-to-list 'org-export-latex-classes
  '(per-file-class
 \\documentclass{scrartcl}
 [NO-DEFAULT-PACKAGES]
 [EXTRA]
 (\\section{%s} . \\section*{%s})
 (\\subsection{%s} . \\subsection*{%s})
 (\\subsubsection{%s} . \\subsubsection*{%s})
 (\\paragraph{%s} . \\paragraph*{%s})
 (\\subparagraph{%s} . \\subparagraph*{%s}

since the add-to-list is a globally side-effecting action; it doesn't
need to be repeated on each export, right?  [I thought at first pushnew
could do the job, but now I don't think so.]

Best,
R



Re: [O] Bug in latex export tutorial on worg ?

2011-05-10 Thread Thomas S. Dye
Robert Goldman rpgold...@sift.info writes:

 On 5/10/11 May 10 -12:25 AM, Thomas S. Dye wrote:
 Robert Goldman rpgold...@sift.info writes:
 
 On 5/9/11 May 9 -11:22 PM, Nick Dokos wrote:
 Robert Goldman rpgold...@sift.info wrote:

 On 5/9/11 May 9 -9:54 PM, Nick Dokos wrote:
 Robert Goldman rpgold...@sift.info wrote:

 There is the following code block there:

 #+begin_src emacs-lisp :results silent
   (add-to-list 'org-export-latex-classes
   '(per-file-class
  \\documentclass{scrartcl}
  [NO-DEFAULT-PACKAGES]
  [EXTRA]
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s})))
 #+end_src

 Is this still correct?  Or should this be :exports none instead of
 :results silent?


 ``:results silent'' works for me and keeps the result from appearing in
 the org buffer. I don't think :exports can do that - it can only affect
 what's exported.

 Nick

 I must be doing something wrong then --- I had the :results silent and
 found the source block in verbatim in my latex export file  Changing
 to :exports none made that go away for me.  Maybe that was a
 coincidence.  I will have to investigate further, I guess.


 No, you are not doing anything wrong: the default :exports value is
 code, so the code ends up in your export. ``:exports none'' keeps it
 (and any results) from being exported.

 OTOH, try evaluating (C-c C-c) the code block, with and without
 ``:results silent''. There is a behavior difference and *that* difference
 is not affected by how you set :exports.

 Nick

 Ah.  I get it now.  But then surely the above IS a bug -- presumably
 it's not usual for a person to wish their latex export configuration to
 appear, in verbatim block, in their org-generated latex document!

 Best,
 Robert



 
 Aloha Robert,
 
 I've added :exports none to the example, which came from a document
 about how to export LaTeX documents from Org-mode.  Thanks for pointing
 out that it could be used in a way that yields unexpected results.
 
 In my usual setup I put this kind of configuration in a heading of its
 own that is protected by a :noexport: tag.  This works for me because I
 often have notes about why things are in there and what I think they
 might be doing.

 Great!  Thanks.  Your tutorial has been very helpful to me.  I needed to
 figure out how to set up a special-purpose format for my document and in
 a moment I had just the solution I needed.

 I suppose one could do...

 (unless (find per-file-class org-export-latex-classes :key 'car
:test 'equal)
   (add-to-list 'org-export-latex-classes
   '(per-file-class
  \\documentclass{scrartcl}
  [NO-DEFAULT-PACKAGES]
  [EXTRA]
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s}

 since the add-to-list is a globally side-effecting action; it doesn't
 need to be repeated on each export, right?  [I thought at first pushnew
 could do the job, but now I don't think so.]

 Best,
 R


Aloha Robert,

Many thanks for this improvement to the example code.  I've added it to
the tutorial (and to my own bits of setup code).

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



Re: [O] Bug in latex export tutorial on worg ?

2011-05-09 Thread Nick Dokos
Robert Goldman rpgold...@sift.info wrote:

 There is the following code block there:
 
 #+begin_src emacs-lisp :results silent
   (add-to-list 'org-export-latex-classes
   '(per-file-class
  \\documentclass{scrartcl}
  [NO-DEFAULT-PACKAGES]
  [EXTRA]
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s})))
 #+end_src
 
 Is this still correct?  Or should this be :exports none instead of
 :results silent?
 

``:results silent'' works for me and keeps the result from appearing in
the org buffer. I don't think :exports can do that - it can only affect
what's exported.

Nick



Re: [O] Bug in latex export tutorial on worg ?

2011-05-09 Thread Robert Goldman
On 5/9/11 May 9 -11:22 PM, Nick Dokos wrote:
 Robert Goldman rpgold...@sift.info wrote:
 
 On 5/9/11 May 9 -9:54 PM, Nick Dokos wrote:
 Robert Goldman rpgold...@sift.info wrote:

 There is the following code block there:

 #+begin_src emacs-lisp :results silent
   (add-to-list 'org-export-latex-classes
   '(per-file-class
  \\documentclass{scrartcl}
  [NO-DEFAULT-PACKAGES]
  [EXTRA]
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s})))
 #+end_src

 Is this still correct?  Or should this be :exports none instead of
 :results silent?


 ``:results silent'' works for me and keeps the result from appearing in
 the org buffer. I don't think :exports can do that - it can only affect
 what's exported.

 Nick

 I must be doing something wrong then --- I had the :results silent and
 found the source block in verbatim in my latex export file  Changing
 to :exports none made that go away for me.  Maybe that was a
 coincidence.  I will have to investigate further, I guess.

 
 No, you are not doing anything wrong: the default :exports value is
 code, so the code ends up in your export. ``:exports none'' keeps it
 (and any results) from being exported.
 
 OTOH, try evaluating (C-c C-c) the code block, with and without
 ``:results silent''. There is a behavior difference and *that* difference
 is not affected by how you set :exports.
 
 Nick

Ah.  I get it now.  But then surely the above IS a bug -- presumably
it's not usual for a person to wish their latex export configuration to
appear, in verbatim block, in their org-generated latex document!

Best,
Robert




Re: [O] Bug in latex export tutorial on worg ?

2011-05-09 Thread Nick Dokos
Robert Goldman rpgold...@sift.info wrote:

 Ah.  I get it now.  But then surely the above IS a bug -- presumably
 it's not usual for a person to wish their latex export configuration to
 appear, in verbatim block, in their org-generated latex document!
 

Perhaps not in most cases, but a tutorial has to do exactly that: how
else is it going to show the reader what needs to be done? Certainly
not by omitting the code that the reader is supposed to use.

Nick




Re: [O] Bug in latex export tutorial on worg ?

2011-05-09 Thread Thomas S. Dye
Robert Goldman rpgold...@sift.info writes:

 On 5/9/11 May 9 -11:22 PM, Nick Dokos wrote:
 Robert Goldman rpgold...@sift.info wrote:
 
 On 5/9/11 May 9 -9:54 PM, Nick Dokos wrote:
 Robert Goldman rpgold...@sift.info wrote:

 There is the following code block there:

 #+begin_src emacs-lisp :results silent
   (add-to-list 'org-export-latex-classes
   '(per-file-class
  \\documentclass{scrartcl}
  [NO-DEFAULT-PACKAGES]
  [EXTRA]
  (\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s})))
 #+end_src

 Is this still correct?  Or should this be :exports none instead of
 :results silent?


 ``:results silent'' works for me and keeps the result from appearing in
 the org buffer. I don't think :exports can do that - it can only affect
 what's exported.

 Nick

 I must be doing something wrong then --- I had the :results silent and
 found the source block in verbatim in my latex export file  Changing
 to :exports none made that go away for me.  Maybe that was a
 coincidence.  I will have to investigate further, I guess.

 
 No, you are not doing anything wrong: the default :exports value is
 code, so the code ends up in your export. ``:exports none'' keeps it
 (and any results) from being exported.
 
 OTOH, try evaluating (C-c C-c) the code block, with and without
 ``:results silent''. There is a behavior difference and *that* difference
 is not affected by how you set :exports.
 
 Nick

 Ah.  I get it now.  But then surely the above IS a bug -- presumably
 it's not usual for a person to wish their latex export configuration to
 appear, in verbatim block, in their org-generated latex document!

 Best,
 Robert




Aloha Robert,

I've added :exports none to the example, which came from a document
about how to export LaTeX documents from Org-mode.  Thanks for pointing
out that it could be used in a way that yields unexpected results.

In my usual setup I put this kind of configuration in a heading of its
own that is protected by a :noexport: tag.  This works for me because I
often have notes about why things are in there and what I think they
might be doing.

All the best,
Tom

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



Re: [O] Bug in latex export tutorial on worg ?

2011-05-09 Thread Nick Dokos
Nick Dokos nicholas.do...@hp.com wrote:

 Robert Goldman rpgold...@sift.info wrote:
 
  Ah.  I get it now.  But then surely the above IS a bug -- presumably
  it's not usual for a person to wish their latex export configuration to
  appear, in verbatim block, in their org-generated latex document!
  
 
 Perhaps not in most cases, but a tutorial has to do exactly that: how
 else is it going to show the reader what needs to be done? Certainly
 not by omitting the code that the reader is supposed to use.
 

After Tom's reply, I went and looked at the example and now I get it
too :-) Sorry for being dense before.

Nick



Re: [O] bug in latex export tutorial?

2011-04-30 Thread Eric S Fraga
Robert Goldman rpgold...@sift.info writes:

 On 4/29/11 Apr 29 -1:21 PM, Nick Dokos wrote:

[...]

 amsmath conflicts with wasysym (redefines \iint), so you have to
 redefine your headers to omit wasysym or include amsmath *first*: for
 some reason, if you \usepackage{amsmath} *before* you
 \usepackage{wasysym}, the error does not arise -- presumably, amsmath
 assumes that \iint is not defined beforehand, whereas wasysym does not
 make that assumption.

 The not-very-tasty solution I came up with was to put the following into
 the local variables list at the foot of my file:

 # org-export-latex-default-packages-alist: ((AUTO inputenc t) (T1
 fontenc t) ( fixltx2e nil) ( graphicx t) ( longtable nil)
 ( float nil) ( wrapfig nil) ( soul t) ( t1enc t) (
 textcomp t) ( marvosym t) ( amsmath t) ( wasysym t) (
 latexsym t) ( amssymb t)
 (colorlinks=true,pdfstartview=FitV,linkcolor=blue,citecolor=blue,urlcolor=blue
 hyperref nil) \\tolerance=1000)

 I put this in the file, rather than in my configuration, because it is
 specific to the formatting of this file, and because I share this
 document with others, who need to be able to export from it w/o having
 to reconfigure their org-mode installations.

 I figure that someone can probably suggest a solution that is nicer than
 that!

 Best,
 r

From earlier this year on the mailing list, below is a solution
which works if you more often than not want amsmath; i.e. it's not a
solution for the use case you specify in which you want to share a
single file etc.  However, it's worth repeating this solution for other
use cases.

--8---cut here---start-8---
;; to fix problems with amsmath conflicting with wasysym:
;;
;; From: Lawrence Mitchell we...@gmx.li
;; Subject: [Orgmode] Re: [bug] latex export ignores 
org-export-latex-default-packages-alist?
;; To: emacs-orgmode@gnu.org
;; Date: Wed, 26 Jan 2011 16:01:52 +
(add-to-list 'org-export-latex-packages-alist '( amsmath t))
(setcar (rassoc '(wasysym t) org-export-latex-default-packages-alist) 
integrals)
--8---cut here---end---8---

HTH,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.226.gc7ed6.dirty)



Re: [O] bug in latex export tutorial?

2011-04-29 Thread Thomas S. Dye

Aloha Robert,

Yep.  It should be One of these, amssymb, requires amsmath, which  
conflicts with several LaTeX fonts.


Thanks for pointing this out.

All the best,
Tom

On Apr 29, 2011, at 6:26 AM, Robert Goldman wrote:


The document http://orgmode.org/worg/org-tutorials/org-latex-export.html
claims

The Org-mode LaTeX exporter uses several packages to support special
characters used by org-entities. One of these, amsmath, conflicts with
several LaTeX fonts. If you want finer control over which packages are
loaded, then it makes sense to define an export class like this  
in .emacs:


But I just checked the results of exporting one of my org files, and  
it

does /not/ use amsmath.

Is this a bug in the tutorial?







Re: [O] bug in latex export tutorial?

2011-04-29 Thread Robert Goldman
On 4/29/11 Apr 29 -11:44 AM, Thomas S. Dye wrote:
 Aloha Robert,
 
 Yep.  It should be One of these, amssymb, requires amsmath, which
 conflicts with several LaTeX fonts.

I don't /believe/ amssymb requires amsmath.  I have been working on a
document where I wanted to use some of the stuff in amsmath (e.g.,
\text, align environment).  That document did /not/ parse, even though
amssymb *is* in the preamble of the exported file.  I looked, and the
preamble has amssymb, but not amsmath.

It would be *great* if someone could provide tutorial information that
would tell us:

1.  How do we configure a file so that it *can* use amsmath?
2.  What happens to the parallel HTML export if we use amsmath
constructs in an org file?

thanks!
r

 
 Thanks for pointing this out.
 
 All the best,
 Tom
 
 On Apr 29, 2011, at 6:26 AM, Robert Goldman wrote:
 
 The document http://orgmode.org/worg/org-tutorials/org-latex-export.html
 claims

 The Org-mode LaTeX exporter uses several packages to support special
 characters used by org-entities. One of these, amsmath, conflicts with
 several LaTeX fonts. If you want finer control over which packages are
 loaded, then it makes sense to define an export class like this in
 .emacs:

 But I just checked the results of exporting one of my org files, and it
 does /not/ use amsmath.

 Is this a bug in the tutorial?


 




Re: [O] bug in latex export tutorial?

2011-04-29 Thread Thomas S. Dye

Aloha Robert,

You're right again.  Sorry for the noise.  The amssymb package is the  
source of the font conflicts.


Thanks for pointing this out.

I don't use amsmath, so can't help with your queries.  When you've  
sorted them out, please consider adding the solution to the LaTeX  
export tutorial.


All the best,
Tom

On Apr 29, 2011, at 6:51 AM, Robert Goldman wrote:


On 4/29/11 Apr 29 -11:44 AM, Thomas S. Dye wrote:

Aloha Robert,

Yep.  It should be One of these, amssymb, requires amsmath, which
conflicts with several LaTeX fonts.


I don't /believe/ amssymb requires amsmath.  I have been working on a
document where I wanted to use some of the stuff in amsmath (e.g.,
\text, align environment).  That document did /not/ parse, even though
amssymb *is* in the preamble of the exported file.  I looked, and the
preamble has amssymb, but not amsmath.

It would be *great* if someone could provide tutorial information that
would tell us:

1.  How do we configure a file so that it *can* use amsmath?
2.  What happens to the parallel HTML export if we use amsmath
constructs in an org file?

thanks!
r



Thanks for pointing this out.

All the best,
Tom

On Apr 29, 2011, at 6:26 AM, Robert Goldman wrote:


The document http://orgmode.org/worg/org-tutorials/org-latex-export.html
claims

The Org-mode LaTeX exporter uses several packages to support  
special
characters used by org-entities. One of these, amsmath, conflicts  
with
several LaTeX fonts. If you want finer control over which packages  
are

loaded, then it makes sense to define an export class like this in
.emacs:

But I just checked the results of exporting one of my org files,  
and it

does /not/ use amsmath.

Is this a bug in the tutorial?










Re: [O] bug in latex export tutorial?

2011-04-29 Thread Nick Dokos
Robert Goldman rpgold...@sift.info wrote:

 On 4/29/11 Apr 29 -11:44 AM, Thomas S. Dye wrote:
  Aloha Robert,
  
  Yep.  It should be One of these, amssymb, requires amsmath, which
  conflicts with several LaTeX fonts.
 
 I don't /believe/ amssymb requires amsmath.  I have been working on a
 document where I wanted to use some of the stuff in amsmath (e.g.,
 \text, align environment).  That document did /not/ parse, even though
 amssymb *is* in the preamble of the exported file.  I looked, and the
 preamble has amssymb, but not amsmath.
 
 It would be *great* if someone could provide tutorial information that
 would tell us:
 
 1.  How do we configure a file so that it *can* use amsmath?

amsmath conflicts with wasysym (redefines \iint), so you have to
redefine your headers to omit wasysym or include amsmath *first*: for
some reason, if you \usepackage{amsmath} *before* you
\usepackage{wasysym}, the error does not arise -- presumably, amsmath
assumes that \iint is not defined beforehand, whereas wasysym does not
make that assumption.

 2.  What happens to the parallel HTML export if we use amsmath
 constructs in an org file?
 

It would depend on whether you use the dvipng mechanism or the mathjax mechanism
for math visualization. In the first case, amsmath is automatically included by
org mode (before wasysym, so no problems). In the second case, I wouldn't be 
able
to tell you: I've had problems with mathjax that I've wanted to investigate for 
ages
and never had the time - one of these centuries I'll get around to it...

Nick



Re: [O] bug in latex export tutorial?

2011-04-29 Thread Robert Goldman
On 4/29/11 Apr 29 -1:21 PM, Nick Dokos wrote:
 Robert Goldman rpgold...@sift.info wrote:
 
 On 4/29/11 Apr 29 -11:44 AM, Thomas S. Dye wrote:
 Aloha Robert,

 Yep.  It should be One of these, amssymb, requires amsmath, which
 conflicts with several LaTeX fonts.

 I don't /believe/ amssymb requires amsmath.  I have been working on a
 document where I wanted to use some of the stuff in amsmath (e.g.,
 \text, align environment).  That document did /not/ parse, even though
 amssymb *is* in the preamble of the exported file.  I looked, and the
 preamble has amssymb, but not amsmath.

 It would be *great* if someone could provide tutorial information that
 would tell us:

 1.  How do we configure a file so that it *can* use amsmath?
 
 amsmath conflicts with wasysym (redefines \iint), so you have to
 redefine your headers to omit wasysym or include amsmath *first*: for
 some reason, if you \usepackage{amsmath} *before* you
 \usepackage{wasysym}, the error does not arise -- presumably, amsmath
 assumes that \iint is not defined beforehand, whereas wasysym does not
 make that assumption.

The not-very-tasty solution I came up with was to put the following into
the local variables list at the foot of my file:

# org-export-latex-default-packages-alist: ((AUTO inputenc t) (T1
fontenc t) ( fixltx2e nil) ( graphicx t) ( longtable nil)
( float nil) ( wrapfig nil) ( soul t) ( t1enc t) (
textcomp t) ( marvosym t) ( amsmath t) ( wasysym t) (
latexsym t) ( amssymb t)
(colorlinks=true,pdfstartview=FitV,linkcolor=blue,citecolor=blue,urlcolor=blue
hyperref nil) \\tolerance=1000)

I put this in the file, rather than in my configuration, because it is
specific to the formatting of this file, and because I share this
document with others, who need to be able to export from it w/o having
to reconfigure their org-mode installations.

I figure that someone can probably suggest a solution that is nicer than
that!

Best,
r