From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: [Babel] Can't export to LaTeX anymore (args-out-of-range 0 0) Date: Tue, 21 Sep 2010 22:54:21 +0200 Message-ID: <87eicmhl6q.fsf@mundaneum.com> References: <87tyltj2tq.fsf@mundaneum.com> <87y6b04fyn.fsf@gmail.com> <87wrqkl7pw.fsf@mundaneum.com> <87ocbw48e2.fsf@gmail.com> <87k4mgoykv.fsf@mundaneum.com> <87hbhj9ihj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Eric, "Eric Schulte" wrote: > S=C3=A9bastien Vauban writes: >> "Eric Schulte" wrote: >>> [...] >>> #+srcname: subject >>> #+begin_src org :results org replace :noweb yes >>> Composing letters using *Org mode* and the LaTeX isodoc class >>> >>> <> >>> #+end_src >> >> Question: =3D:results org replace=3D (instead of =3D:results org=3D) is = necessary >> if we wanna see the results expanded in the Org buffer, on key =3DC-c C-v >> C-e=3D. Why? > > by default org mode blocks do not insert their results, this was due to > their initial use to wrap results of code blocks. This can be changed in > your personal configuration by customizing the value of the > `org-babel-default-header-args:org' variable. OK. Clear. >> Asking for Org results, as you mentioned, made me dream about a direct >> export to PDF on =3DC-c C-v C-e=3D. However, when the Org results block >> =3Dletter=3D is surrounded by LaTeX code, items and tables aren't transl= ated >> anymore to their LaTeX counterparts. > > true, your outer-most block would have to be an org-mode block, which cou= ld > include LaTeX sections if they were already surrounded in begin/end_latex > blocks. Never thought about having blocks *inside* blocks... Tried things such as the following: --8<---------------cut here---------------start------------->8--- #+OPTIONS: H:3 num:nil toc:nil #+LaTeX_CLASS: isodoc #+LaTeX_HEADER: \setupdocument{ #+LaTeX_HEADER: to =3D {% #+LaTeX_HEADER: Org mode user group \\ #+LaTeX_HEADER: World Wide Web #+LaTeX_HEADER: }, #+LaTeX_HEADER: subject =3D {Composing letters using Org mode and the \= LaTeX{} isodoc class}, #+LaTeX_HEADER: opening =3D {Dear Org mode users}, #+LaTeX_HEADER: closing =3D {Yours Truly} #+LaTeX_HEADER: } #+source: contents #+begin_src org :results silent :exports none My body includes a list: - one - two and a small table: | here | second | | other | last | Not more. #+end_src #+BEGIN_SRC org #+BEGIN_LaTeX \letter{% #+END_LaTeX #+srcname: letter #+begin_src org :results raw :noweb yes Composing letters using *Org mode* and the LaTeX isodoc class <> #+end_src #+BEGIN_LaTeX } #+END_LaTeX #+END_SRC --8<---------------cut here---------------end--------------->8--- > It may not be possible to export directly to a latex letter using Org-mod= e's > build latex exporter. I think the tangling solution you mention below may= be > preferable. I'm approaching, but am not still where I need to be: the =3D#+END_SRC=3D d= oes not seem to be correctly nested... The inner one gets related to the outer =3D#+BEGIN_SRC=3D. >> Then, if I understand correctly, the only fallback is the tangling >> solution: > > agreed. > >> Here, the above results is perfectly translated into LaTeX. But trying to >> export this buffer raises the =3DArgs out of range: 0, 0=3D error. > > This is the same error we discovered earlier, namely trying to export the > body of an Org-mode block to latex in the middle of a latex export. I've > pushed up a more useful error message. Yes. I was re-injecting previous results, to make the overview complete. >> The solution is to tangle it, and launch pdflatex on the tangled file. > > agreed. BTW: I've just pushed up a code block to the library of babel whi= ch > makes it possible to include headlines into noweb exports. I imagine this > would be very useful when composing letters in this manner. See the email > where I initially mention this > http://thread.gmane.org/gmane.emacs.orgmode/29926/focus=3D30667 Thanks. >> - Couldn't =3DC-c C-v C-e=3D tangle to files, when the =3Dtangle=3D para= meter is >> present? FYI, I've lost some amount of time (won't tell you how much,= I'm >> ashamed) thinking that the tangling process did not work anymore on my >> machine, because I was expecting it on =3DC-c C-v C-e=3D. At my discha= rge, I >> only used tangling once, a couple of months ago, but... >> >> ... and I think I already had once that request in mind, maybe even as= ked >> on the list. > > =3DC-c C-v C-e=3D is already used for executing code blocks, unfortunately > key-bindings are at a premium, so I don't think it is worth re-binding th= is > -- although I do see how you could be confused I meant: for me, when there is a tangle directive, executing the code block *is* tangling. Or, at least, tangling should be done at the same time as the execution. Maybe, you want to explicitly separate both functions, though. >> Idealistic goal that I have in mind (so that I share upfront which >> directions I would enjoy to be able to follow): >> >> - be able to produce =3Disodoc=3D letter in PDF just by =3DC-c C-v C-e=3D > > by =3DC-c C-v C-e=3D do you mean tangle or execute? I meant, thus, when executing (here, producing the letter). >> - next step: be able to produce /mail merge/ ("publiposting"), having in >> Org the list of recipients and the letter's contents -- both in one >> unique Org file --, and producing all the letters at once (in one PDF), >> just by =3DC-c C-v C-e=3D... > > this shouldn't be impossible with the current setup, maybe use sbe to cal= l a > code block on every row of a table with the table holding the recipients. > Certainly wouldn't be trivial though. I'll try to understand all of this in my next work session... Thanks for all help provided so far... Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode