How to use <$include:/filepath/filename>

I am trying to use <$include:/filepath/filename> to programmatically load a table.

I am compiling from mmd to LaTeX. I have tried three tests.

When I explicitly defined the location for the source the file, it is included and the table is rendered as expected.


… the correctly rendered table…

When I use replacements to identify the source file location I get replaced text but no included file.




When I use a custom metadata field of type, List, with the None value set to the includes path, I also get text replacement and no include.




This is not working the way I would expect.

Section 24.2.8 of the User manual describes <$include> as a placeholder where compound placeholders can be used. There is even an example <$include:<$custom:Epigraph>> that would include the item with the binder name referenced by the custom metadata term Epigraph.

Here are the tests together showing the source file and the result. (The tests are not in the same order in the source file as shown above.)

Scrivener Source

Result (Rendered as a PDF, as I think this is easier to see than the LaTeX.)

How can I make this work?

I have a temporary work-around but it does not use <$include>. Because this is building LaTeX, I was able to use the \input command.

  1. Create a set of replacements (In this order)

  2. Use the replacements this way in the source


This works so long as the file to be included is TeX. This clearly has limitations.

As a side note… I did not see built-in metadata that designates the path of the current project. I see it’s name, title, and other details but not the path. Is there a way to find this?