# Debugging your Style

It is not surprising if your first dblatex compilation fails with a fresh LaTeX style. So, how to debug it when used with dblatex?

The following steps can help you:

1. Compile your file in the debug mode (option `-d`). When the compilation is done, the temporary working directory will not be removed.

       $ dblatex --texstyle=./mystyle.sty -d file.xml
       ...
       /tmp/tpub-ben-99629 is not removed

2. Go under the building temporary directory, and set the environment with the file `env_tex`.

       $ cd /tmp/tpub-ben-99629
       $ . env_tex

3. Compile the temporary latex file produced by the XSL stylesheets. Its name has the suffix "_tmp.tex".

       $ pdflatex file_tmp.tex
       $ [ many outputs here ]

4. Now latex stops when it encounters an error so that you can debug your stylesheet.