Re: [Orgmode] Re: Composing letters using Org mode and the LaTeX isodoc class
On Wed, 08 Sep 2010 23:26:15 +0200, Sébastien Vauban wxhgmqzgw...@spammotel.com wrote: [...] 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... Just to add a data point: this works for me with : Org-mode version 7.01trans (release_7.01h.493.gece2) : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-08-14 on raven, modified by Debian Time to learn isodoc as it looks very useful indeed! Thanks, eric -- Eric S Fraga GnuPG: 8F5C 279D 3907 E14A 5C29 570D C891 93D8 FFFC F67D ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Composing letters using Org mode and the LaTeX isodoc class
Hi Seb, Sébastien Vauban wxhgmqzgw...@spammotel.com 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 export 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 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. - 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. 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 org-list() #+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 =:tangle AA.tex= for example (with and without quotes ;-)). 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=head[0,1] :var h-subject=head[1,1] :var h-opening=head[2,1] :var h-closing=head[3,1] \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{% body() } \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 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Composing letters using Org mode and the LaTeX isodoc class
Hi, I'll try to answer some of the Babel related portions of this discussion below. I look forward to any potential org-letter export this line of investigation yields. Best -- Eric Sébastien Vauban wxhgmqzgw...@spammotel.com writes: Hi Jambunathan, Jambunathan K wrote: [...] I would like to hear why you chose to go down the tangling path. For two reasons: - because I had not the hope of being able to configure the LaTeX export 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 code blocks, however maybe this will change once I've looked at and understood an example application. - 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, so the following should now (if I understood) allow the tangling behavior you've described --8---cut here---start-8--- ** 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 org-list() #+end_src --8---cut here---end---8--- tangles to --8---cut here---start-8--- \begin{itemize} \item two \item three \end{itemize} --8---cut here---end---8--- 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. Personally I feel any sort of markup (this includes babel directives) distracting. They're much less distracting as soon as they're properly highlighted. Question of color-theme. I can provide you (all) with mine, if you're interested. Btw, your approach set me thinking. I think there is a strong case for making headlines act as babel srcnames with their body providing content for noweb expansion [3]. This behaviour could be controlled by a buffer local variable. That would definitely make sense to me, at least for this particular need. But, maybe, there is already a parallel way to do such a thing... Wondering how babel treats srcnames? Can there be spaces? Is upper and lower cases treated one and the same ... Spaces are now allowed, I'm honestly not sure that it will successfully distinguish between upper and lower cases in code block names (all of mine are lower-case), but either way I'd say it's poor style to rely on case to distinguish between different code blocks. Best -- Eric Being a (tiny) part-time Babel user, I wish I could easily answer such questions. But, as I always try to take as less risks as possible, these are things I never really looked at. Footnotes: [3] It is likely the body of the headline might be run through a custom renderer (say latex, html or even emac's own comment-region) before finding it's way in to the document generated by tangle. Thanks once again for referring me to isodoc. When someone shares something of value with you and you benefit from it, you have a moral obligation to share it with others. -- Chinese proverb I've been as well referred to this excellent package by a friend. Hence, I do what I have to do... I now would be pleased to hear what others think, and eventually can do along this line! Best regards, Seb ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Composing letters using Org mode and the LaTeX isodoc class
Hi Eric, Thank you. This will be very useful. All the best, Tom On Sep 7, 2010, at 2:56 PM, Eric Schulte wrote: #+begin_src org :results latex - one - two - three #+end_src ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode