Is there a way to replace "minimize" and "maximize" in optidef package with something that will display "exists"? I am wondering how to best typeset an existence problem in optidef, though maybe that's not the right package.

1 Answer 1


You didn't specify what your intended input or output is. However, as a guess the following approach: you can use the customopti environment with the problem keyword as first (mandatory) argument.


{exists}{w}{f(w)+ R(w+6x)}
\addConstraint{n(w)}{= 6}


enter image description here

Note that this requires the latest version from Github (https://github.com/jeslago/optidef/blob/master/optidef.sty), which is currently (June 2021) not yet on CTAN.

  • 1
    I'd be wary of using \DeclareDocumentEnvironment{exists}, because it silently overwrites the existing command \exists.
    – egreg
    Jun 23, 2021 at 17:32
  • @egreg good point, I changed the environment name.
    – Marijn
    Jun 23, 2021 at 17:34
  • @Marijn @egreg: Perhaps this could also be done using the customopti environment in optidef (see line 795 of github.com/jeslago/optidef/blob/master/optidef.sty) though it doesnt seem to be documented and when I tried it, it didn't seem to work for me
    – rrrrr
    Jun 23, 2021 at 17:41
  • 1
    @rrrrr that is much easier indeed :) my installed version of the package didn't have this environment yet. I edited the answer. The centering of subject to is also better in this version.
    – Marijn
    Jun 23, 2021 at 17:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .