emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Switch language on heading lines in Latex export (was Re: Re: org-beamer: How to get items appear sequentially rather than all at once)
@ 2010-03-25  3:50 Christian Wittern
  2010-03-25 11:02 ` Darlan Cavalcante Moreira
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Wittern @ 2010-03-25  3:50 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira; +Cc: Org Mode Mailing List

Dear Darlan,

Thanks for your detailed explanation.  I now got it working and am
really happy with it.

Now there is one remaining problem with my presentation (which is
different, which is why I changed the header line):  I do have some
words on some heading line that are in a different language and need
to be set in a different font.  To achieve that, I have customized the
beamer section in org-export-latex-classes to set up a new font etc,
this can now be switched on with {\J XX } to put XX into the desired
Japanese Font.   However, when I do this, I get the {} brackets
escaped so they appear in the output (I do get the right font).  So I
wonder how I can pass this literal LaTeX through in the export.

I looked at the manual, where it talks about literal LaTeX,  but the
use cases there seem to work only on lines by themselves, not in the
middle of a header line.  But since this is org-mode, I am sure there
must be a (obvious) solution which I am just failing to see....

As always, any help appreciated

Christian


-- 
Christian Wittern, Kyoto

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

* Re: Switch language on heading lines in Latex export (was Re: Re: org-beamer: How to get items appear sequentially rather than all at once)
  2010-03-25  3:50 Switch language on heading lines in Latex export (was Re: Re: org-beamer: How to get items appear sequentially rather than all at once) Christian Wittern
@ 2010-03-25 11:02 ` Darlan Cavalcante Moreira
  2010-03-25 12:48   ` Christian Wittern
  0 siblings, 1 reply; 4+ messages in thread
From: Darlan Cavalcante Moreira @ 2010-03-25 11:02 UTC (permalink / raw)
  To: Christian Wittern; +Cc: Org Mode Mailing List


I think this behavior in org-mode is correct.
For instance, suppose we have the heading below
,----
| * Some heading
|   - \textbf{lalala}
|   - {\textbf lelele}
|   - \alert{lilili}
`----

In the first item org will recognize this is a Latex command and the
brackets will be passed to Latex without any escaping. However, in the
second item there is nothing before the first bracket and org will
correctly escape the bracket. Therefore only the first letter in "lelele"
will be in bold. That is, org recognizes Latex syntax and not the old TeX
syntax in the second item. Any command recognized in Beamer will work as
the alert command in the third item.

Summarizing, define your macros as Latex macros instead of TeX ones and
they should work. That is, something like \J{XXX}.

 - Darlan

At Thu, 25 Mar 2010 12:50:23 +0900,
Christian Wittern <cwittern@gmail.com> wrote:
> 
> Dear Darlan,
> 
> Thanks for your detailed explanation.  I now got it working and am
> really happy with it.
> 
> Now there is one remaining problem with my presentation (which is
> different, which is why I changed the header line):  I do have some
> words on some heading line that are in a different language and need
> to be set in a different font.  To achieve that, I have customized the
> beamer section in org-export-latex-classes to set up a new font etc,
> this can now be switched on with {\J XX } to put XX into the desired
> Japanese Font.   However, when I do this, I get the {} brackets
> escaped so they appear in the output (I do get the right font).  So I
> wonder how I can pass this literal LaTeX through in the export.
> 
> I looked at the manual, where it talks about literal LaTeX,  but the
> use cases there seem to work only on lines by themselves, not in the
> middle of a header line.  But since this is org-mode, I am sure there
> must be a (obvious) solution which I am just failing to see....
> 
> As always, any help appreciated
> 
> Christian
> 
> 
> -- 
> Christian Wittern, Kyoto

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

* Re: Switch language on heading lines in Latex export (was Re:  Re: org-beamer: How to get items appear sequentially rather than all at once)
  2010-03-25 11:02 ` Darlan Cavalcante Moreira
@ 2010-03-25 12:48   ` Christian Wittern
  2010-03-26 13:51     ` Darlan Cavalcante Moreira
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Wittern @ 2010-03-25 12:48 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira; +Cc: Org Mode Mailing List

Darlan,

Thank you again.  I think I understand the problem now.

On 2010-03-25 20:02, Darlan Cavalcante Moreira wrote:
> Summarizing, define your macros as Latex macros instead of TeX ones and
> they should work. That is, something like \J{XXX}.
>    

Currently, the definition is
\newfontfamily{\J}[Scale=0.85]{Osaka}

If I say \J{XX} in my documents, org-mode's latex export does the right 
thing and I get what I need, so does this definition as you call it also 
define a LaTeX macro?  Or is this just pure luck?  Still mystified by 
all this, but very glad that I can say goodbye to WYSWIG presentation 
software:-)

All the best,

Christian

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

* Re: Switch language on heading lines in Latex export (was Re: Re: org-beamer: How to get items appear sequentially rather than all at once)
  2010-03-25 12:48   ` Christian Wittern
@ 2010-03-26 13:51     ` Darlan Cavalcante Moreira
  0 siblings, 0 replies; 4+ messages in thread
From: Darlan Cavalcante Moreira @ 2010-03-26 13:51 UTC (permalink / raw)
  To: Christian Wittern; +Cc: Org Mode Mailing List


As I understand, whenever org sees something like "\something" it will
understand that this is a latex command and it will just write it as it is
in the exported latex file. Therefore, if you put something like
#+LATEX_HEADER: \newcommand{\blue}[1] {\textcolor{blue}{#1}}
in the beginning of the org file than latex will know the command "blue"
and writing "\blue{some text}" in the org presentation will work as
expected. I even tried defining latex commands with two arguments such as
the with the line below
#+LATEX_HEADER: \newcommand{\blueRed}[2]{\textcolor{blue}{#1} \textcolor{red}{#2}}
and it works!

I don't know this newfontfamily command in latex, but if you can use a
command in latex then you can do the same in org.

Notice, however, that I used "#+LATEX_HEADER:". That is, I created a macro
in Latex, not in org. Macros defined in org are created with "#+MACRO:".

 - Darlan

At Thu, 25 Mar 2010 21:48:07 +0900,
Christian Wittern <cwittern@gmail.com> wrote:
> 
> Darlan,
> 
> Thank you again.  I think I understand the problem now.
> 
> On 2010-03-25 20:02, Darlan Cavalcante Moreira wrote:
> > Summarizing, define your macros as Latex macros instead of TeX ones and
> > they should work. That is, something like \J{XXX}.
> >    
> 
> Currently, the definition is
> \newfontfamily{\J}[Scale=0.85]{Osaka}
> 
> If I say \J{XX} in my documents, org-mode's latex export does the right 
> thing and I get what I need, so does this definition as you call it also 
> define a LaTeX macro?  Or is this just pure luck?  Still mystified by 
> all this, but very glad that I can say goodbye to WYSWIG presentation 
> software:-)
> 
> All the best,
> 
> Christian
> 

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

end of thread, other threads:[~2010-03-26 13:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-25  3:50 Switch language on heading lines in Latex export (was Re: Re: org-beamer: How to get items appear sequentially rather than all at once) Christian Wittern
2010-03-25 11:02 ` Darlan Cavalcante Moreira
2010-03-25 12:48   ` Christian Wittern
2010-03-26 13:51     ` Darlan Cavalcante Moreira

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