emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Beamer export ignoring org-beamer-environments-extra?
@ 2013-04-20  4:25 James Harkins
  2013-04-20  6:14 ` James Harkins
  0 siblings, 1 reply; 4+ messages in thread
From: James Harkins @ 2013-04-20  4:25 UTC (permalink / raw)
  To: Emacs-orgmode@gnu.org

Hi,

I'm trying to use the (new) beamer exporter with Chinese characters.
I've installed the CJK package, and I can render a very simple
article-class document with Chinese characters, no problem. But I
haven't been able to replicate that successful result by exporting an
org file to LaTeX/beamer.

The problem may be a general one concerning org-beamer-environments-extra.

Any portion of the document containing Chinese characters should be
enclosed within a CJK environment. Reading ox-beamer.el, I see that I
can customize Org Beamer Environments Extra. After customizing, C-h v
org-beamer-environments-extra shows me:

(("CJK" "Z" "\\begin{CJK}%a%h" "\\end{CJK}"))

But:

* One section
** One frame
*** One block      :B_CJK:
    :PROPERTIES:
    :BEAMER_env: CJK
    :BEAMER_envargs: gbsn
    :END:
    - One list item

-->

\section[One section]{One section}
\label{sec-1}
\begin{frame}[label=sec-1-1]{One frame}
\begin{itemize}
\item One list item
\end{itemize}
\end{frame}
% Generated by Org mode 8.0-pre in Emacs 23.3.1.
\end{document}

Whoa, wait a minute... it has completely omitted the CJK environment!

It appears that I've followed the format for the extra environment
correctly. It's possible that I've done something wrong, but it could
also be a bug.

??

Org-mode version 8.0-pre (release_8.0-pre-215-g8ccbc7 @
/home/dlm/share/org-mode.git/lisp/)

hjh

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

* Re: Beamer export ignoring org-beamer-environments-extra?
  2013-04-20  4:25 Beamer export ignoring org-beamer-environments-extra? James Harkins
@ 2013-04-20  6:14 ` James Harkins
  2013-04-20  6:33   ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: James Harkins @ 2013-04-20  6:14 UTC (permalink / raw)
  To: Emacs-orgmode@gnu.org

On Sat, Apr 20, 2013 at 12:25 PM, James Harkins <jamshark70@gmail.com> wrote:
> The problem may be a general one concerning org-beamer-environments-extra.
>
> Any portion of the document containing Chinese characters should be
> enclosed within a CJK environment. Reading ox-beamer.el, I see that I
> can customize Org Beamer Environments Extra. After customizing, C-h v
> org-beamer-environments-extra shows me:
>
> (("CJK" "Z" "\\begin{CJK}%a%h" "\\end{CJK}"))
... snip
> Whoa, wait a minute... it has completely omitted the CJK environment!

OK, after a bite for lunch, I see what the problem is.

The CJK environment, in the LaTeX code, must be specified with all
capital letters. (I tried changing the simple test file to say
"\begin{cjk}" and LaTeX failed, complaining of an unknown environment.
The test file does include "\usepackage{CJK}" and it works with
"\begin{CJK}" so the lowercase definitely means "misspelled" here.)

The Beamer exporter assumes that environment names will be all lowercase:

 ;; Use specified environment.
 (t (downcase env)))))

I added my entry into org-beamer-environments-extra with the name
"CJK" -- so, when org-beamer-- format-block looks up the environment's
formatting spec according to the down-cased name "cjk," it finds
nothing and then does not render the environment. But, if I were to
name the environment-extra as "cjk," then the exporter would write
"\begin{cjk}" which I've already found will break.

I will temporarily work around the problem by removing "downcase."
That should get me going for the slides I need to prepare today and
tomorrow. But there must be a more elegant solution. I'm not sure what
that is, but I am certain that it is not safe to assume environments
will always be named using only lowercase letters.

One more reason to fix: There is one out-of-the-box environment,
noteNH, which includes capital letters in the name. This one is also
broken -- does not appear in the output. I.e., you can encounter the
bug without customizing anything.

hjh

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

* Re: Beamer export ignoring org-beamer-environments-extra?
  2013-04-20  6:14 ` James Harkins
@ 2013-04-20  6:33   ` Nicolas Goaziou
  2013-04-20 11:02     ` James Harkins
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2013-04-20  6:33 UTC (permalink / raw)
  To: jamshark70; +Cc: Emacs-orgmode@gnu.org

Hello,

James Harkins <jamshark70@gmail.com> writes:

> The Beamer exporter assumes that environment names will be all lowercase:
>
>  ;; Use specified environment.
>  (t (downcase env)))))

It should now be fixed. Thank you for the detailed report.


Regards,

-- 
Nicolas Goaziou

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

* Re: Beamer export ignoring org-beamer-environments-extra?
  2013-04-20  6:33   ` Nicolas Goaziou
@ 2013-04-20 11:02     ` James Harkins
  0 siblings, 0 replies; 4+ messages in thread
From: James Harkins @ 2013-04-20 11:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Emacs-orgmode@gnu.org

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

On Apr 20, 2013 2:34 PM, "Nicolas Goaziou" <n.goaziou@gmail.com> wrote:
> James Harkins <jamshark70@gmail.com> writes:
>
> > The Beamer exporter assumes that environment names will be all
lowercase:
> >
> >  ;; Use specified environment.
> >  (t (downcase env)))))
>
> It should now be fixed. Thank you for the detailed report.

I'm not able to test again right now, but in my earlier testing, simply
removing downcase was ok for my CJK extra but the export failed for noteNH
(something about stringp). It's worth testing that.

This turns out to have been quite an adventure anyway. I've been using the
Ubuntu packages for latex, which date back to 2009, and CJK itself isn't
getting a lot of developer attention. Consensus online seemed to be to
upgrade, so now I'm in the middle of 8-9 hours of downloads from texlive.
If I'm lucky, I *might* be able to try another beamer export right around
bedtime (7 pm now). :-|

hjh

[-- Attachment #2: Type: text/html, Size: 1203 bytes --]

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

end of thread, other threads:[~2013-04-20 11:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-20  4:25 Beamer export ignoring org-beamer-environments-extra? James Harkins
2013-04-20  6:14 ` James Harkins
2013-04-20  6:33   ` Nicolas Goaziou
2013-04-20 11:02     ` James Harkins

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