emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Export datetree item subtree with its date, not the file's
@ 2015-10-02  9:49 Göktuğ Kayaalp
  2015-10-17  7:33 ` Kyle Meyer
  0 siblings, 1 reply; 5+ messages in thread
From: Göktuğ Kayaalp @ 2015-10-02  9:49 UTC (permalink / raw)
  To: Org-mode mailing list

Hi,

This is my  first post to this  group, so I'm sorry if  I'm skipping any
conventions.  And sorry for the dense subject line,  I didn't want it to
be too long.  Thanks a lot for the hard work on org-mode.

I have  started recently to organise  my lecture notes into  a datetree.
Every now and then I have to  export my notes, usually to pdfs, in order
to share them with friends, or  study/read myself in printed form.  Now,
when I export to pdf an  item, the "\maketitle" header contains the date
from the file's "#+DATE:" thing[1].  I'd like it to contain the date for
the current  item, i.e. if  it is  under the "***  2015-09-16 Wednesday"
heading, the pdf to have "16 Sep 2015".   Now I guess that I can do some
temporary-buffer hack to make this happen, but I wonder if there already
exist a /normal/ way to achieve this.

My overall structure is like this:

    # $Id: Italianistica.org,v 1.5 2015/09/30 18:08:27 gk Exp gk $
    #+TITLE: Appunti di Italianistica
    #+STARTUP: contents
    #+OPTIONS: toc:nil tags:nil
    #+LaTeX_CLASS: gk-appunto
    #+DATE:
    * 2015
    ** 2015-09 September
    *** 2015-09-16 Wednesday
    **** İtalyanca Dil Uygulamaları I :2015_2016:ITDE2016:
    [2015-09-16 Wed]
    
    amare \ne voler bene
    
    _amare_ si usa quasi sempre _all'interno di una coppia_
    
    _voler bene_ si usa tra _amici, parenti, ecc._


When  I export-subtree  the bottommost  entry, I  want the  date in  the
exported pdf  to be 2015-09-16,  not today,  nor the date  in "#+DATE:",
which is  deliberately empty to  not let a wrong  date to appear  in the
exported file.

I tried  setting a date property  which didn't have an  effect, and also
adding a "#+DATE:  [a date...]" under every lecture  note entry heading,
in which case the  date of the last entry in the file  got used, so if I
exported the notes from 2015-09-16, and the last time I added a note was
the 19th, the exported file had the date 2015-09-19.

So how can I, if I can at all, achieve what I want without tucking the
tree into a temp buffer, adding the correct #+DATE into it, copying the
org header and exporting?  Is there a standard way to achieve this?

Thanks in advance,
-goktug



[1] Property?  I don't really know what these are called.

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

* Re: Export datetree item subtree with its date, not the file's
  2015-10-02  9:49 Export datetree item subtree with its date, not the file's Göktuğ Kayaalp
@ 2015-10-17  7:33 ` Kyle Meyer
  2015-10-20 14:49   ` Göktuğ Kayaalp
  0 siblings, 1 reply; 5+ messages in thread
From: Kyle Meyer @ 2015-10-17  7:33 UTC (permalink / raw)
  To: Göktuğ Kayaalp; +Cc: Org-mode mailing list

Hello,

self@gkayaalp.com (Göktuğ Kayaalp) writes:

> Hi,
>
> This is my  first post to this  group, so I'm sorry if  I'm skipping any
> conventions.

Welcome to the list.  Sorry for the lack of responses to your post.
It's a high traffic list, and sometimes posts fall through.

> My overall structure is like this:
[...]
>     #+DATE:
>     * 2015
>     ** 2015-09 September
>     *** 2015-09-16 Wednesday
>     **** İtalyanca Dil Uygulamaları I :2015_2016:ITDE2016:
>     [2015-09-16 Wed]
[...]
> When  I export-subtree  the bottommost  entry, I  want the  date in  the
> exported pdf  to be 2015-09-16,  not today,  nor the date  in "#+DATE:",
> which is  deliberately empty to  not let a wrong  date to appear  in the
> exported file.
>
> I tried  setting a date property  which didn't have an  effect, and also
> adding a "#+DATE:  [a date...]" under every lecture  note entry heading,
> in which case the  date of the last entry in the file  got used, so if I
> exported the notes from 2015-09-16, and the last time I added a note was
> the 19th, the exported file had the date 2015-09-19.

Have you tried the EXPORT_DATE property?  I believe it'd look something
like this

    * 2015
    ** 2015-09 September
    *** 2015-09-16 Wednesday
    **** İtalyanca Dil Uygulamaları I :2015_2016:ITDE2016:
    :PROPERTIES:
    :EXPORT_DATE: 2015-09-16
    :END:

which you could export using with export scope set to "subtree".

--
Kyle

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

* Re: Export datetree item subtree with its date, not the file's
  2015-10-17  7:33 ` Kyle Meyer
