From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: Composing letters using Org mode and the LaTeX isodoc class Date: Wed, 08 Sep 2010 09:38:35 -0600 Message-ID: <87eid4z1la.fsf@gmail.com> References: <87zkvtn5u7.fsf@mundaneum.com> <81wrqxv1bq.fsf@gmail.com> <87r5h5gwxo.fsf@mundaneum.com> <87iq2huk7u.fsf@gmail.com> <8762ygv4q4.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=55529 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtMkM-0005uM-WE for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 11:39:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtMkI-00041H-JD for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 11:39:38 -0400 Received: from mail-qy0-f169.google.com ([209.85.216.169]:60996) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtMkI-00041B-FW for emacs-orgmode@gnu.org; Wed, 08 Sep 2010 11:39:34 -0400 Received: by qyk12 with SMTP id 12so5126923qyk.0 for ; Wed, 08 Sep 2010 08:39:34 -0700 (PDT) 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@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: emacs-orgmode@gnu.org Hi Seb, S=C3=A9bastien Vauban writes: > Hi Eric, > > "Eric Schulte" wrote: >> I look forward to any potential org->letter export this line of >> investigation yields. > > As soon as this is closed, I'm willing to write a Worg page for this. > >>> - because I had not the hope of being able to configure the LaTeX expor= t class >>> and/or code in the right way, >> >> 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 c= ode >> blocks, however maybe this will change once I've looked at and understoo= d an >> example application. > > Isodoc is quite easy to configure, but it's through keyval mappings. I do= n'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 accessib= le > 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. > >>> - 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 snippet= s of >>> code "=C3=A0 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. > > >> so the following should now (if I understood) allow the tangling >> behavior you've described >> >> ** tangle org-mode block >> #+source: org-list >> #+begin_src org :results latex >> - one >> - two >> - three >> #+end_src >> >> #+begin_src emacs-lisp :tangle yes :noweb yes >> " >> <> >> " >> #+end_src >> >> tangles to >> >> >> " >> \begin{itemize} >> \item two >> \item three >> \end{itemize} >> >> >> " > > 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. > > >> 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 > already up-to-date, but your code does not work for me... > > _Nothing is tangled anymore_... Not even if I explicitly state > =3D:tangle "AA.tex"=3D for example (with and without quotes=C2=A0;-)). > 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. 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. --8<---------------cut here---------------start------------->8--- * Letter #+tblname: head | To | Eric Schulte | | Subject | Tangling is Broken | | Opening | Hi | | Closing | Best | #+source: body #+begin_src org :results latex - one - two - three #+end_src #+begin_src latex :noweb yes :tangle yes :var h-to=3Dhead[0,1] :var h-subje= ct=3Dhead[1,1] :var h-opening=3Dhead[2,1] :var h-closing=3Dhead[3,1] \documentclass[11pt]{isodoc} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage{isodoc-style} \setupdocument{ to =3D {h-to}, subject =3D {h-subject}, opening =3D {h-opening}, closing =3D {h-closing} } \begin{document} \letter{% <> } \end{document} #+end_src --8<---------------cut here---------------end--------------->8--- 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. Best -- Eric