I'm trying to generate documentation using SWI Prolog PlDoc package, but I'm running into a problem with the environment defined in pldoc.sty
:
\newcommand{\tag}[1]{%
\item[#1]}
...
% \begin{tags} ... \end{tags}
\newenvironment{tags}%
{\begin{quote}\begin{description}%
\setlength{\itemsep}{0pt}%
\footnotesize}%
{\end{description}\end{quote}}
This is used in the generated TeX file as follows:
\subsection{automata.pl: High-level predicates for dealing with regular expressions}
\label{sec:automata}
\begin{tags}
\tag{See also}
\url{https://github.com/wvxvw/intro-to-automata-theory}
\tag{To be done}
Add \predref{match_suffix_regex}{3}, \predref{match_all_regex}{3}, \predref{find_regex}{3}
\end{tags}
Which I insert into a larger document as follows:
\documentclass[11pt]{article}
...
\usepackage{amsmath}
...
\usepackage{pldoc}
...
\begin{document}
...
\section{Appendix A}
\label{sec:orgheadline18}
\input{automata-doc}
\end{document}
When I try to generate PDF using latexmk
with pdflatex
I receive the following error:
! Package amsmath Error: \tag not allowed here.
See the amsmath package documentation for explanation.
Type H <return> for immediate help.
...
l.253 \tag
{See also}
However, when I generate standalone documentation (which does not use amsmath
package), this error doesn't happen. My guess is that amsmath
is messing things up, but I don't know how to prevent it from interfering.
\tag
is an important command inamsmath
-- the definition in your.sty
file clashes here. Since I've no access topldoc.sty
I can't test, but I suggest to copy the\tag
definition frompldoc.sty
and rename it\pltag
, as well replacing any\tag{...}
in your real document with\pltag{...}
accordingly..sty
isn't my. Should I write to the maintainer to alert them to the problem, or is this something that I can remedy locally (without having to modify the said.sty
)?.sty
at all. Writing to the maintainer is certainly a good idea\tag
was not available to be created as a new command, for example. You ignore such errors at your peril!\section{}
. That's not coincidence either! But since this package isn't part of TeX Live and I have no idea what it is for or where to find it, I can't say whether this has any relevance or not ;).