emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org-babel and LaTeX letter
@ 2011-09-05 12:01 Ben Alexander
  2011-09-06 15:17 ` Eric Schulte
       [not found] ` <m1ipp5iuom.fsf@tsdye.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Ben Alexander @ 2011-09-05 12:01 UTC (permalink / raw)
  To: emacs-orgmode

Hello orgmode and latex users!

I'm trying to use a latex to write a letter, and I'm using an org  
babel block to hold the original source.  I've whittled down my latex  
code to one word and it still isn't working for me.  I've included the  
code block and the pdflatex output buffer.  I notice that the default  
style is 'article'.  Is there some way to remove the article style and  
use a letter instead?

The funny thing is, if I run pdflatex from the command line, it works  
fine.  Though it doesn't have as many lines of diagnostic output.  I  
think the wrapping code for babel execution of latex code is the  
issue.  I'd be happy to install more tex files. I use MacPorts to  
maintain my system; perhaps I am missing a tex package that is needed?

Any pointers would be helpful.

-Ben

ORG file
***** trial of latex
#+begin_src latex :file letter.pdf
Hello
#+end_src

BUFFER *Org PDF LaTeX Output* shows the following (first and last few  
lines only)

This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/MacPorts  
2011_1)
  restricted \write18 enabled.
entering extended mode

