emacs-orgmode
[Top][All Lists]

[Orgmode] Re: Composing letters using Org mode and the LaTeX isodoc clas

 From: Sébastien Vauban Subject: [Orgmode] Re: Composing letters using Org mode and the LaTeX isodoc class Date: Wed, 08 Sep 2010 23:26:15 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi Eric,

"Eric Schulte" wrote:
>>> Hmm, I don't know how complex isodoc is to configure, but I'd think that
>>> defining a custom latex class would be simpler than tangling out LaTeX
>>> code blocks, however maybe this will change once I've looked at and
>>> understood an example application.
>>
>> Isodoc is quite easy to configure, but it's through keyval mappings. I
>> don't know enough of Org to imagine being able to convert headings and
>> contents to keys and values, respectively...
>>
>> That does not mean it really is difficult. Just for me, the only accessible
>> way remained the Babel route.
>
> I see, I just wanted to ensure that wrapping content in code blocks was a
> last resort, but I agree using Babel in this way should be much easier than
> defining a new Org export backend or mucking with Org-mode internals. I'm
> very happy if Babel can help to further blur the lines between Org-mode
> usage and development in this way.

You prove me right, even simplifying the stuff by using a table. Why not using
Babel, then? ;-)

That does not mean I'm not interested by seeing other solutions to this
"problem"...

>>>> - because, in a way, that's quite logical. Here and there, you define
>>>>   stuff. At the end, you just arrange them all in a way that fits well
>>>>   the LaTeX class demands.
>>>>
>>>> Though, it's not just copying, the way Babel actually does with snippets
>>>> of code "à la Noweb". Hence, I really need at least the body to be in
>>>> real Org plain code, and be automatically converted to LaTeX, so that I
>>>> can make use of the tables, and all the Org markup.
>>>>
>>>> I'm sure Babel is able of that, mixing raw code with convertable code.
>>>> Just needs more thinking.
>>>
>>> I've just implemented export of org code blocks to ascii, latex or html,
>>
>> This is brand new, right? In any case, the real good solution to such a
>> problem, IMHO...
>
> Yes this is new, it actually only required a couple of lines of code to
> implement.  However that means it may still be buggy.

Maybe. At least, I'm unable to tangle and execute your code since a couple of
hours (this noon, CET).

I've git pulled right now. Same as before...

>>> so the following should now (if I understood) allow the tangling
>>> behavior you've described
>>
>> Here, I just don't understand why you're choosing emacs-lisp' as target
>> language for LaTeX code. Is there a reason for this, or just a typo?
>
> I do all my testing with emacs-lisp code blocks, as their sort of the
> simplest (at least for me/Babel) code block. Once it's working there it
> should extend to code blocks in other languages as well.

Clear... Thanks for the precision.

>>> note that the () on the end of the code block name in the noweb syntax
>>> means to insert the results of evaluating the code block (in this case
>>> latex) rather than the body of the code block itself.
>>
>> Understood! Thanks.
>>
>> FYI, I've git pulled once again 15 minutes ago (13:30 CET). My repo was
>>
>> _Nothing is tangled anymore_... Not even if I explicitly state =:tangle
>> "AA.tex"= for example (with and without quotes ;-)).

As said, situation is stayed the same. Of course, I guess you did not have
time yet fixing that, if I can make the assumption you're responsible of the
change in tangle behavior.

> I've taken your excerpt and changed it so that it was tangling successfully
> on my system. The main problem was that there were many noweb references
> which pointed to outside of the example.

Sorry for that. I tried to keep the post as small as possible, knowing that
the other blocks could be find back in the previous post. Not smart from me,
it seems.

> The following does work on my system. Notice that it uses a table to hold
> the small components rather than wrapping each in it's own Org-mode block.
>
> There appears to be some lingering issues with converting the org block to
> latex, for me the first item in the list was missing, I'll try to take a
> look at this later today. However, hopefully this gets Babel far enough that
> at least the structure of an isodoc letter writing solution can be fleshed
> out.

The subject of your letter seems right: tangling is broken; at least on my PC.
So I don't understand why it works for you...

I can't get anything out anymore of the following:

--8<---------------cut here---------------start------------->8---
* From Eric

| To      | Eric Schulte       |
| Subject | Tangling is Broken |
| Opening | Hi                 |
| Closing | Best               |

#+source: h-body
#+begin_src org :results latex
- one
- two
- three
#+end_src

#+begin_src latex :noweb yes :tangle yes :var h-to=head[0,1] :var
\documentclass[11pt]{isodoc}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{isodoc-style}

\setupdocument{
to = {h-to},
subject = {h-subject},
opening = {h-opening},
closing = {h-closing}
}

\begin{document}
\letter{%
<<h-body()>>
}
\end{document}
#+end_src
--8<---------------cut here---------------end--------------->8---

It's your code, where I just renamed body' in h-body', so that I did not
interfere with previous code blocks.

Best regards,
Seb

--
Sébastien Vauban

`