emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Multiple (natural) languages in a single org-file
@ 2012-03-01 10:45 Carlos Russo
  2012-03-01 11:05 ` Carlos Russo
  0 siblings, 1 reply; 7+ messages in thread
From: Carlos Russo @ 2012-03-01 10:45 UTC (permalink / raw)
  To: emacs-orgmode

Hi

Is there a way to accommodate more than one natural language (e.g.
english and portuguese) in a single org-file?

I often prepare presentations in org-mode and export them using LaTeX's
beamer class. There is usually little text and quite some math.
Often I need to recycle an older presentation but using a different
language, i.e. sometimes I prepare something in english, but later I
will need to recycle it using english.

So far, I get around this by defining a custom LaTeX command:
#+LATEX_HEADER: \newcommand{\pt}[1]{} \newcommand{\en}[1]{#1}
or
#+LATEX_HEADER: \newcommand{\pt}[1]{#1} \newcommand{\en}[1]{}

I use this command to write stuff like
* \en{Example: sum of two numbers}\pt{Exemplo: soma de dois números}
\en{Example 1}\pt{Exemplo 1}
\[
3 = 2 + 1
\]
\en{Example 2}\pt{Exemplo 2}
\[
0 = 1 + e^{i\pi}
\]


I then export to pdf. Switching between languages is a matter of
changing the LaTeX header and exporting again.

Is there a more elegant way of doing this? I would like to be able to
export to HTML and ODT...

Carlos

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

* Re: Multiple (natural) languages in a single org-file
  2012-03-01 10:45 Multiple (natural) languages in a single org-file Carlos Russo
@ 2012-03-01 11:05 ` Carlos Russo
  2012-03-01 12:37   ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Carlos Russo @ 2012-03-01 11:05 UTC (permalink / raw)
  To: emacs-orgmode

Oops,

it seems I missed the thread "multilingual presentation with org"
started earlier this month, my apologies for coming back to this topic.

I would like to add that the idea of using a special markup (using some
symbol) that would accept an argument (the language) would be cool.

I'm thinking something like
&en: This shows up only in the english version&
&pt: Hey! This is not portuguese!&
Or even a compound statement
&pt: Português &en: English&fr: Français&

Carlos

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

* Re: Multiple (natural) languages in a single org-file
  2012-03-01 11:05 ` Carlos Russo
@ 2012-03-01 12:37   ` Nicolas Goaziou
  2012-04-11  1:19     ` François Pinard
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2012-03-01 12:37 UTC (permalink / raw)
  To: Carlos Russo; +Cc: emacs-orgmode

Hello,

Carlos Russo <mestre.adamastor@gmail.com> writes:

> I would like to add that the idea of using a special markup (using some
> symbol) that would accept an argument (the language) would be cool.
>
> I'm thinking something like
> &en: This shows up only in the english version&
> &pt: Hey! This is not portuguese!&
> Or even a compound statement
> &pt: Português &en: English&fr: Français&

Just use two different drawer names, and select which one to actually
export through i.e. #+OPTIONS: d:("EN"). No need for extra syntax.


Regards,

-- 
Nicolas Goaziou

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

* Re: Multiple (natural) languages in a single org-file
  2012-03-01 12:37   ` Nicolas Goaziou
@ 2012-04-11  1:19     ` François Pinard
  2012-04-11  5:23       ` Nick Dokos
  2012-04-11  6:18       ` Bastien
  0 siblings, 2 replies; 7+ messages in thread
From: François Pinard @ 2012-04-11  1:19 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Just use two different drawer names, and select which one to actually
> export through i.e. #+OPTIONS: d:("EN"). No need for extra syntax.

Well, the manual says, in node Export options:

     d:         turn on/off inclusion of drawers

So one would never guess from the manual that d: may accept drawer
names.  If what Nicolas suggests is real, the documentation should be
adjusted.  I do not find any other explanation in the manual about
values for the d: option.

François

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

* Re: Multiple (natural) languages in a single org-file
  2012-04-11  1:19     ` François Pinard
@ 2012-04-11  5:23       ` Nick Dokos
  2012-04-11  6:30         ` Bastien
  2012-04-11  6:18       ` Bastien
  1 sibling, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2012-04-11  5:23 UTC (permalink / raw)
  To: =?utf-8?Q?Fran=C3=A7ois?= Pinard; +Cc: emacs-orgmode

François Pinard <pinard@iro.umontreal.ca> wrote:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
> 
> > Just use two different drawer names, and select which one to actually
> > export through i.e. #+OPTIONS: d:("EN"). No need for extra syntax.
> 
> Well, the manual says, in node Export options:
> 
>      d:         turn on/off inclusion of drawers
> 
> So one would never guess from the manual that d: may accept drawer
> names.  If what Nicolas suggests is real, the documentation should be
> adjusted.  I do not find any other explanation in the manual about
> values for the d: option.
> 

Two paragraphs below the d: line you found, the manual says

,----
|    The default values for these and many other options are given by a
| set of variables.  For a list of such variables, the corresponding
| OPTIONS keys and also the publishing keys (*note Project alist::), see
| the constant `org-export-plist-vars'.
`----

Examining the value of org-export-plist-vars shows

,----
|  ...
|  (:drawers "d" org-export-with-drawers)
|  ...
`----