(/var/folders/pC/pCO-RjsoEHGUcvQ-+Z3F2U+++TI/-Tmp-/babel-58334TCg/ 
latex-58334gM
m.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang,  
nohyphenation, lo
aded.
(/opt/local/share/texmf-texlive-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class

.....lines of output omitted......

! LaTeX Error: File `wrapfig.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name:
! Emergency stop.
<read *>

l.13 \usepackage
                 {soul}^^M
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on /var/folders/pC/pCO-RjsoEHGUcvQ-+Z3F2U+++TI/- 
Tmp-/babel-5
8334TCg//latex-58334gMm.log.

Xander$ port list installed and texlive*
texlive-basic                  @23152          tex/texlive-basic
texlive-basic                  @23152          tex/texlive-basic
texlive-bin                    @2011           tex/texlive-bin
texlive-bin                    @2011           tex/texlive-bin
texlive-common                 @2011           tex/texlive-common
texlive-common                 @2011           tex/texlive-common
texlive-documentation-base     @23160          tex/texlive- 
documentation-base
texlive-documentation-base     @23160          tex/texlive- 
documentation-base
texlive-generic-recommended    @23088          tex/texlive-generic- 
recommended
texlive-generic-recommended    @23088          tex/texlive-generic- 
recommended
texlive-latex                  @23089          tex/texlive-latex
texlive-latex                  @23089          tex/texlive-latex
texlive-latex-recommended      @23089          tex/texlive-latex- 
recommended
texlive-latex3                 @19447          tex/texlive-latex3
texlive-xetex                  @23080          tex/texlive-xetex

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Org-babel and LaTeX letter
  2011-09-05 12:01 Org-babel and LaTeX letter Ben Alexander
@ 2011-09-06 15:17 ` Eric Schulte
       [not found] ` <m1ipp5iuom.fsf@tsdye.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Schulte @ 2011-09-06 15:17 UTC (permalink / raw)
  To: Ben Alexander; +Cc: emacs-orgmode

Hi Ben,

It looks to me like you need to install the wrapfig.sty LaTeX file
locally.  I'm not sure how this would be done on OSX, but as a quick
test you could just find a copy of wrapfig.sty online and copy it to the
directory holding your .org file.

Best -- Eric

Ben Alexander <bva@alexanderonline.org> writes:

> Hello orgmode and latex users!
>
> I'm trying to use a latex to write a letter, and I'm using an org  
> babel block to hold the original source.  I've whittled down my latex  
> code to one word and it still isn't working for me.  I've included the  
> code block and the pdflatex output buffer.  I notice that the default  
> style is 'article'.  Is there some way to remove the article style and  
> use a letter instead?
>
> The funny thing is, if I run pdflatex from the command line, it works  
> fine.  Though it doesn't have as many lines of diagnostic output.  I  
> think the wrapping code for babel execution of latex code is the  
> issue.  I'd be happy to install more tex files. I use MacPorts to  
> maintain my system; perhaps I am missing a tex package that is needed?
>
> Any pointers would be helpful.
>
> -Ben
>
> ORG file
> ***** trial of latex
> #+begin_src latex :file letter.pdf
> Hello
> #+end_src
>
> BUFFER *Org PDF LaTeX Output* shows the following (first and last few  
> lines only)
>
> This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/MacPorts  
> 2011_1)
>   restricted \write18 enabled.
> entering extended mode
>
> (/var/folders/pC/pCO-RjsoEHGUcvQ-+Z3F2U+++TI/-Tmp-/babel-58334TCg/ 
> latex-58334gM
> m.tex
> LaTeX2e <2009/09/24>
> Babel <v3.8l> and hyphenation patterns for english, dumylang,  
> nohyphenation, lo
> aded.
> (/opt/local/share/texmf-texlive-dist/tex/latex/base/article.cls
> Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
>
> .....lines of output omitted......
>
> ! LaTeX Error: File `wrapfig.sty' not found.
>
> Type X to quit or <RETURN> to proceed,
> or enter new name. (Default extension: sty)
>
> Enter file name:
> ! Emergency stop.
> <read *>
>
> l.13 \usepackage
>                  {soul}^^M
> !  ==> Fatal error occurred, no output PDF file produced!
> Transcript written on /var/folders/pC/pCO-RjsoEHGUcvQ-+Z3F2U+++TI/- 
> Tmp-/babel-5
> 8334TCg//latex-58334gMm.log.
>
> Xander$ port list installed and texlive*
> texlive-basic                  @23152          tex/texlive-basic
> texlive-basic                  @23152          tex/texlive-basic
> texlive-bin                    @2011           tex/texlive-bin
> texlive-bin                    @2011           tex/texlive-bin
> texlive-common                 @2011           tex/texlive-common
> texlive-common                 @2011           tex/texlive-common
> texlive-documentation-base     @23160          tex/texlive- 
> documentation-base
> texlive-documentation-base     @23160          tex/texlive- 
> documentation-base
> texlive-generic-recommended    @23088          tex/texlive-generic- 
> recommended
> texlive-generic-recommended    @23088          tex/texlive-generic- 
> recommended
> texlive-latex                  @23089          tex/texlive-latex
> texlive-latex                  @23089          tex/texlive-latex
> texlive-latex-recommended      @23089          tex/texlive-latex- 
> recommended
> texlive-latex3                 @19447          tex/texlive-latex3
> texlive-xetex                  @23080          tex/texlive-xetex
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Org-babel and LaTeX letter
       [not found] ` <m1ipp5iuom.fsf@tsdye.com>
@ 2011-09-07  9:11   ` Ben Alexander
  2011-09-07 15:36     ` Eric S Fraga
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Alexander @ 2011-09-07  9:11 UTC (permalink / raw)
  To: Thomas S. Dye, Eric Schulte; +Cc: org-mode Mailinglist

Thanks Thomas and Eric for responses!

I wasn't trying to export at first.  I think of export as a 'whole org- 
document' kind of thing, and I wanted to just have one TODO task  
(write a snail mail letter) completed without having to store a  
separate file for it.  But I read the docs on export, and I can easily  
select a headline and then export just the current region.  After  
updating the export class variable (I always use customize, as I am  
not that good at emacs lisp) it almost worked.

My problem was that I did not have enough of the MacPorts texlive-*  
packages installed. I needed texlive-fonts-recommended and texlive- 
latex-extra (if anyone else cares).  Googling for the broken  
\usepackage{} and texlive macports gave me a list of of what each  
package has.  I don't know if I've got enough for any latex+org usage,  
but it finally spit out my letter.  Good enough for today - I can  
avoid using a separate file for a paragraph.

This isn't perfect though.  I still have a spurious few lines in my  
tex file:

: \maketitle
: Some descriptive text to be emitted.  Several lines OK.

I've no idea where that comes from.  Anybody have any ideas?  For now,  
I edit the tex file before processing further, and it's good enough  
for today.

Now perhaps is a good time to ask what the different workflows are for  
export, publish, babel and tangle.  They seem to have overlapping  
functionality.  My basic concept is:

export : Your complete (or partial) org file in another form, like  
paper or on the web.  For when emacs isn't around and you don't want  
to forget what your orgmode file says, or for giving a copy of the  
data in your org file to someone who doesn't appreciate emacs. # 
+begin_latex blocks belong to this export.

publish : export more than one org file.  I've no idea what use case  
makes publish different than export.

babel : use for including chunks of code in an org file.  Base use  
case simply allows you to easily edit them in a native emacs mode  
while still having them organized into your run-of-the-mill org file.   
Also allows code blocks to be printed more nicely (in color? with line  
numbers?) which doesn't happen in 'export' Secondary use case allows  
you to execute the code blocks #+begin_src and #+results: blocks  
belong to babel.  I plan on using ledger in babel blocks to store my  
often executed queries, even though most of the 'code' is on the  
command line.

tangle : use case - lets you have lots of code blocks organized in an  
orgmode file become a complete, compilable program.  Normally the  
orgmode syntax would cause a complier to choke, so tangle removes the  
orgmode structure.  Added bonus: lets different programs co-operate in  
a single orgmode file.  Like a makefile on steroids? #+begin_src  
blocks can belong to tangle, too. n

While the orgmode documentation does a great job of explaining how to  
configure the details of each process, I feel like I'm missing the  
'how do I pick the feature that solves the problem I have right now'  
part.  Probably because each feature is flexible enough to be used in  
overlapping ways.

But as always, I'm grateful for the orgmode, the wonderful  
documentation, the customize-able options, and the great help I get  
when I turn to the mailing list.  You all rock!

-Ben



On 2011-Sep-06, at 17:58, Thomas S. Dye wrote:

> Aloha Ben,
>
> I'm not sure I understand what you are doing here, so please excuse me
> if I'm offering misplaced advice.
>
> Ben Alexander <bva@alexanderonline.org> writes:
>
>> Hello orgmode and latex users!
>>
>> I'm trying to use a latex to write a letter, and I'm using an org
>> babel block to hold the original source.
>
> There are (at least) two ways to create a tex file from Org-mode: 1)
> export the Org-mode buffer, and 2) tangle latex code blocks.  IIUC,  
> you
> appear to be setting up code blocks for tangling, but then are using  
> the
> export facilities.
>
> See http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-4
> for instructions on how to change the Org-mode export class.
>


>>
>> The funny thing is, if I run pdflatex from the command line, it works
>> fine.  Though it doesn't have as many lines of diagnostic output.  I
>> think the wrapping code for babel execution of latex code is the
>> issue.  I'd be happy to install more tex files. I use MacPorts to
>> maintain my system; perhaps I am missing a tex package that is  
>> needed?
>>
>
> I don't know about the macports distribution of LaTeX, but it seems  
> odd
> to me that latex works fine from the command line but then can't find
> wrapfig.sty when it is called from Org-mode.  Perhaps the place to  
> start
> debugging this is the variable org-latex-to-pdf-process, see
> http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-8.
>
> hth,
> Tom
>
>> Any pointers would be helpful.
>>
>> -Ben
>>
>> ORG file
>> ***** trial of latex
>> #+begin_src latex :file letter.pdf
>> Hello
>> #+end_src
>>
>> BUFFER *Org PDF LaTeX Output* shows the following (first and last few
>> lines only)
>>
>> This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/MacPorts
>> 2011_1)
>> restricted \write18 enabled.
>> entering extended mode
>>
>> (/var/folders/pC/pCO-RjsoEHGUcvQ-+Z3F2U+++TI/-Tmp-/babel-58334TCg/
>> latex-58334gM
>> m.tex
>> LaTeX2e <2009/09/24>
>> Babel <v3.8l> and hyphenation patterns for english, dumylang,
>> nohyphenation, lo
>> aded.
>> (/opt/local/share/texmf-texlive-dist/tex/latex/base/article.cls
>> Document Class: article 2007/10/19 v1.4h Standard LaTeX document  
>> class
>>
>> .....lines of output omitted......
>>
>> ! LaTeX Error: File `wrapfig.sty' not found.
>>
>> Type X to quit or <RETURN> to proceed,
>> or enter new name. (Default extension: sty)
>>
>> Enter file name:
>> ! Emergency stop.
>> <read *>
>>
>> l.13 \usepackage
>>                {soul}^^M
>> !  ==> Fatal error occurred, no output PDF file produced!
>> Transcript written on /var/folders/pC/pCO-RjsoEHGUcvQ-+Z3F2U+++TI/-
>> Tmp-/babel-5
>> 8334TCg//latex-58334gMm.log.
>>
>> Xander$ port list installed and texlive*
>> texlive-basic                  @23152          tex/texlive-basic
>> texlive-basic                  @23152          tex/texlive-basic
>> texlive-bin                    @2011           tex/texlive-bin
>> texlive-bin                    @2011           tex/texlive-bin
>> texlive-common                 @2011           tex/texlive-common
>> texlive-common                 @2011           tex/texlive-common
>> texlive-documentation-base     @23160          tex/texlive-
>> documentation-base
>> texlive-documentation-base     @23160          tex/texlive-
>> documentation-base
>> texlive-generic-recommended    @23088          tex/texlive-generic-
>> recommended
>> texlive-generic-recommended    @23088          tex/texlive-generic-
>> recommended
>> texlive-latex                  @23089          tex/texlive-latex
>> texlive-latex                  @23089          tex/texlive-latex
>> texlive-latex-recommended      @23089          tex/texlive-latex-
>> recommended
>> texlive-latex3                 @19447          tex/texlive-latex3
>> texlive-xetex                  @23080          tex/texlive-xetex
>>
>>
>>
>
> -- 
> Thomas S. Dye
> http://www.tsdye.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Org-babel and LaTeX letter
  2011-09-07  9:11   ` Ben Alexander
@ 2011-09-07 15:36     ` Eric S Fraga
  0 siblings, 0 replies; 4+ messages in thread
From: Eric S Fraga @ 2011-09-07 15:36 UTC (permalink / raw)
  To: Ben Alexander; +Cc: org-mode Mailinglist

Ben Alexander <bva@alexanderonline.org> writes:

[...]

> Now perhaps is a good time to ask what the different workflows are for
> export, publish, babel and tangle.  They seem to have overlapping
> functionality.  My basic concept is:
>
> export : Your complete (or partial) org file in another form, like
> paper or on the web.  For when emacs isn't around and you don't want
> to forget what your orgmode file says, or for giving a copy of the
> data in your org file to someone who doesn't appreciate
> emacs. #+begin_latex blocks belong to this export.

I agree.

> publish : export more than one org file.  I've no idea what use case
> makes publish different than export.

Example: a web site.  The nice thing about publish is it only converts
those files which have changed (at least in my setup but that setup was
defined a while ago now so I cannot remember if that's the default).

> babel : use for including chunks of code in an org file.  Base use
> case simply allows you to easily edit them in a native emacs mode
> while still having them organized into your run-of-the-mill org file.
> Also allows code blocks to be printed more nicely (in color? with line
> numbers?) which doesn't happen in 'export' Secondary use case allows
> you to execute the code blocks #+begin_src and #+results: blocks
> belong to babel.  I plan on using ledger in babel blocks to store my
> often executed queries, even though most of the 'code' is on the
> command line.

Well, I would suggest that your "secondary" use case is actually the
primary use case?  And especially so when combined with the ability to
use inputs from org tables or to chain blocks so that results of one are
inputs to another.

> tangle : use case - lets you have lots of code blocks organized in an
> orgmode file become a complete, compilable program.  Normally the
> orgmode syntax would cause a complier to choke, so tangle removes the
> orgmode structure.  Added bonus: lets different programs co-operate in
> a single orgmode file.  Like a makefile on steroids? #+begin_src
> blocks can belong to tangle, too. 

Your first use case for *babel* above fits in here.  More to the point,
you can write truly descriptive text related to the program (including,
for instance, equations, diagrams, etc.) without the restrictions
imposed by normal commenting rules in the particular language(s) used.

> While the orgmode documentation does a great job of explaining how to
> configure the details of each process, I feel like I'm missing the
> how do I pick the feature that solves the problem I have right now'
> part.  Probably because each feature is flexible enough to be used in
> overlapping ways.

Yes, indeed!

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-07 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-05 12:01 Org-babel and LaTeX letter Ben Alexander
2011-09-06 15:17 ` Eric Schulte
     [not found] ` <m1ipp5iuom.fsf@tsdye.com>
2011-09-07  9:11   ` Ben Alexander
2011-09-07 15:36     ` Eric S Fraga

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).