emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Export datetree item subtree with its date, not the file's


From: Kyle Meyer
Subject: Re: [O] Export datetree item subtree with its date, not the file's
Date: Wed, 21 Oct 2015 01:50:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Göktuğ Kayaalp <address@hidden> writes:

> Hello,
>
> Thanks  for your  response.  As  you suggest,  I switched  to using  the
> EXPORT_DATE property.  It works as expected.
>
> Now a little problem  that I have is that I  cannot have timestamps like
> «10 September 2015» in my exports, but a literal inactive timestamp.

> This is because in  the related capture template, I have  to use `%u' to
> add a timestamp, which adds an inactive timestamp, reusing the date that
> I entered into  the datetree prompt.  There is the  %<...> directive for
> the capture  templates which allows  me to put in  a time format,  as in
> `format-time-string',  but it  gets its  value from  `current-time', not
> from the date  of the datetree prompt.  Now  I do not know if  this is a
> feature or  a bug, but if  I want to  copy over lecture notes  from some
> time ago, it's a problem.

Perhaps someone can suggest a better method, but what about adding an
export filter that formats inactive timestamps the way you want?
Something like

    (setq org-latex-inactive-timestamp-format "%s")
    
    (defun u/format-inactive-timestamp (text backend info)
      (when (org-export-derived-backend-p backend 'latex)
        (format-time-string
         "%D" (apply #'encode-time (org-parse-time-string text)))))
    
    (add-to-list 'org-export-filter-timestamp-functions
                 'u/format-inactive-timestamp)

--
Kyle



reply via email to

[Prev in Thread] Current Thread [Next in Thread]