Add $$OrigAbsName placeholder to external

This produces the absolute path to the original file.

Documentation will follow in die time (after documentation has been
unfrozen)
This commit is contained in:
Jürgen Spitzmüller 2024-03-20 07:57:43 +01:00
parent f7e6086e67
commit 0d3d91c055

View File

@ -108,6 +108,8 @@ string const doSubstitution(InsetExternalParams const & params,
string const basename = changeExtension(
onlyFileName(filename), string());
string const absname = makeAbsPath(filename, parentpath).absFileName();
string const origabsname = makeAbsPath(params.filename.outputFileName(parentpath),
parentpath).absFileName();
if (what != ALL_BUT_PATHS) {
string const filepath = onlyPath(filename);
@ -136,6 +138,10 @@ string const doSubstitution(InsetExternalParams const & params,
use_latex_path,
PROTECT_EXTENSION,
ESCAPE_DOTS);
result = subst_path(result, "$$OrigAbsName", origabsname,
use_latex_path,
PROTECT_EXTENSION,
ESCAPE_DOTS);
result = subst_path(result, "$$RelPathMaster",
relToMasterPath, use_latex_path,
PROTECT_EXTENSION,