emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Restore raw output in LaTeX export from in-line code block
@ 2013-09-28 19:19 Liam Healy
  2013-09-29 19:46 ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: Liam Healy @ 2013-09-28 19:19 UTC (permalink / raw)
  To: Org-mode mailing list


[-- Attachment #1.1: Type: text/plain, Size: 539 bytes --]

I noticed that raw results from in-line code blocks were disappearing in
the new LaTeX exporter, and bisected the repo to the change 7117ad4f92. I
have created the attached patch to fix the problem and restore the previous
behavior.

example file
      * Test
        1. Inline common lisp raw: src_lisp[:results raw]{(+ 2 2)}, should
say 4.


Desired output, restored by patch
  \item Inline common lisp raw: 4, should say 4.
Output without patch
   \item Inline common lisp raw: , should say 4.

If this looks right, please apply.

Liam

[-- Attachment #1.2: Type: text/html, Size: 663 bytes --]

[-- Attachment #2: 0001-Restore-raw-output-in-LaTeX-export-from-in-line-code.patch --]
[-- Type: application/octet-stream, Size: 1037 bytes --]

From 4d56221f954346b95f0cf0f23969c88f419b4705 Mon Sep 17 00:00:00 2001
From: "Liam M. Healy" <lhealy@common-lisp.net>
Date: Sat, 28 Sep 2013 13:17:53 -0400
Subject: [PATCH] Restore raw output in LaTeX export from in-line code block

Commit 7117ad4f92 caused the :results raw to produce empty output, e.g.
* Test
  1. Inline common lisp raw: src_lisp[:results raw]{(+ 2 2)}, should say 4.
produced the LaTeX line
   \item Inline common lisp raw: , should say 4.
This patch restores previous behavior, so that the LaTeX
   \item Inline common lisp raw: 4, should say 4.
---
 lisp/ob-core.el |    1 -
 1 file changed, 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index a7c227b..472f9ea 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2724,7 +2724,6 @@ Emacs shutdown."))
 		 (member "code" ,params)
 		 (member "pp" ,params)
 		 (and (or (member "output" ,params)
-			  (member "raw"    ,params)
 			  (member "org"    ,params)
 			  (member "drawer" ,params))
 		      (not (member "table" ,params))))
-- 
1.7.9.5


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

* Re: Restore raw output in LaTeX export from in-line code block
  2013-09-28 19:19 Restore raw output in LaTeX export from in-line code block Liam Healy
@ 2013-09-29 19:46 ` Eric Schulte
  2013-10-01 23:36   ` Liam Healy
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Schulte @ 2013-09-29 19:46 UTC (permalink / raw)
  To: Liam Healy; +Cc: Org-mode mailing list

Liam Healy <lnp@healy.washington.dc.us> writes:

> I noticed that raw results from in-line code blocks were disappearing in
> the new LaTeX exporter, and bisected the repo to the change 7117ad4f92. I
> have created the attached patch to fix the problem and restore the previous
> behavior.
>
> example file
>       * Test
>         1. Inline common lisp raw: src_lisp[:results raw]{(+ 2 2)}, should
> say 4.
>
>
> Desired output, restored by patch
>   \item Inline common lisp raw: 4, should say 4.
> Output without patch
>    \item Inline common lisp raw: , should say 4.
>
> If this looks right, please apply.
>
> Liam
>

Hi Liam,

You're actually noticing a symptom of an error in the way lisp code
blocks were handling results (conflating the output/results and the
scalar/vector distinction).  I've just pushed up a fix, please let me
know if you continue to see these types of errors.

Best,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

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

* Re: Restore raw output in LaTeX export from in-line code block
  2013-09-29 19:46 ` Eric Schulte
@ 2013-10-01 23:36   ` Liam Healy
  2013-10-02 13:28     ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: Liam Healy @ 2013-10-01 23:36 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org-mode mailing list

On Sun, Sep 29, 2013 at 3:46 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> Liam Healy <lnp@healy.washington.dc.us> writes:
>
>> I noticed that raw results from in-line code blocks were disappearing in
>> the new LaTeX exporter, and bisected the repo to the change 7117ad4f92. I
>> have created the attached patch to fix the problem and restore the previous
>> behavior.
>>
>> example file
>>       * Test
>>         1. Inline common lisp raw: src_lisp[:results raw]{(+ 2 2)}, should
>> say 4.
>>
>>
>> Desired output, restored by patch
>>   \item Inline common lisp raw: 4, should say 4.
>> Output without patch
>>    \item Inline common lisp raw: , should say 4.
>>
>> If this looks right, please apply.
>>
>> Liam
>>
>
> Hi Liam,
>
> You're actually noticing a symptom of an error in the way lisp code
> blocks were handling results (conflating the output/results and the
> scalar/vector distinction).  I've just pushed up a fix, please let me
> know if you continue to see these types of errors.
>
> Best,
>
> --
> Eric Schulte
> https://cs.unm.edu/~eschulte
> PGP: 0x614CA05D

Thanks Eric. Indeed, your patches work to produce the correct output
for that case. Now I have another problem. I'm really not interested
in producing "4" of course, what I do is use lisp to produce LaTeX.
For example,

+ Inline common lisp raw: $src_lisp[:results raw]{(format nil
"\\sqrt{2~c" (code-char 125))}$, should say "$\sqrt{2}$".

Which used to produce (Org-mode version 7.9.4) the right thing,
\item Inline common lisp raw: $\sqrt{2}$, should say ``$\sqrt{2}$".
and now (Org-mode version 8.2.1) doesn't evaluate the lisp,
\item Inline common lisp raw: $src_lisp[:results raw]{(format nil
"\\sqrt{2~c" (code-char 125))}$, should say "$\sqrt{2}$".

Is this a bug? How do I restore the evaluation of the src_lisp in this context?

Thanks.
Liam

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

* Re: Restore raw output in LaTeX export from in-line code block
  2013-10-01 23:36   ` Liam Healy
@ 2013-10-02 13:28     ` Eric Schulte
  2013-10-06 14:28       ` Liam Healy
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Schulte @ 2013-10-02 13:28 UTC (permalink / raw)
  To: Liam Healy; +Cc: Org-mode mailing list

[-- Attachment #1: Type: text/plain, Size: 1987 bytes --]

Liam Healy <lnp@healy.washington.dc.us> writes:

> On Sun, Sep 29, 2013 at 3:46 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
>> Liam Healy <lnp@healy.washington.dc.us> writes:
>>
>>> I noticed that raw results from in-line code blocks were disappearing in
>>> the new LaTeX exporter, and bisected the repo to the change 7117ad4f92. I
>>> have created the attached patch to fix the problem and restore the previous
>>> behavior.
>>>
>>> example file
>>>       * Test
>>>         1. Inline common lisp raw: src_lisp[:results raw]{(+ 2 2)}, should
>>> say 4.
>>>
>>>
>>> Desired output, restored by patch
>>>   \item Inline common lisp raw: 4, should say 4.
>>> Output without patch
>>>    \item Inline common lisp raw: , should say 4.
>>>
>>> If this looks right, please apply.
>>>
>>> Liam
>>>
>>
>> Hi Liam,
>>
>> You're actually noticing a symptom of an error in the way lisp code
>> blocks were handling results (conflating the output/results and the
>> scalar/vector distinction).  I've just pushed up a fix, please let me
>> know if you continue to see these types of errors.
>>
>> Best,
>>
>> --
>> Eric Schulte
>> https://cs.unm.edu/~eschulte
>> PGP: 0x614CA05D
>
> Thanks Eric. Indeed, your patches work to produce the correct output
> for that case. Now I have another problem. I'm really not interested
> in producing "4" of course, what I do is use lisp to produce LaTeX.
> For example,
>
> + Inline common lisp raw: $src_lisp[:results raw]{(format nil
> "\\sqrt{2~c" (code-char 125))}$, should say "$\sqrt{2}$".
>
> Which used to produce (Org-mode version 7.9.4) the right thing,
> \item Inline common lisp raw: $\sqrt{2}$, should say ``$\sqrt{2}$".
> and now (Org-mode version 8.2.1) doesn't evaluate the lisp,
> \item Inline common lisp raw: $src_lisp[:results raw]{(format nil
> "\\sqrt{2~c" (code-char 125))}$, should say "$\sqrt{2}$".
>
> Is this a bug? How do I restore the evaluation of the src_lisp in this context?
>

When I export a file such as the following,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: example-w-lisp.org --]
[-- Type: text/x-org, Size: 96 bytes --]

#+Options: ^:{}

inline src_lisp[:results raw]{(format nil "\\sqrt{2~c" (code-char 125))} works

[-- Attachment #3: Type: text/plain, Size: 88 bytes --]


I do find that inline code blocks are evaluated on export resulting in
the following.


[-- Attachment #4: example-w-lisp.txt --]
[-- Type: text/plain, Size: 311 bytes --]

                            ━━━━━━━━━━━━━━━━
                             EXAMPLE-W-LISP
                            ━━━━━━━━━━━━━━━━


Table of Contents
─────────────────




inline "\\sqrt{2}" works

[-- Attachment #5: Type: text/plain, Size: 188 bytes --]


Are you able to interactively execute inline code blocks?

I'm not sure what the issue could be.

Best,

>
> Thanks.
> Liam

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

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

* Re: Restore raw output in LaTeX export from in-line code block
  2013-10-02 13:28     ` Eric Schulte
@ 2013-10-06 14:28       ` Liam Healy
  0 siblings, 0 replies; 5+ messages in thread
From: Liam Healy @ 2013-10-06 14:28 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org-mode mailing list

On Wed, Oct 2, 2013 at 9:28 AM, Eric Schulte <schulte.eric@gmail.com> wrote:
>
>
> inline "\\sqrt{2}" works
>
>
> Are you able to interactively execute inline code blocks?
>
> I'm not sure what the issue could be.
>
> Best,
>

Thanks for the response Eric. I do not get the results you do:
  src_lisp[:results raw]{(format nil "\\sqrt{2~c" (code-char 125))}
gives me
  "$\backslash$\sqrt{2}"
which is obviously wrong. Even so, what you get is wrong too; it should be
  \sqrt{2}
(a single backslash and no quotes), which is what I get under 7.9.4.
If I have only one backslash,
 src_lisp[:results raw]{(format nil "\sqrt{2~c" (code-char 125))}
I get
 "sqrt\{2\}"
still wrong.

It appears there is more than one problem, and one of the problems is
the Common Lisp's escaping of "\" with a second "\" is being
misinterpreted. A possible second problem is that it seems to now use
#'print (or the equivalent) on the lisp side instead of #'princ, so
that the output includes escape characters.

Thanks,
Liam

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

end of thread, other threads:[~2013-10-06 14:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-28 19:19 Restore raw output in LaTeX export from in-line code block Liam Healy
2013-09-29 19:46 ` Eric Schulte
2013-10-01 23:36   ` Liam Healy
2013-10-02 13:28     ` Eric Schulte
2013-10-06 14:28       ` Liam Healy

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