Re: using header data in document

2020-09-17 Thread Eric S Fraga
On Wednesday, 16 Sep 2020 at 19:14, Emanuel Berg via "General discussions about 
Org-mode." wrote:
> Eric S Fraga wrote:
>
>> what does your #+date: line look like? Is it
>> a single time stamp? If it is not, all of the above
>> would return the same thing.
>
> I don't have that line.

So there is no timestamp and the {{{date}}} macro cannot do anything
with no information.  

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e



Re: using header data in document

2020-09-16 Thread General discussions about Org-mode.
Eric S Fraga wrote:

> what does your #+date: line look like? Is it
> a single time stamp? If it is not, all of the above
> would return the same thing.

I don't have that line.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: using header data in document

2020-09-16 Thread Eric S Fraga
On Wednesday, 16 Sep 2020 at 17:56, Emanuel Berg via "General discussions about 
Org-mode." wrote:
> Eric S Fraga wrote:
>> The documentation that you have in your post says
>> that this works only if the actual date given in
>> the #+DATE directive is a single timestamp. So,
>> what did you specify there?
>
> I tried
>
>   {{{date()}}}
>   {{{date(%D)}}}
>   {{{date(%F)}}}
>
> all produced "September 16, 2020".

What I meant was: what does your #+date: line look like?  Is it a single
time stamp?  If it is not, all of the above would return the same thing.

> Yes, {{{modification-time(%F)}}} works!

Great.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e



Re: using header data in document

2020-09-16 Thread General discussions about Org-mode.
Eric S Fraga wrote:

>> {{{date()}}} works as does {{{date(%D)}}} in
>> a sense, only the format string doesn't seem to
>> influence the output, which is "September 16,
>> 2020".
>
> The documentation that you have in your post says
> that this works only if the actual date given in
> the #+DATE directive is a single timestamp. So,
> what did you specify there?

I tried

  {{{date()}}}
  {{{date(%D)}}}
  {{{date(%F)}}}

all produced "September 16, 2020".

> And, in practice, I actually use
> {{{modification-time(FORMAT)}}}. In both of these
> cases, you need to specify the format.

Yes, {{{modification-time(%F)}}} works!

Thanks!

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: using header data in document

2020-09-16 Thread Eric S Fraga
On Wednesday, 16 Sep 2020 at 17:18, Emanuel Berg via "General discussions about 
Org-mode." wrote:
> {{{date()}}} works as does {{{date(%D)}}} in a sense,
> only the format string doesn't seem to influence the
> output, which is "September 16, 2020".

The documentation that you have in your post says that this works only
if the actual date given in the #+DATE directive is a single
timestamp.  So, what did you specify there?  If you give a time stamp,
like [2020-09-16 Wed], it works fine for me.  If you have something
else, e.g. September 16, 2020, the format string is ignored.

In any case, you may wish to use the {{{time(FORMAT)}}} macro instead as
this does not depend on the date you have specified explicitly. And, in
practice, I actually use {{{modification-time(FORMAT)}}}.  In both of
these cases, you need to specify the format.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e



Re: using header data in document

2020-09-16 Thread General discussions about Org-mode.
Eric S Fraga wrote:

> On Wednesday, 16 Sep 2020 at 00:08, Emanuel Berg via
> "General discussions about Org-mode." wrote:
>
>> Hm, date? Maybe that can be used to do a line like
>> the LaTeX's
>>
>>   Last modified: \today
>>
>> or how would one do that?
>
> Check out the info manual: [[info:org#Macro
> Replacement]] but you should be able to use
> {{{date(%D)}}} to get the date.

{{{date()}}} works as does {{{date(%D)}}} in a sense,
only the format string doesn't seem to influence the
output, which is "September 16, 2020".

(info "(org) Macro replacement")

  ‘{{{date}}}’
  ‘{{{date(FORMAT)}}}’
   This macro refers to the ‘#+DATE’ keyword.  FORMAT is an optional
   argument to the ‘{{{date}}}’ macro that will be used only if
   ‘#+DATE’ is a single timestamp.  FORMAT should be a format string
   understood by ‘format-time-string’.

(describe-function #'format-time-string)

  [...]
  %D is like "%m/%d/%y".
  [...]

So it should work according to these parts of the
documentation...

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: using header data in document

2020-09-16 Thread Eric S Fraga
On Wednesday, 16 Sep 2020 at 00:08, Emanuel Berg via "General discussions about 
Org-mode." wrote:
> Hm, date? Maybe that can be used to do a line like
> the LaTeX's
>
>   Last modified: \today
>
> or how would one do that?

Check out the info manual: [[info:org#Macro Replacement]] 
but you should be able to use {{{date(%D)}}} to get the date.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e



Re: using header data in document

2020-09-15 Thread General discussions about Org-mode.
Corwin Brust wrote:

>  | Org comes with following pre-defined macros:
>  |
>  | ‘{{{keyword(NAME)}}}’
>  | ‘{{{title}}}’
>  | ‘{{{author}}}’
>  | ‘{{{email}}}’

Thanks, great!

> So you can use use, e.g. {{{author}}} in various
> places to get at data from the header:
>
>  | Org recognizes macro references in following Org markup areas:
>  | paragraphs, headlines, verse blocks, tables cells and lists.
>  | Org also recognizes macro references in keywords, such as
>  | ‘CAPTION’, ‘TITLE’, ‘AUTHOR’, ‘DATE’, and for some back-end
>  | specific export options.

Hm, date? Maybe that can be used to do a line like
the LaTeX's

  Last modified: \today

or how would one do that?

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




Re: using header data in document

2020-09-15 Thread Corwin Brust
Greetings!

On Tue, Sep 15, 2020 at 4:05 PM Emanuel Berg via General discussions
about Org-mode.  wrote:
>
> How can I use header data in the document?

MACRO seems to be the current means to expose these.

  https://orgmode.org/manual/Macro-Replacement.html

 | Org comes with following pre-defined macros:
 |
 |  ‘{{{keyword(NAME)}}}’
 | ‘{{{title}}}’
 | ‘{{{author}}}’
 | ‘{{{email}}}’

So you can use use, e.g. {{{author}}} in various places to get at data
from the header:

 | Org recognizes macro references in following Org markup areas:
 | paragraphs, headlines, verse blocks, tables cells and lists.
 | Org also recognizes macro references in keywords, such as
 | ‘CAPTION’, ‘TITLE’, ‘AUTHOR’, ‘DATE’, and for some back-end
 | specific export options.

Regards,
Corwin

> underground experts united
> http://user.it.uu.se/~embe8573
> https://dataswamp.org/~incal



using header data in document

2020-09-15 Thread General discussions about Org-mode.
How can I use header data in the document?

E.g.,

#+AUTHOR: Emanuel Berg

[...]

\author I wrote this! # only that doesn't work

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal