Skip to content

additionalFiles and (relative) paths #11

@TGlas

Description

@TGlas

This is more a question than an issue, but it may help to improve the documentation. A non-trivial LaTeX project consists of many files other than the main file, like figures, tex, sty, cls, etc. They are provided to the compiler with the additionalFiles option. Right now, the documentation in compiler.js is quite minimal:

@property {Object<string, string|Uint8Array>} [additionalFiles] - Additional files for compilation

My question is about the key. I understand that it is a filename. However, how about files residing in a different directory? Consider the following project structure:

/main.tex
/logo.jpeg
/figures/plot.pdf
/revision/main.tex
/revision/figures/plot.pdf

Let's assume that both main.tex files could be compiled, resulting in two different pdf documents. Say, I would like to compile the file
/revision/main.tex. How should the keys of the various figures look like?

I would provide the content of /revision/main.tex as the source parameter. Then my first reflex is to make the paths relative to the source:

const additionalFiles = {
	"../logo.jpeg": something1,
	"../figures/plot.pdf": something2,
	"figures/plot.pdf": something3,
};

Is that the intended (correct) way to do it?
I guess that this question really addresses busytex internals, but it would still be good to document the correct use of additionalFiles.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions