[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to export an org file, to 2 different locations (in to different
From: |
Juan Manuel Macías |
Subject: |
Re: how to export an org file, to 2 different locations (in to different formats) |
Date: |
Sat, 28 May 2022 07:23:13 +0000 |
Uwe Brauer writes:
> When I run it I obtain
> if: Symbol’s value as variable is void: my-latex-export-path
>
> Another point is if I decide to export it to ods, I need to modify that
> advice, but I agree the new function is more convenient.
You must add the variables to the document as local variables, at the
end of the document, like this:
# Local Variables:
# my-latex-export-path: "~/path/myfile.tex"
# my-html-export-path: "~/path/myfile.html"
# End:
But (it's important, I didn't tell you, sorry) before you must globally
define the variables with nil value, so that you don't get an error in
other documents:
(setq my-latex-export-path nil
my-html-export-path nil)
With this 'define-advice' procedure you don't need the other code I gave
you. You can export in the usual way, using the dispatcher. The only
difference is that in any document where these variables exist, the
resulting file will be saved in the directory/name specified in the
variables, depending on whether you export to latex or html.
To add more cases, like odt, simply:
(1) you define a new variable:
(setq my-latex-export-path nil
my-html-export-path nil
my-odt-export-path nil)
and locally:
# Local Variables:
# my-latex-export-path: "~/path/myfile.tex"
# my-html-export-path: "~/path/myfile.html"
# my-odt-export-path: "~/path/myfile.html"
# End:
(2) And you add a new condition at the end of the define-advice:
[...]
(if (and my-latex-export-path
my-html-export-path
my-odt-export-path)
(cond ((equal extension ".tex")
my-latex-export-path)
((equal extension ".html")
my-html-export-path)
((equal extension ".odt")
my-odt-export-path))
(apply old-func args)))
It means that: if those variables exist, it returns as a result the
path/name that you have specified for each case. Otherwise, the
org-export-output-file-name function is executed normally.
Best regards,
Juan Manuel
- how to export an org file, to 2 different locations (in to different formats), Uwe Brauer, 2022/05/27
- Re: how to export an org file, to 2 different locations (in to different formats), Juan Manuel Macías, 2022/05/27
- Re: how to export an org file, to 2 different locations (in to different formats), Juan Manuel Macías, 2022/05/27
- Re: how to export an org file, to 2 different locations (in to different formats), Uwe Brauer, 2022/05/28
- Re: how to export an org file, to 2 different locations (in to different formats),
Juan Manuel Macías <=
- Re: how to export an org file, to 2 different locations (in to different formats), Uwe Brauer, 2022/05/28
- Re: how to export an org file, to 2 different locations (in to different formats), Juan Manuel Macías, 2022/05/28
- Re: how to export an org file, to 2 different locations (in to different formats), Ihor Radchenko, 2022/05/29
Re: how to export an org file, to 2 different locations (in to different formats), Uwe Brauer, 2022/05/28
[ODT?] (was: how to export an org file, to 2 different locations (in to different formats)), Uwe Brauer, 2022/05/28
Re: how to export an org file, to 2 different locations (in to different formats), Nick Dokos, 2022/05/31