\ProvidesPackage{di/figure} \RequirePackage{caption} \RequirePackage{etoolbox} \RequirePackage{xparse} \RequirePackage{float} % define difigure environment \ExplSyntaxOn \NewDocumentEnvironment{difigure}{O{!ht} O{raggedright}} { \begin{figure}[#1] \captionsetup{format=plain, font=it, justification=#2, singlelinecheck=off, skip=6pt} \ifstrequal{#2}{centering}{\centering}{} } { \end{figure} } \ExplSyntaxOff %define pdincludegraphics command \newcommand*\diincludegraphics[4][] { \includegraphics[#1]{#4} \caption{#3} \label{#2} } %set graphicspath to the subdir figures/ \graphicspath{{figures/}} %Set graphicspath to the subdir figures/ \renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}