* [beamer] a bug in exporting
@ 2011-05-11 13:09 zwz
2011-05-12 7:12 ` Eric S Fraga
0 siblings, 1 reply; 5+ messages in thread
From: zwz @ 2011-05-11 13:09 UTC (permalink / raw)
To: emacs-orgmode
In a org file I have
* what is x?
#+BEGIN_SRC c
char (*(*x())[])();
#+END_SRC
\pause
char \fbox{\fbox{(*\fbox{\fbox{(*\fbox{x()})}[]})}()};
The latex generated for the last line turned out to be
char \fbox\{\fbox\{(*\fbox{\fbox{(*\fbox{x()})}[]})\}()\};
which is not expected.
Is it a bug? I am using Emacs 23.3.1 and org 7.4, by the way.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [beamer] a bug in exporting
2011-05-11 13:09 [beamer] a bug in exporting zwz
@ 2011-05-12 7:12 ` Eric S Fraga
2011-05-12 13:26 ` zwz
0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2011-05-12 7:12 UTC (permalink / raw)
To: zwz; +Cc: emacs-orgmode
zwz <zhangweize@gmail.com> writes:
> In a org file I have
>
> * what is x?
> #+BEGIN_SRC c
> char (*(*x())[])();
> #+END_SRC
> \pause
> char \fbox{\fbox{(*\fbox{\fbox{(*\fbox{x()})}[]})}()};
>
> The latex generated for the last line turned out to be
> char \fbox\{\fbox\{(*\fbox{\fbox{(*\fbox{x()})}[]})\}()\};
> which is not expected.
>
> Is it a bug? I am using Emacs 23.3.1 and org 7.4, by the way.
I am not sure if the regex for identifying latex snippets inline has
changed or not but an expression like this one is going to test that
regex to the limit in any case. I would suggest that you use the latex
directive directly given that the code is not likely to export sensibly
to any other target anyway:
--8<---------------cut here---------------start------------->8---
* what is x?
#+BEGIN_SRC c
char (*(*x())[])();
#+END_SRC
\pause
#+LATEX: char \fbox{\fbox{(*\fbox{\fbox{(*\fbox{x()})}[]})}()};
--8<---------------cut here---------------end--------------->8---
Code like this reminds me why I left the C world more than 15 years
ago... ;-)
--
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.274.gd6aba)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [beamer] a bug in exporting
2011-05-12 7:12 ` Eric S Fraga
@ 2011-05-12 13:26 ` zwz
2011-05-12 22:05 ` Eric S Fraga
0 siblings, 1 reply; 5+ messages in thread
From: zwz @ 2011-05-12 13:26 UTC (permalink / raw)
To: emacs-orgmode
Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> zwz <zhangweize@gmail.com> writes:
>
>> In a org file I have
>>
>> * what is x?
>> #+BEGIN_SRC c
>> char (*(*x())[])();
>> #+END_SRC
>> \pause
>> char \fbox{\fbox{(*\fbox{\fbox{(*\fbox{x()})}[]})}()};
>>
>> The latex generated for the last line turned out to be
>> char \fbox\{\fbox\{(*\fbox{\fbox{(*\fbox{x()})}[]})\}()\};
>> which is not expected.
>>
>> Is it a bug? I am using Emacs 23.3.1 and org 7.4, by the way.
>
> I am not sure if the regex for identifying latex snippets inline has
> changed or not but an expression like this one is going to test that
> regex to the limit in any case. I would suggest that you use the latex
> directive directly given that the code is not likely to export sensibly
> to any other target anyway:
>
> * what is x?
> #+BEGIN_SRC c
> char (*(*x())[])();
> #+END_SRC
> \pause
> #+LATEX: char \fbox{\fbox{(*\fbox{\fbox{(*\fbox{x()})}[]})}()};
>
> Code like this reminds me why I left the C world more than 15 years
> ago... ;-)
Problem solved by the latex directive. Thanks.
The C code is from K&R's book. :)
BTW, I also use some code like this in headlines (\textcolor, \fbox),
where I guess the latex directive can not work. Is there any solutions
for this situation or any better way to colorize the text while also
support to export to other target (e.g. html)?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [beamer] a bug in exporting
2011-05-12 13:26 ` zwz
@ 2011-05-12 22:05 ` Eric S Fraga
2011-05-13 9:40 ` Eric S Fraga
0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2011-05-12 22:05 UTC (permalink / raw)
To: zwz; +Cc: emacs-orgmode
zwz <zhangweize@gmail.com> writes:
> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> zwz <zhangweize@gmail.com> writes:
>>
>>> In a org file I have
>>>
>>> * what is x?
>>> #+BEGIN_SRC c
>>> char (*(*x())[])();
>>> #+END_SRC
>>> \pause
>>> char \fbox{\fbox{(*\fbox{\fbox{(*\fbox{x()})}[]})}()};
>>>
>>> The latex generated for the last line turned out to be
>>> char \fbox\{\fbox\{(*\fbox{\fbox{(*\fbox{x()})}[]})\}()\};
>>> which is not expected.
>>>
>>> Is it a bug? I am using Emacs 23.3.1 and org 7.4, by the way.
>>
>> I am not sure if the regex for identifying latex snippets inline has
>> changed or not but an expression like this one is going to test that
>> regex to the limit in any case. I would suggest that you use the latex
>> directive directly given that the code is not likely to export sensibly
>> to any other target anyway:
>>
>> * what is x?
>> #+BEGIN_SRC c
>> char (*(*x())[])();
>> #+END_SRC
>> \pause
>> #+LATEX: char \fbox{\fbox{(*\fbox{\fbox{(*\fbox{x()})}[]})}()};
>>
>> Code like this reminds me why I left the C world more than 15 years
>> ago... ;-)
>
> Problem solved by the latex directive. Thanks.
> The C code is from K&R's book. :)
>
> BTW, I also use some code like this in headlines (\textcolor, \fbox),
> where I guess the latex directive can not work. Is there any solutions
> for this situation
The easiest solution would be to save the text as a "box" in latex and
use that box within the headline as the latter would be a simple latex
directive that org would have no problem with. I don't have my latex
book handy but something along the lines of the following should work:
--8<---------------cut here---------------start------------->8---
#+latex: \newsavebox{\complexexpression}
#+latex: \sbox{\complexexpression}{\fbox{\fbox{(*\fbox{\fbox{(*\fbox{x()})}[]})}()}}
* a headline with \usebox{\letterhead}
--8<---------------cut here---------------end--------------->8---
Note that I am not particularly experienced in the use of latex boxes...
> or any better way to colorize the text while also
> support to export to other target (e.g. html)?
No idea, sorry. Maybe others can help here. However, for code blocks
*not* in headlines, you could use source code blocks (#+begin_src
... #+end_src) but I'm not sure how they export to other targets.
--
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.274.gd6aba)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [beamer] a bug in exporting
2011-05-12 22:05 ` Eric S Fraga
@ 2011-05-13 9:40 ` Eric S Fraga
0 siblings, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2011-05-13 9:40 UTC (permalink / raw)
To: zwz; +Cc: emacs-orgmode
Eric S Fraga <e.fraga@ucl.ac.uk> writes:
[...]
> The easiest solution would be to save the text as a "box" in latex and
> use that box within the headline as the latter would be a simple latex
> directive that org would have no problem with. I don't have my latex
> book handy but something along the lines of the following should work:
>
> #+latex: \newsavebox{\complexexpression}
> #+latex: \sbox{\complexexpression}{\fbox{\fbox{(*\fbox{\fbox{(*\fbox{x()})}[]})}()}}
>
> * a headline with \usebox{\letterhead}
That last line should have been:
* a headline with \usebox{\complexexpression}
Sorry!
--
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.274.gd6aba.dirty)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-05-13 9:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-11 13:09 [beamer] a bug in exporting zwz
2011-05-12 7:12 ` Eric S Fraga
2011-05-12 13:26 ` zwz
2011-05-12 22:05 ` Eric S Fraga
2011-05-13 9:40 ` Eric S Fraga
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).