Section M.4 Updating your custom XSL
Because the PreTeXt-CLI uses its own copy of PreTeXt, we have to change how the custom XSL imports the PreTeXt style sheets.
At time of writing, import of the
entities.entfile, which defines all the different components of PreTeXt, does not seem to work automatically. Our first step will be to make a copy of this file, and place it in the
xslfolder, next to our custom XSL style sheet.
If you still have a copy of the PreTeXt repository, you can copy
pretext/xsl. If not, open a Python terminal, and then run:
from pretext import static static.core_xsl('pretext-latex.xsl',as_path=True)
This will output the path to the PreTeXt XSL, and in that folder you can find
entities.entand copy it to
Next, open your custom XSL file. You will need to change two lines. First, you will have a line that looks something like
<!ENTITY % entities SYSTEM "../xsl/entities.ent"/>
Change the string
entities.ent. (Alternatively, instead of copying this file as above, you could enter the full path.)
Second, for each style sheet that you import, you will have a line that looks something like
if you are using custom XSL for LaTeX. Replace
pretext-href="pretext-latex.xsl". This tells the PreTeXt-CLI to import the XSL style sheet that it ships with.