add tag
## Working directory

The following three files, `testpkg.dtx`, `testpkg.ins` and `build.lua` are in the same directory:

### `testpkg.dtx`

% \iffalse
% \fi
% \section{Main package file}
%    \begin{macrocode}
%    \end{macrocode}
% \section{Code file}
%    \begin{macrocode}
\def\foo{A nice macro}
%    \end{macrocode}

### `testpkg.ins`

\input docstrip.tex

### `build.lua`

module = "testpkg"
installfiles = {"*.sty", "*.code.tex"}
packtdszip = true

## What I did

Now I `cd` to that directory and run `l3build ctan`. It gives me this beautiful output:


The command also returns `0`, so I suppose all steps are executed successfully.

## Problem

The structure of `build/distrib/tds` folder is like this:

│   └───latex
│       └───testpkg
│           └───testpkg.pdf
│   └───latex
│       └───testpkg
│           ├───testpkg.dtx
│           └───testpkg.ins

This TDS is good enough, and when I paste it to `~/texmf`, I am able to use `testpkg`. However, in the installer file I write this


I want `testpkg.code.tex` to be put in `tex/latex/testpkg/src` and not in `tex/latex/testpkg`. So, `l3build` seems to ignore this `\usedir`.

How can I tell `l3build` to put `testpkg.code.tex` to the right place?
Top Answer
To control the tds structure, `l3build` uses its own settings/mechanism. For this you can specify the `tdslocations` variable, which is a list specifying the file paths of individual files in the tds with paths differing from the defaults. So to place your file `testpkg.code.tex` in `tex/latex/testpkg/src` you'll want to add the item


to that list. If it is the only file with a special placement the variable initialisation in your `build.lua` file will look like the following:

tdslocations = {

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.