add tag
निरंजन
Suppose I have a `duck.dtx` containing the code for `duck.sty` and a `duck.ins` to generate the latter from the former. I also have a `build.lua` for employing the `l3build` tool. Lastly I have a `quack.tex` which I input in `duck.sty` so it should be in the same or an embedded directory where the latter is located. Currently all the aforementioned files are in the same directory. The contents are as follows:

#### `duck.dtx`
---

```
% \iffalse meta-comment
%<*driver>
\ProvidesFile{duck.tex}
\documentclass{l3doc}

\begin{document}
\DocInput{duck.dtx}
\end{document}
%</driver>
% \fi
%    \begin{macrocode}
%<*pkg>
\def\duck{duck}
\input{quack.tex}
%</pkg>
%    \end{macrocode}
```

#### `duck.ins`
---

```
\input l3docstrip.tex
\usedir{tex/latex/\jobname}
\generate{%
  \file{\jobname.sty}{\from{\jobname.dtx}{pkg}}%
}
\endbatchfile
```

#### `quack.tex`
---

```
\def\quack{quack}
```

#### `build.lua`
---

```lua
module = "duck"
installfiles = {"*.tex","*.sty"}
```

As per the documentation all the files I specify in `installfiles` variable of `build.lua` should be copied to the "tex-area", but running `l3build install` _only_ copies the `.sty`. What am I missing? I want the same thing to happen with `l3build ctan` too. I would also like to know how should the working directory look if I want `quack.tex` in a subdirectory named, say, `quack`, in my `install`-target. If the working directory should be as it is, what should be changed in the `build.lua`?
Top Answer
Joseph Wright
The standard settings in `l3build` are based around a `.dtx`/`.ins`-based workflow in which no files are taken directly from the source directory and installed. More generally, installation is a three-stage process:

- Copy source files to the unpacking directory
- Unpack
- Copy install files to the local `texmf` tree (or similar)

Even if there is no unpacking, that means a file needs to be copied in both steps. This means that sources files for direct installation need to be listed in both `sourcefiles` and `installfiles`. For simple 'no `.dtx` at all' structures, this can be done with
```lua
sourcefiles = {"*.tex"}
installfiles = sourcefiles
```

(The need to move files twice is all about ensuring that only the files we really want to install are used: this is vital for the LaTeX kernel, for example.)

In the case here, you have a mixed situation, some files to unpack, some to copy directly. So you want
```lua
module = "duck"
installfiles = {"*.tex","*.sty"}
sourcefiles = {"*.ins", "*.tex","*.dtx"}
```
Notice that the `.ins` _is_ a source file as it is needed for unpacking.

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.