8

I have a custom (provided by someone else, not in latex repos) document style that loads flafter package in its style definition by unconditional \RequirePackage{flafter}. I want to use this style, but without this particular package. Is there a way to disable or make this package ineffective without actually modifying the style? E.g., by resetting some options in document's preamble?

tomash
  • 227

2 Answers2

11

add

\expandafter\def\csname ver@flafter.sty\endcsname{}

before the package is loaded (this works for any package)

Alternatively just make an empty file

 flafter.sty 

and put it in the same directory/folder as your document, LaTeX will input that instead of the standard one.

David Carlisle
  • 757,742
  • Actually I use LyX to typeset my document, so I'm unable to place this command before the document style is loaded (it seems to be not supported in LyX). Is there something I can do in a preamble (after the style is loaded)? – tomash Nov 16 '14 at 18:58
  • 1
    @tomash if the flafter package is loaded within the class then it has already made all its redefinitions before the preamble starts. It does not save the old definitions, they have gone. – David Carlisle Nov 16 '14 at 19:02
  • 2
    alternatively just make an empty file flafter.sty and put it in the same directory/folder as your document, latex will input that instead of the standard one. @tomash – David Carlisle Nov 16 '14 at 19:08
  • Thank you David very much, it works! It think this is the correct answer to my question. – tomash Nov 16 '14 at 19:17
  • @tomash added that comment to the answer – David Carlisle Nov 16 '14 at 19:19
5

An alternative would be using package scrlfile to prevent a package from loading.

\RequirePackage{scrlfile}
\PreventPackageFromLoading{flafter}
\documentclass{<yourCustomStyle>}

More on package scrlfile can be found in: https://tex.stackexchange.com/a/165470/37907

Johannes_B
  • 24,235
  • 10
  • 93
  • 248