I am building a project with l3build. There are some examples I want to present in the documentation, showing their source code, annotated with DocStrip, as well as including the output they produce using \includegraphics to pull in the PDF generated from the extracted example source code. It all looks roughly like this:

  • examples.dtx:

    %    \begin{macrocode}
    %    \end{macrocode}
    % Here is some italic text.
    %    \begin{macrocode}
    \textit{Lorem ipsum}
    %    \end{macrocode}
    %    \begin{macrocode}
    %    \end{macrocode}
    % And here is some bold text.
    %    \begin{macrocode}
    \textbf{Lorem ipsum}
    %    \end{macrocode}
    % That is all.
    %    \begin{macrocode}
    %    \end{macrocode}
  • examples.ins:

    \input docstrip.tex
  • documentation.drv:

    Let me present some examples.
    This is how the examples look when compiled. \\
    \includegraphics{italic.pdf} \\
  • build.lua:

    #!/usr/bin/env texlua
    -- build.lua - not working
    module = "example"
    typesetfiles = {"documentation.drv"}
  • shell commands to do what build.lua is intended to do (typeset.sh):

    tex *.ins
    for doc in *.tex
      pdflatex "$doc"
    pdflatex *.drv

I placed these files on GitHub for you to quickly download and test them.

I even thought of rather drastic measures like redefining the typeset function in terms of arara. But I cannot seem to configure l3build to compile the documentation correctly. The examples do not need to be distributed in any TDS or *.zip, but they have to be unpacked and compiled before typesetting the documentation. Can this be done with l3build?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.