emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to customize date export
@ 2014-01-31 18:21 Mirko Vukovic
  2014-02-02 19:33 ` Eric S Fraga
  0 siblings, 1 reply; 7+ messages in thread
From: Mirko Vukovic @ 2014-01-31 18:21 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I could not figure out how to customize org's export of dates into latex.

I found org-export-date-timestamp-format, but that works only for the DATE
keyword.  

What can work on all date-stamps in the document?

Thanks,

Mirko

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

* Re: how to customize date export
  2014-01-31 18:21 how to customize date export Mirko Vukovic
@ 2014-02-02 19:33 ` Eric S Fraga
  2014-02-03 15:15   ` Mirko Vukovic
  0 siblings, 1 reply; 7+ messages in thread
From: Eric S Fraga @ 2014-02-02 19:33 UTC (permalink / raw)
  To: Mirko Vukovic; +Cc: emacs-orgmode

Mirko Vukovic <mirko.vukovic@gmail.com> writes:

> Hello,
>
> I could not figure out how to customize org's export of dates into latex.
>
> I found org-export-date-timestamp-format, but that works only for the DATE
> keyword.  
>
> What can work on all date-stamps in the document?

Have a look at

,----[ C-h v org-latex-active-timestamp-format RET ]
| org-latex-active-timestamp-format is a variable defined in `ox-latex.el'.
| Its value is "\\textit{%s}"
| 
| Documentation:
| A printf format string to be applied to active timestamps.
| 
| You can customize this variable.
| 
| [back]
`----

and 

,----[ C-h v org-latex-inactive-timestamp-format RET ]
| org-latex-inactive-timestamp-format is a variable defined in `ox-latex.el'.
| Its value is "\\textit{%s}"
| 
| Documentation:
| A printf format string to be applied to inactive timestamps.
| 
| You can customize this variable.
| 
| [back]
`----

but these are quite different in intent when compared with
org-export-date-timestamp-format so they may not be what you want.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.2.5h-585-g5f0ca0

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

* Re: how to customize date export
  2014-02-02 19:33 ` Eric S Fraga
@ 2014-02-03 15:15   ` Mirko Vukovic
  2014-02-03 16:11     ` Eric S Fraga
  0 siblings, 1 reply; 7+ messages in thread
From: Mirko Vukovic @ 2014-02-03 15:15 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga <at> ucl.ac.uk> writes:

> 
> Mirko Vukovic <mirko.vukovic <at> gmail.com> writes:
> 
> > Hello,
> >
> > I could not figure out how to customize org's export of dates into latex.
> >
> > I found org-export-date-timestamp-format, but that works only for the DATE
> > keyword.  
> >
> > What can work on all date-stamps in the document?
> 
> Have a look at
> 
> ,----[ C-h v org-latex-active-timestamp-format RET ]
> | org-latex-active-timestamp-format is a variable defined in `ox-latex.el'.
> | Its value is "\\textit{%s}"
snip
> 
> and 
> 
> ,----[ C-h v org-latex-inactive-timestamp-format RET ]
> | org-latex-inactive-timestamp-format is a variable defined in `ox-latex.el'.
> | Its value is "\\textit{%s}"
snip
> but these are quite different in intent when compared with
> org-export-date-timestamp-format so they may not be what you want.
> 

Hi Eric,

Thanks for the note.  As it stands now, I cannot
customize these two variables to do what I want, as they accept the
whole time-steamp as argument.  I will enter the dates manually
in the org file for now.

Maybe they ought to be re-cast in manner similar to which
org-export-date-timestamp-format is handled?  A nice weekend project :-)

Mirko

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

* Re: how to customize date export
  2014-02-03 15:15   ` Mirko Vukovic
@ 2014-02-03 16:11     ` Eric S Fraga
  2014-02-03 18:08       ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Eric S Fraga @ 2014-02-03 16:11 UTC (permalink / raw)
  To: Mirko Vukovic; +Cc: emacs-orgmode

Mirko Vukovic <mirko.vukovic@gmail.com> writes:

[...]

> Hi Eric,
>
> Thanks for the note.  As it stands now, I cannot
> customize these two variables to do what I want, as they accept the
> whole time-steamp as argument.  I will enter the dates manually
> in the org file for now.

I thought as much.  

Looking through the code, some of the functions for outputting the time
stamps make use of org-translate-time which does allow some
customisation of how the dates and times are written out, along the
lines of what you were looking at for DATE entries.  Check the
documentation for that function.  But it could be I've misunderstood the
code...


-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.4-322-gece429

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

* Re: how to customize date export
  2014-02-03 16:11     ` Eric S Fraga
@ 2014-02-03 18:08       ` Nick Dokos
  2014-02-04 18:45         ` Eric S Fraga
  2014-02-04 21:48         ` Rasmus
  0 siblings, 2 replies; 7+ messages in thread
