1

For example, when exporting, the #+title property is taken as the title of the document, which will show as the heading in, for example, a latex pdf. Ideally I would like the #+title value to also be used as the filename as well.

Right now I have to do this:

#+title: My Title
#+export_file_name: My Title

Is there any way I can do something like this:

#+title: My Title
#+export_file_name: (#+title)

Really the goal is to only have to write the title once per document, and have it be used in multiple property values.

I have tried using macros, but they did not work, it will try to export to {{{mymacro}}}.pdf and fail.

1
  • In general, you cannot: property values are strings and are not parsed at all, so Org mode does not know what's in them. #+title: is not really a property: it's a keyword and some keywords (e.g. #+title:) are parsed and macro expansion is performed on them. Unfortunately, #+export_file_name: is not one of them. I get the feeling that what is parsed and what is not is more-or-less an accident of history. This area could use some rationalization.
    – NickD
    Sep 28, 2023 at 14:26

1 Answer 1

0

Write an interactive Elisp function asking you to input a value when triggered. Once the value is input, the function will then write the following two lines at the beginning of your org document:

#+title: input value
#+export_file_name: input value

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.