@ 2015-10-20 14:49   ` Göktuğ Kayaalp
  2015-10-21  5:50     ` Kyle Meyer
  2015-10-21  8:42     ` Eric S Fraga
  0 siblings, 2 replies; 5+ messages in thread
From: Göktuğ Kayaalp @ 2015-10-20 14:49 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: Org-mode mailing list

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.

-gk

On Sat, Oct 17 2015 at 10:33:08 am EEST, Kyle Meyer <kyle@kyleam.com> wrote:
> Hello,
>
> self@gkayaalp.com (Göktuğ Kayaalp) writes:
>
>> Hi,
>>
>> This is my  first post to this  group, so I'm sorry if  I'm skipping any
>> conventions.
>
> Welcome to the list.  Sorry for the lack of responses to your post.
> It's a high traffic list, and sometimes posts fall through.
>
>> My overall structure is like this:
> [...]
>>     #+DATE:
>>     * 2015
>>     ** 2015-09 September
>>     *** 2015-09-16 Wednesday
>>     **** İtalyanca Dil Uygulamaları I :2015_2016:ITDE2016:
>>     [2015-09-16 Wed]
> [...]
>> When  I export-subtree  the bottommost  entry, I  want the  date in  the
>> exported pdf  to be 2015-09-16,  not today,  nor the date  in "#+DATE:",
>> which is  deliberately empty to  not let a wrong  date to appear  in the
>> exported file.
>>
>> I tried  setting a date property  which didn't have an  effect, and also
>> adding a "#+DATE:  [a date...]" under every lecture  note entry heading,
>> in which case the  date of the last entry in the file  got used, so if I
>> exported the notes from 2015-09-16, and the last time I added a note was
>> the 19th, the exported file had the date 2015-09-19.
>
> Have you tried the EXPORT_DATE property?  I believe it'd look something
> like this
>
>     * 2015
>     ** 2015-09 September
>     *** 2015-09-16 Wednesday
>     **** İtalyanca Dil Uygulamaları I :2015_2016:ITDE2016:
>     :PROPERTIES:
>     :EXPORT_DATE: 2015-09-16
>     :END:
>
> which you could export using with export scope set to "subtree".
>
> --
> Kyle

-- 
İ. Göktuğ Kayaalp.
http://gkayaalp.com/

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

* Re: Export datetree item subtree with its date, not the file's
  2015-10-20 14:49   ` Göktuğ Kayaalp
@ 2015-10-21  5:50     ` Kyle Meyer
  2015-10-21  8:42     ` Eric S Fraga
  1 sibling, 0 replies; 5+ messages in thread
From: Kyle Meyer @ 2015-10-21  5:50 UTC (permalink / raw)
  To: Göktuğ Kayaalp; +Cc: Org-mode mailing list

Göktuğ Kayaalp <self@gkayaalp.com> 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

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

* Re: Export datetree item subtree with its date, not the file's
  2015-10-20 14:49   ` Göktuğ Kayaalp
  2015-10-21  5:50     ` Kyle Meyer
@ 2015-10-21  8:42     ` Eric S Fraga
  1 sibling, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2015-10-21  8:42 UTC (permalink / raw)
  To: Göktuğ Kayaalp; +Cc: Kyle Meyer, Org-mode mailing list

On Tuesday, 20 Oct 2015 at 17:49, Göktuğ Kayaalp wrote:
> 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.

If I understand you correctly, this is now a formatting issue for the
PDF export?  If so, look at

,----[ 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.
`----

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.2-164-g50a182

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

end of thread, other threads:[~2015-10-21  8:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-02  9:49 Export datetree item subtree with its date, not the file's Göktuğ Kayaalp
2015-10-17  7:33 ` Kyle Meyer
2015-10-20 14:49   ` Göktuğ Kayaalp
2015-10-21  5:50     ` Kyle Meyer
2015-10-21  8:42     ` Eric S Fraga

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