emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug] Problem when tangling into LaTeX
@ 2012-01-30 21:03 Sebastien Vauban
  2012-01-31  1:40 ` Eric Schulte
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastien Vauban @ 2012-01-30 21:03 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

#+TITLE:     Noweb references in LaTeX document
#+DATE:      2012-01-30

* Summary

** Problem

I use 3 chunks of LaTeX code which I wanna insert in a LaTeX document.

While 1 of them is correctly tangled into the LaTeX document, the 2 others
generate errors when C-c C-v C-t'ing:

    "if: reference '<<who' not found in this buffer"

and, if I temporarily replace `<<who()>>' by `<<who>>', I get the next error:

    "if: reference '    <<solde' not found in this buffer"

What I don't understand is that there is no -- sorry, I mean: I don't see --
the difference between the 3 noweb references. They all seem correctly
written...

** Note

Remember that, up to now, such a document *must be first tangled* and then
post-processed via =PDFLaTeX=. It can not be exported directly to PDF/HTML (=args
out of range= error).

* Example

** Part 1
#+name: who
#+begin_src org :results latex
1111ToMe
#+end_src

** Part 2
#+name: before
#+begin_src org :results latex
2222BeforeDate
#+end_src

** Part 3
#+name: solde
#+begin_src org :results latex
3333Rest
#+end_src

** Composed letter
#+begin_src latex :noweb yes :tangle yes
\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}

\begin{textblock}{85}(98,35)
\titlebox{9.4cm}{Foo}{% HERE 1111 <<<<
<<who()>>
}
\end{textblock}

\begin{textblock}{110}(25,195)
    Some sentence
    <<before()>> \hfill{}% HERE 2222 <<<<
    <<solde()>> EUR% HERE 3333 <<<<
\end{textblock}

\end{document}
#+end_src

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [bug] Problem when tangling into LaTeX
  2012-01-30 21:03 [bug] Problem when tangling into LaTeX Sebastien Vauban
@ 2012-01-31  1:40 ` Eric Schulte
  2012-01-31  8:11   ` Sebastien Vauban
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Schulte @ 2012-01-31  1:40 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:

> #+TITLE:     Noweb references in LaTeX document
> #+DATE:      2012-01-30
>
> * Summary
>
> ** Problem
>
> I use 3 chunks of LaTeX code which I wanna insert in a LaTeX document.
>
> While 1 of them is correctly tangled into the LaTeX document, the 2 others
> generate errors when C-c C-v C-t'ing:
>
>     "if: reference '<<who' not found in this buffer"
>
> and, if I temporarily replace `<<who()>>' by `<<who>>', I get the next error:
>
>     "if: reference '    <<solde' not found in this buffer"
>
> What I don't understand is that there is no -- sorry, I mean: I don't see --
> the difference between the 3 noweb references. They all seem correctly
> written...
>
> ** Note
>
> Remember that, up to now, such a document *must be first tangled* and then
> post-processed via =PDFLaTeX=. It can not be exported directly to PDF/HTML (=args
> out of range= error).
>
> * Example
>
> ** Part 1
> #+name: who
> #+begin_src org :results latex
> 1111ToMe
> #+end_src
>
> ** Part 2
> #+name: before
> #+begin_src org :results latex
> 2222BeforeDate
> #+end_src
>
> ** Part 3
> #+name: solde
> #+begin_src org :results latex
> 3333Rest
> #+end_src
>
> ** Composed letter
> #+begin_src latex :noweb yes :tangle yes
> \documentclass{article}
> \usepackage[utf8x]{inputenc}
> \usepackage[T1]{fontenc}
>
> \begin{document}
>
> \begin{textblock}{85}(98,35)
> \titlebox{9.4cm}{Foo}{% HERE 1111 <<<<
> <<who()>>
> }
> \end{textblock}
>
> \begin{textblock}{110}(25,195)
>     Some sentence
>     <<before()>> \hfill{}% HERE 2222 <<<<
>     <<solde()>> EUR% HERE 3333 <<<<
> \end{textblock}
>
> \end{document}
> #+end_src
>
> Best regards,
>   Seb

Currently newlines are allowed in noweb reference names causing the
problems you noticed above.  I've just pushed up a change which
disallows newline characters in noweb references and fixes the odd
behavior you describe.

Best,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [bug] Problem when tangling into LaTeX
  2012-01-31  1:40 ` Eric Schulte
@ 2012-01-31  8:11   ` Sebastien Vauban
  2012-01-31 13:16     ` Eric S Fraga
  2012-02-01 17:54     ` Sebastien Vauban
  0 siblings, 2 replies; 6+ messages in thread
From: Sebastien Vauban @ 2012-01-31  8:11 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric,

