emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [new exporter] latex-date-timestamp-format not adhering #+LANGUAGE
@ 2013-03-05 12:36 Andreas Leha
  2013-03-06 13:02 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Leha @ 2013-03-05 12:36 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I'd very much like to see org-latex-timestamp-format adhere to a
possibly present #+LANGUAGE setting.

If I set org-latex-timestamp-format to "%A, %Y-%m-%d" the following org
file produces
"Donnerstag, 2013-03-07" on my system, where I'd prefer
"Thursday, 2013-03-07".

#+begin_src org
#+TITLE: Some Document
#+DATE: <2013-03-07 Do>
#+LANGUAGE: en


* Some test document
With some content
#+end_src

Would such a change be possible?

Regards,
Andreas

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

* Re: [new exporter] latex-date-timestamp-format not adhering #+LANGUAGE
  2013-03-05 12:36 [new exporter] latex-date-timestamp-format not adhering #+LANGUAGE Andreas Leha
@ 2013-03-06 13:02 ` Nicolas Goaziou
  2013-03-06 14:02   ` Andreas Leha
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2013-03-06 13:02 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

Hello,

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> I'd very much like to see org-latex-timestamp-format adhere to a
> possibly present #+LANGUAGE setting.

There is no such variable as `org-latex-timestamp-format'.

> If I set org-latex-timestamp-format to "%A, %Y-%m-%d" the following org
> file produces
> "Donnerstag, 2013-03-07" on my system, where I'd prefer
> "Thursday, 2013-03-07".
>
> #+begin_src org
> #+TITLE: Some Document
> #+DATE: <2013-03-07 Do>
> #+LANGUAGE: en
>
>
> * Some test document
> With some content
> #+end_src
>
> Would such a change be possible?

It is difficult.

"%A" depends on a locale built within glibc. Assuming we know the locale
associated to the language string, it may or may not be available in
glibc. Also, `format-time-string' is a primitive, so even if local is
available, you cannot change it locally easily.

A proper implementation would, IMO, not rely directly on
`format-time-string'. There could be a `org-format-time-string'
accepting the same arguments as `format-time-string' but replacing
locale related placeholders beforehand, according to a dictionary.


Regards,

-- 
Nicolas Goaziou

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

* Re: [new exporter] latex-date-timestamp-format not adhering #+LANGUAGE
  2013-03-06 13:02 ` Nicolas Goaziou
@ 2013-03-06 14:02   ` Andreas Leha
  2013-03-06 19:52     ` Achim Gratz
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Leha @ 2013-03-06 14:02 UTC (permalink / raw)
  To: emacs-orgmode

Hi Nicolas,

thanks for taking this up!

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

> Hello,
>
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> I'd very much like to see org-latex-timestamp-format adhere to a
>> possibly present #+LANGUAGE setting.
>
> There is no such variable as `org-latex-timestamp-format'.
>

Of course I meant 'org-latex-date-timestamp-format'.

>> If I set org-latex-timestamp-format to "%A, %Y-%m-%d" the following org
>> file produces
>> "Donnerstag, 2013-03-07" on my system, where I'd prefer
>> "Thursday, 2013-03-07".
>>
>> #+begin_src org
>> #+TITLE: Some Document
>> #+DATE: <2013-03-07 Do>
>> #+LANGUAGE: en
>>
>>
>> * Some test document
>> With some content
>> #+end_src
>>
>> Would such a change be possible?
>
> It is difficult.
>
> "%A" depends on a locale built within glibc. Assuming we know the locale
> associated to the language string, it may or may not be available in
> glibc. Also, `format-time-string' is a primitive, so even if local is
> available, you cannot change it locally easily.

I understand.

>
> A proper implementation would, IMO, not rely directly on
> `format-time-string'. There could be a `org-format-time-string'
> accepting the same arguments as `format-time-string' but replacing
> locale related placeholders beforehand, according to a dictionary.
>

That sound quite tedious and boring work...

And while I still think, that setting the #+LANGUAGE in org should
ideally be reflected in the export -- also for the date formatting -- I
found a solution to my problem that I use now: It does not use orgmode's
date and date-formatting facilities, but moves the work to LaTeX.  Thus, the
bad side is that it is backend specific.

#+begin_src org
#+TITLE: Some Document
#+DATE: \printdate{2013-03-07}
#+LANGUAGE: en
#+LaTeX_HEADER: \usepackage[english]{isodate}

* Some test document
With some content
#+end_src

vs.

#+begin_src org
#+TITLE: Some Document
#+DATE: \printdate{2013-03-07}
#+LANGUAGE: en
#+LaTeX_HEADER: \usepackage[german]{isodate}

* Some test document
With some content
#+end_src

Regards,
Andreas

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

* Re: [new exporter] latex-date-timestamp-format not adhering #+LANGUAGE
  2013-03-06 14:02   ` Andreas Leha
@ 2013-03-06 19:52     ` Achim Gratz
  2013-03-06 21:37       ` Andreas Leha
  0 siblings, 1 reply; 5+ messages in thread
From: Achim Gratz @ 2013-03-06 19:52 UTC (permalink / raw)
  To: emacs-orgmode

Andreas Leha writes:
> And while I still think, that setting the #+LANGUAGE in org should
> ideally be reflected in the export -- also for the date formatting -- I
> found a solution to my problem that I use now: It does not use orgmode's
> date and date-formatting facilities, but moves the work to LaTeX.  Thus, the
> bad side is that it is backend specific.

Well, you could bounce this via Babel to the shell, set LANG and run the
date command with the appropriate format string and pull it back into
org, perhaps as a macro.  That makes it not play well with pure Windows
where there is no locale setting per command and no date command (unless
you install Cygwin), but it isn't langage specific anymore.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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

* Re: [new exporter] latex-date-timestamp-format not adhering #+LANGUAGE
  2013-03-06 19:52     ` Achim Gratz
@ 2013-03-06 21:37       ` Andreas Leha
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Leha @ 2013-03-06 21:37 UTC (permalink / raw)
  To: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> Andreas Leha writes:
>> And while I still think, that setting the #+LANGUAGE in org should
>> ideally be reflected in the export -- also for the date formatting -- I
>> found a solution to my problem that I use now: It does not use orgmode's
>> date and date-formatting facilities, but moves the work to LaTeX.  Thus, the
>> bad side is that it is backend specific.
>
> Well, you could bounce this via Babel to the shell, set LANG and run the
> date command with the appropriate format string and pull it back into
> org, perhaps as a macro.  That makes it not play well with pure Windows
> where there is no locale setting per command and no date command (unless
> you install Cygwin), but it isn't langage specific anymore.

Thanks for the suggestion.  I like the idea a lot and will follow it up,
I think.

Regards,
Andreas

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

end of thread, other threads:[~2013-03-06 21:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-05 12:36 [new exporter] latex-date-timestamp-format not adhering #+LANGUAGE Andreas Leha
2013-03-06 13:02 ` Nicolas Goaziou
2013-03-06 14:02   ` Andreas Leha
2013-03-06 19:52     ` Achim Gratz
2013-03-06 21:37       ` Andreas Leha

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