Also, in section 13.1.5, (info "(org) Options for the HTML/LaTeX
exporters"), it says

,----
|  The table below lists these properties along with
| the variable they belong to.  See the documentation string for the
| respective variable for details.
| 
| ...
| `:drawers'              `org-export-with-drawers'
| ...
`----

and examining the doc of org-export-with-drawers (with C-h v) we find:

,----
| Non-nil means export with drawers like the property drawer.
| When t, all drawers are exported.  This may also be a list of
| drawer names to export.
`----

None of this is an argument for leaving the manual as is: if you had a
problem finding the information, then others will too, so the manual
should be improved.

But the information is there, and moreover, learning how to find it in
this instance has the huge advantage of teaching one how to find it for
all the other options as well.  The question as always is how far to go
in documenting all the options: it would be good to document them all
(as Bastien would say: "patches are welcome"), but is it better to learn
searching tricks or to submit patches to improve the doc? Each one of us
would probably answer that question differently (we have different
"breaking points"). So you might prepare a doc patch (please do!) - I
might go on a searching expedition and find things you didn't [fn:1].
The first one benefits everybody, the second one benefits mainly me, but
sometimes I can find a teaching moment and tell other people how to do
something: which is why I spent a half-hour writing this :-) [fn:2]

I think both of these methods (and surely there are other methods as
well) have some value - and some drawbacks as well, but I'll leave that
for another time. 

Nick

Footnotes:

[fn:1] If I think it's easier, I'll search in the sources, rather than
the manual, but that's just me :-) I'm not advocating this as a general
solution of course - otoh, once you have a basic grasp of lisp, it's a
great way to learn how to read programs - real-life, non-trivial
programs at that.

[fn:2] For me, the puzzle aspects are more interesting: I'm not a
"power-user" of org, and I use maybe 1/10 of its capabilities. But when
I'm climbing walls and I need a distraction, a good juicy question on
org-mode is just what the doctor ordered...

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

* Re: Multiple (natural) languages in a single org-file
  2012-04-11  1:19     ` François Pinard
  2012-04-11  5:23       ` Nick Dokos
@ 2012-04-11  6:18       ` Bastien
  1 sibling, 0 replies; 7+ messages in thread
From: Bastien @ 2012-04-11  6:18 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode

Hi François,

pinard@iro.umontreal.ca (François Pinard) writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> Just use two different drawer names, and select which one to actually
>> export through i.e. #+OPTIONS: d:("EN"). No need for extra syntax.
>
> Well, the manual says, in node Export options:
>
>      d:         turn on/off inclusion of drawers
>
> So one would never guess from the manual that d: may accept drawer
> names.  If what Nicolas suggests is real, the documentation should be
> adjusted.  I do not find any other explanation in the manual about
> values for the d: option.

I committed this patch to org.texi:

-d:         @r{turn on/off inclusion of drawers}
+d:         @r{turn on/off inclusion of drawers, or list drawers to include}

Thanks,

-- 
 Bastien

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

* Re: Multiple (natural) languages in a single org-file
  2012-04-11  5:23       ` Nick Dokos
@ 2012-04-11  6:30         ` Bastien
  0 siblings, 0 replies; 7+ messages in thread
From: Bastien @ 2012-04-11  6:30 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: =?utf-8?Q?Fran=C3=A7ois?= Pinard, emacs-orgmode

Hi Nicholas,

(btw, do you prefer "Nick" or "Nicholas"?)

Nick Dokos <nicholas.dokos@hp.com> writes:

> None of this is an argument for leaving the manual as is: if you had a
> problem finding the information, then others will too, so the manual
> should be improved.

Done.

> But the information is there, and moreover, learning how to find it in
> this instance has the huge advantage of teaching one how to find it for
> all the other options as well.  The question as always is how far to go
> in documenting all the options: it would be good to document them all
> (as Bastien would say: "patches are welcome"), but is it better to learn
> searching tricks or to submit patches to improve the doc? Each one of us
> would probably answer that question differently (we have different
> "breaking points"). 

The "how far" question is related to the "where" question.

- The Org compact guide: "vital" options should be there.  This guide
  should also point to the manual for further exploration.

- The Org manual: the most used/useful options should be there.  The
  manual should point to a specific Worg page for more.

- Worg: anything else.

Of course, "vital" and "used/useful" are moving targets, but that's why
we have the mailing list and the discussions.  To shoot them together.

What we really *really* is a good tutorial on how to digg all the
documentation aspects of Emacs.  Basically, how to go from checking the
manual to checking with C-h v and other functions.

Any taker?

> So you might prepare a doc patch (please do!) - I
> might go on a searching expedition and find things you didn't [fn:1].
> The first one benefits everybody, the second one benefits mainly me, but
> sometimes I can find a teaching moment and tell other people how to do
> something: which is why I spent a half-hour writing this :-) [fn:2]

I hope the community realizes how precious are all these hours that you
spent in patiently fighting with everyone issues...  at least here, this
is immensely appreciated!  So, thanks again for this.

-- 
 Bastien

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

end of thread, other threads:[~2012-04-11  6:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 10:45 Multiple (natural) languages in a single org-file Carlos Russo
2012-03-01 11:05 ` Carlos Russo
2012-03-01 12:37   ` Nicolas Goaziou
2012-04-11  1:19     ` François Pinard
2012-04-11  5:23       ` Nick Dokos
2012-04-11  6:30         ` Bastien
2012-04-11  6:18       ` Bastien

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