From: Nick Dokos @ 2014-02-03 18:08 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> Mirko Vukovic <mirko.vukovic@gmail.com> writes:
>
> [...]
>
>> Hi Eric,
>>
>> Thanks for the note.  As it stands now, I cannot
>> customize these two variables to do what I want, as they accept the
>> whole time-steamp as argument.  I will enter the dates manually
>> in the org file for now.
>
> I thought as much.  
>
> Looking through the code, some of the functions for outputting the time
> stamps make use of org-translate-time which does allow some
> customisation of how the dates and times are written out, along the
> lines of what you were looking at for DATE entries.  Check the
> documentation for that function.  But it could be I've misunderstood the
> code...

Based on Eric's hint, I followed org-translate-time's docstring (and
references therein) and I came up with this which seems to work (in the
sense that the dates look like <2014/02/03 Monday> when exported,
which agrees with the specified format):

--8<---------------cut here---------------start------------->8---
#+STARTUP: customtime

* foo
<2014-02-03 Mon>

# Local Variables:
# org-time-stamp-custom-formats: ("<%Y/%m/%d %A>" . "<%Y/%m/%d %A %H:%M>")
# End:
--8<---------------cut here---------------end--------------->8---

However, the angle brackets seem to be required.

Nick

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

* Re: how to customize date export
  2014-02-03 18:08       ` Nick Dokos
@ 2014-02-04 18:45         ` Eric S Fraga
  2014-02-04 21:48         ` Rasmus
  1 sibling, 0 replies; 7+ messages in thread
From: Eric S Fraga @ 2014-02-04 18:45 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

[...]

> Based on Eric's hint, I followed org-translate-time's docstring (and
> references therein) and I came up with this which seems to work (in the
> sense that the dates look like <2014/02/03 Monday> when exported,
> which agrees with the specified format):
>
> #+STARTUP: customtime
>
> * foo
> <2014-02-03 Mon>
>
> # Local Variables:
> # org-time-stamp-custom-formats: ("<%Y/%m/%d %A>" . "<%Y/%m/%d %A %H:%M>")
> # End:
>
> However, the angle brackets seem to be required.
>
> Nick

I'm glad my hint was helpful.  Interestingly, the angle brackets are not
required per se.  However, there does have to be some character there,
in both places, and that character is replaced by an angle bracket on
export (and probably on display as well but I am using BIND instead of
local variable settings to set the custom format).
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.5h-585-g5f0ca0

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

* Re: how to customize date export
  2014-02-03 18:08       ` Nick Dokos
  2014-02-04 18:45         ` Eric S Fraga
@ 2014-02-04 21:48         ` Rasmus
  1 sibling, 0 replies; 7+ messages in thread
From: Rasmus @ 2014-02-04 21:48 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> Mirko Vukovic <mirko.vukovic@gmail.com> writes:
>>
>> [...]
>>
>>> Hi Eric,
>>>
>>> Thanks for the note.  As it stands now, I cannot
>>> customize these two variables to do what I want, as they accept the
>>> whole time-steamp as argument.  I will enter the dates manually
>>> in the org file for now.
>>
>> I thought as much.  
>>
>> Looking through the code, some of the functions for outputting the time
>> stamps make use of org-translate-time which does allow some
>> customisation of how the dates and times are written out, along the
>> lines of what you were looking at for DATE entries.  Check the
>> documentation for that function.  But it could be I've misunderstood the
>> code...
>
> Based on Eric's hint, I followed org-translate-time's docstring (and
> references therein) and I came up with this which seems to work (in the
> sense that the dates look like <2014/02/03 Monday> when exported,
> which agrees with the specified format):
>
> #+STARTUP: customtime
>
> * foo
> <2014-02-03 Mon>
>
> # Local Variables:
> # org-time-stamp-custom-formats: ("<%Y/%m/%d %A>" . "<%Y/%m/%d %A %H:%M>")
> # End:
>
> However, the angle brackets seem to be required.

You could use a filter to get rid of the angle brackets for instance
org-export-filter-timestamp-functions.  There's also parse-time-string
together with the relevant DATE-formatting variables that can be used
to recast the appearance of time.

—Rasmus

-- 
Dung makes an excellent fertilizer

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

end of thread, other threads:[~2014-02-04 21:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-31 18:21 how to customize date export Mirko Vukovic
2014-02-02 19:33 ` Eric S Fraga
2014-02-03 15:15   ` Mirko Vukovic
2014-02-03 16:11     ` Eric S Fraga
2014-02-03 18:08       ` Nick Dokos
2014-02-04 18:45         ` Eric S Fraga
2014-02-04 21:48         ` Rasmus

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