Eric Schulte wrote:
> "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>
>> I use 3 chunks of LaTeX code which I wanna insert in a LaTeX document.
>> While 1 of them is correctly tangled into the LaTeX document, the 2 others
>> generate errors when C-c C-v C-t'ing:
>>
>>     "if: reference '<<who' not found in this buffer"
>>
>> and, if I temporarily replace `<<who()>>' by `<<who>>', I get the next error:
>>
>>     "if: reference '    <<solde' not found in this buffer"
>>
>> What I don't understand is that there is no -- sorry, I mean: I don't see --
>> the difference between the 3 noweb references. They all seem correctly
>> written...
>>
>> * Example
>>
>> ** Part 1
>> #+name: who
>> #+begin_src org :results latex
>> 1111ToMe
>> #+end_src
>>
>> ** Part 2
>> #+name: before
>> #+begin_src org :results latex
>> 2222BeforeDate
>> #+end_src
>>
>> ** Part 3
>> #+name: solde
>> #+begin_src org :results latex
>> 3333Rest
>> #+end_src
>>
>> ** Composed letter
>> #+begin_src latex :noweb yes :tangle yes
>> \documentclass{article}
>> \usepackage[utf8x]{inputenc}
>> \usepackage[T1]{fontenc}
>>
>> \begin{document}
>>
>> \begin{textblock}{85}(98,35)
>> \titlebox{9.4cm}{Foo}{% HERE 1111 <<<<
>> <<who()>>
>> }
>> \end{textblock}
>>
>> \begin{textblock}{110}(25,195)
>>     Some sentence
>>     <<before()>> \hfill{}% HERE 2222 <<<<
>>     <<solde()>> EUR% HERE 3333 <<<<
>> \end{textblock}
>>
>> \end{document}
>> #+end_src
>
> Currently newlines are allowed in noweb reference names causing the problems
> you noticed above.

If it does not take you too much time, can you enlighten me on the diffs
between the chunks?  Why was it well working for the second one?

> I've just pushed up a change which disallows newline characters in noweb
> references and fixes the odd behavior you describe.

References are working well. Thanks a lot!

Though, there is an annoying diff in the tangled LaTeX: the first block gets
an extra blank line (I don't understand why it differs from the others) which
will cause layout problem when compiling the document -- not this one, it's
just an not-so-valid ECM, but real ones...

#+begin_src latex
  \documentclass{article}
  \usepackage[utf8x]{inputenc}
  \usepackage[T1]{fontenc}

  \begin{document}

  \begin{textblock}{85}(98,35)
  \titlebox{9.4cm}{Foo}{% HERE 1111 <<<<
  1111ToMe

  }
  \end{textblock}

  \begin{textblock}{110}(25,195)
      Some sentence
      2222BeforeDate
       \hfill{}% HERE 2222 <<<<
      3333Rest
       EUR% HERE 3333 <<<<
  \end{textblock}

  \end{document}
#+end_src

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [bug] Problem when tangling into LaTeX
  2012-01-31  8:11   ` Sebastien Vauban
@ 2012-01-31 13:16     ` Eric S Fraga
  2012-02-01 17:52       ` Sebastien Vauban
  2012-02-01 17:54     ` Sebastien Vauban
  1 sibling, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2012-01-31 13:16 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:


[...]

> If it does not take you too much time, can you enlighten me on the diffs
> between the chunks?  Why was it well working for the second one?

I think you'll find that the asymmetry is due to the placement of your
comment strings which have the <<<< characters, misinterpreted in this
case to indicate the start of a noweb reference...


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.283.g171ea)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [bug] Problem when tangling into LaTeX
  2012-01-31 13:16     ` Eric S Fraga
@ 2012-02-01 17:52       ` Sebastien Vauban
  0 siblings, 0 replies; 6+ messages in thread
From: Sebastien Vauban @ 2012-02-01 17:52 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric,

Eric S Fraga wrote:
> Sebastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>> If it does not take you too much time, can you enlighten me on the diffs
>> between the chunks?  Why was it well working for the second one?
>
> I think you'll find that the asymmetry is due to the placement of your
> comment strings which have the <<<< characters, misinterpreted in this
> case to indicate the start of a noweb reference...

That must be it. Due to the correct highlighting as comments, it did not occur
to me that the `%<<<<<' I inserted looked like noweb refs...

And Eric's fix does solve this.

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [bug] Problem when tangling into LaTeX
  2012-01-31  8:11   ` Sebastien Vauban
  2012-01-31 13:16     ` Eric S Fraga
@ 2012-02-01 17:54     ` Sebastien Vauban
  1 sibling, 0 replies; 6+ messages in thread
From: Sebastien Vauban @ 2012-02-01 17:54 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric,

"Sebastien Vauban" wrote:
> Though, there is an annoying diff in the tangled LaTeX: the first block gets
> an extra blank line (I don't understand why it differs from the others) which
> will cause layout problem when compiling the document -- not this one, it's
> just an not-so-valid ECM, but real ones...
>
> #+begin_src latex
>   \documentclass{article}
>   \usepackage[utf8x]{inputenc}
>   \usepackage[T1]{fontenc}
>
>   \begin{document}
>
>   \begin{textblock}{85}(98,35)
>   \titlebox{9.4cm}{Foo}{% HERE 1111 <<<<
>   1111ToMe
>
>   }
>   \end{textblock}
>
>   \begin{textblock}{110}(25,195)
>       Some sentence
>       2222BeforeDate
>        \hfill{}% HERE 2222 <<<<
>       3333Rest
>        EUR% HERE 3333 <<<<
>   \end{textblock}
>
>   \end{document}
> #+end_src

This isn't priority anymore: currently, I'm not hit by that bug/feature in the
real file I'm working on.

Thanks for the fix you've readily made available...

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-02-01 17:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-30 21:03 [bug] Problem when tangling into LaTeX Sebastien Vauban
2012-01-31  1:40 ` Eric Schulte
2012-01-31  8:11   ` Sebastien Vauban
2012-01-31 13:16     ` Eric S Fraga
2012-02-01 17:52       ` Sebastien Vauban
2012-02-01 17:54     ` Sebastien Vauban

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).