I was hoping to find a command in etoolbox that would help resolve this type of error. Is there one?
EDIT on 10/14. What I'm looking for is: when two packages' define the same command, resulting in an error, to be able to prevent the error. I was thinking a patch that wraps around the command, in either package, an ifdef and changes the implementation accordingly. Surely this can be done with etoolbox.
\documentclass{report}
\usepackage{lastpage}
\usepackage{lipsum}
\usepackage{xwatermark}
\usepackage{hyperref}
\usepackage{titleps}%--------------------------------------------------
\newpagestyle{special}
{
\setfoot{}
{\thepage/\pageref{LastPage}}
{}
}
\pagestyle{special}
\begin{document}
\chapter{Intro}
\lipsum[1]
\end{document}
ERROR: LaTeX Error: Command \headrule already defined.
--- TeX said --- Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...
l.308 \newcommand\headrule{\setheadrule{.4\p@}}--- HELP --- No help available
xwatermark.sty:
\ifpgn@showheadrule
\def\headrule{{%
\color{\pgn@headrulecolor}%
\hrule\@height\pgn@headruleheight\@depth\pgn@headruledepth
\@width\headwidth\vspace{\pgn@headrulesep}%
\hrule\@height\pgn@headruleheight\@depth\pgn@headruledepth
\@width\headwidth\vspace{-\pgn@headrulesep}%
}}%
\else
\let\headrule\relax
\fi
