From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [Babel] Can't export to LaTeX anymore (args-out-of-range 0 0)
Date: Tue, 21 Sep 2010 00:10:56 +0200 [thread overview]
Message-ID: <87k4mgoykv.fsf@mundaneum.com> (raw)
In-Reply-To: 87ocbw48e2.fsf@gmail.com
Hi Eric and all the others,
"Eric Schulte" wrote:
> Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>> "Eric Schulte" wrote:
>>>> The error occurs with such a simple document:
>>>>
>>>> #+TITLE: Org-isodoc
>>>> #+LANGUAGE: en_US
>>>>
>>>> * Context
>>>>
>>>> This is a letter sample.
>>>>
>>>> * Subject
>>>> #+srcname: subject
>>>> #+begin_src org :results latex
>>>> Composing letters using Org mode and the LaTeX isodoc class
>>>> #+end_src
>>>
>>> This is a tricky problem indeed. [...] This fix will probably take some
>>> time to implement, and until then I don't think it will be possible to
>>> evaluate org-mode blocks during export.
>
> Noweb expansion is still possible, however explicitly performing the export
> is not.
>
>> What could be a workaround?
>
> Simply change =:results latex= to =:results org= and the code block body
> will be harmlessly expanded and deposited in the org buffer on export, then
> carried along with the rest of the file for export.
>
> * Subject
> #+source: me
> #+begin_src org
> I am *eric*.
> #+end_src
>
> #+srcname: subject
> #+begin_src org :results org replace :noweb yes
> Composing letters using *Org mode* and the LaTeX isodoc class
>
> <<me>>
> #+end_src
Question: =:results org replace= (instead of =:results org=) is necessary if
we wanna see the results expanded in the Org buffer, on key =C-c C-v C-e=.
Why?
Trying to build on the route you mention, I come up with different solutions,
such as:
--8<---------------cut here---------------start------------->8---
#+TITLE: Org-isodoc
#+AUTHOR: Seb Vauban
#+DATE: 2010-09-20
* COMMENT Parameters
#+source: contents
#+begin_src org
My body includes a list:
- one
- two
and a small table:
| first | second |
| other | last |
Not more.
#+end_src
#+srcname: letter
#+begin_src org :results org replace :noweb yes
Composing letters using *Org mode* and the LaTeX isodoc class
<<contents>>
#+end_src
* Results
#+LaTeX: \documentclass[11pt]{isodoc}
#+LaTeX: \usepackage[utf8x]{inputenc}
#+LaTeX: \usepackage[T1]{fontenc}
#+LaTeX: \setupdocument{
#+LaTeX: to = {Eric},
#+LaTeX: subject = {Tough to understand what to do...},
#+LaTeX: opening = {Hi},
#+LaTeX: closing = {Best}
#+LaTeX: }
#+LaTeX: \begin{document}
#+LaTeX: {}\letter{%
#+results: letter
#+BEGIN_SRC org
Composing letters using *Org mode* and the LaTeX isodoc class
My body includes a list:
- one
- two
and a small table:
| first | second |
| other | last |
Not more.
#+END_SRC
#+LaTeX: }
#+LaTeX: \end{document}
--8<---------------cut here---------------end--------------->8---
Asking for Org results, as you mentioned, made me dream about a direct export
to PDF on =C-c C-v C-e=. However, when the Org results block =letter= is
surrounded by LaTeX code, items and tables aren't translated anymore to their
LaTeX counterparts.
OK, even if it doe, I still have a couple of problems to resolve:
- How to avoid generating the title of the exported headline (=* Results=)?
- How to impose my =documentclass isodoc= instead of =article=?
and maybe more.
Then, if I understand correctly, the only fallback is the tangling solution:
--8<---------------cut here---------------start------------->8---
* Letter
:PROPERTIES:
:ID: 02360e5c-8f76-4e6d-a98f-b8c5fa2a3da4
:END:
#+source: body
#+begin_src org :results latex
My body includes a list:
- one
- two
and a small table:
| first | second |
| other | last |
Not more.
#+end_src
#+begin_src latex :noweb yes :tangle yes
\documentclass[11pt]{isodoc}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\setupdocument{
to = {Eric},
subject = {Tough to understand what to do...},
opening = {Hi},
closing = {Best}
}
\begin{document}
\letter{%
<<body()>>
}
\end{document}
#+end_src
#+results:
#+BEGIN_LaTeX
\documentclass[11pt]{isodoc}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\setupdocument{
to = {Eric},
subject = {Tough to understand what to do...},
opening = {Hi},
closing = {Best}
}
\begin{document}
\letter{%
My body includes a list:
\begin{itemize}
\item one
\item two
\end{itemize}
and a small table:
\begin{center}
\begin{tabular}{ll}
first & second \\
other & last \\
\end{tabular}
\end{center}
Not more.
}
\end{document}
#+END_LaTeX
--8<---------------cut here---------------end--------------->8---
Here, the above results is perfectly translated into LaTeX. But trying to
export this buffer raises the =Args out of range: 0, 0= error.
The solution is to tangle it, and launch pdflatex on the tangled file.
Questions:
- Is the above overview right, or am I *still* missing things?
- Couldn't =C-c C-v C-e= tangle to files, when the =tangle= parameter 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 =C-c C-v C-e=. At my discharge, I
only used tangling once, a couple of months ago, but...
... and I think I already had once that request in mind, maybe even asked on
the list.
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 =isodoc= letter in PDF just by =C-c C-v C-e=
- 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 =C-c
C-v C-e=...
Thanks for your help (past, present... and future)!
Best regards,
Seb
--
Sébastien 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
next prev parent reply other threads:[~2010-09-20 22:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-13 11:33 [Babel] Can't export to LaTeX anymore (args-out-of-range 0 0) Sébastien Vauban
2010-09-17 14:08 ` Eric Schulte
2010-09-17 15:18 ` Sébastien Vauban
2010-09-17 16:55 ` Eric Schulte
2010-09-20 22:10 ` Sébastien Vauban [this message]
2010-09-21 16:19 ` Eric Schulte
2010-09-21 20:54 ` Sébastien Vauban
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k4mgoykv.fsf@mundaneum.com \
--to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
--cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).