Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to use imakeidx and the regexpatch package in the same class. Since imakeidx depends on the xpatch package and xpatch provides the same commands (same names, improved implementation) as regexpatch this gives errors (redefining commands). Is there anyway to pretend I loaded the xpatch package, so the require inside imakeidx won"t load anything? (Since I load regexpatch before, everything should be fine).

While I have a concrete example above, I would be interested in the general awnser to prevent require statements from loading packages, a workarround for my particular case is a bonus (I guess either I am doing something wrong or the package author will take a look).

share|improve this question
    
@egreg I think you might be the author of both packages, so I wanted to notify you. On page 17 line 37 of the imakeidx manual, it seems like you \RequirePackage{xpatch} unconditionally. –  ted Aug 21 '13 at 21:33
3  
\ProvidesFile{wibble.sty} will make latex think that the wibble package has been loaded. –  David Carlisle Aug 21 '13 at 21:45
1  
...or \makeatletter\let\ver@wibble\@empty\makeatother (I think). –  Werner Aug 21 '13 at 21:52
    
@Werner \csname ver@wibble.sty\endcsname (so that wibble class and wibble package can both exist –  David Carlisle Aug 21 '13 at 21:55
1  
@ted FYI, trying to notify someone the way you did with egreg doesn't work unless egreg is the author of the post, or if he/she has written a comment. If as you type the name it starts to auto-complete, the person will be notified, if it doesn't autocomplete, the person won't. See here: meta.stackexchange.com/questions/123594/… –  Chris Gregg Aug 22 '13 at 8:23

2 Answers 2

up vote 16 down vote accepted

One can use David's suggestion, but etoolbox must be loaded anyway:

\ProvidesFile{xpatch.sty}
\usepackage{etoolbox}
\usepackage{imakeidx}
\usepackage{regexpatch}

should do.

share|improve this answer

egreg answered the specific issue but the general issue of avoiding package loading as mentioned in comments:

\documentclass{article}

\ProvidesFile{longtable.sty}

\usepackage{longtable}

\typeout{longtable is: \meaning\longtable}

\stop

produces

longtable is: undefined

showing that the package is not loaded, despite the \usepackage.

share|improve this answer
    
+1 for the demonstrations of the effect –  ted Aug 21 '13 at 22:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.