How can I add an option to a certain package through the preamble without modifying the *.sty file itself. I need to propose an additional option to the varioref package, I need to test such modification before contacting the package maintainer.
Here are the lines of code I need to add/test (As described in Defining a new language in Cref):
\DeclareOption{arabic}
{\vref@addto\extrasarabic{%
\def\reftextfaceafter {on the \reftextvario{facing}{next} page}%
\def\reftextfacebefore{on the \reftextvario{facing}{preceding}
page}%
\def\reftextafter {on the \reftextvario{following}{next} page}%
\def\reftextbefore {on the \reftextvario{preceding}{previous} page}%
\def\reftextcurrent {on \reftextvario{this}{the current} page}%
\def\reftextfaraway#1{on page~\pageref{#1}}%
\def\reftextpagerange#1#2{on pages~\pageref{#1}--\pageref{#2}}%
\def\reftextlabelrange#1#2{\ref{#1} to~\ref{#2}}%
}}
.texdocuments that are placed in the same folder. But only documents in the same folder will pick up the new local file, all other documents will still use the globally installed file. Is there anything that prevents you from going with that approach? Sometimes code you want to add to a package can be tested directly from the preamble, but adding options is a bit more tricky, I presume, so the local test file method would be quite natural here. – moewe Sep 08 '19 at 20:00.texfile will pick up the local, modified file and not the global.sty. If you later delete the local.styor place your.texfile in any other folder, the globally installed.stywill be used. – moewe Sep 08 '19 at 20:08\renewcommandor\patchcmd(frometoolbox)? and Please tutor the usage ofpatchcmdandxpatch. See also the user guide foretoolbox(texdoc etoolbox). That said, if an applicable option is now available, as reported by @DavidCarlisle, that's probably a better solution. – barbara beeton Sep 09 '19 at 15:36