# Break objective command fails in optidef

When I use break objective command it gives me this error :

Undefined control sequence.
\BODY -> \breakObjective


I can reproduce this in latex ( this is an example in the optidef package instruction )

\documentclass{article}
\usepackage{optidef}
\begin{document}
\begin{mini*}
{w,u}{f(w)+ R(w+6x)+ H(100w-x*w/500)}{}{}
\end{mini*}
\end{document}


It works correctly, how ever when I used the break objective command as follow ( it is also an example in the instruction ) it gives me error:

\documentclass{article}
\usepackage{optidef}
\begin{document}
\begin{mini}
{w,u}{f(w)+ R(w+6x)+ H(100w-x*w/500)}{}{}
\breakObjective{-g(w^3-x^2*200+10000*w^5)}
\end{mini}

\end{document}


Does anyone know why this happens and how I can fix this? or Can you introduce me a package that I can write optimization problem with as easy as optidef?

• Welcome to TeX.SE! Please provide a full but minimal example that we can run and reproduce your error. You have to include all the needed definitions and packages to make your code compilable (except of this particular error) – koleygr Oct 16 '17 at 17:42
• thanks for the edit. Your example works with an up to date system and the log shows Package: optidef 2017/06/21 - version=2.5, Package for defining optimization problems does your log file show an older version? – David Carlisle Oct 16 '17 at 18:20
• Thanks David, even the second example works fine? actually I am working on overleaf. it is supposed to use up to date system. – Mahraz Oct 16 '17 at 18:23
• yes the second example works, I believe that you can get overleaf to show the log? – David Carlisle Oct 16 '17 at 18:26
• yes, you can download the log, but what can I do with the log? (/usr/share/texlive/texmf-dist/tex/latex/optidef/optidef.sty Package: optidef 2016/08/07 - version=2.0, Package for defining optimization pr it seems that my version is 2! do you know how I can update it to version 2.5? – Mahraz Oct 16 '17 at 18:28

As David Charlisle mentioned, the break objective function works correctly on an up to date system. where the log shows:

 Package: optidef 2017/06/21 - version=2.5,
Package for defining optimization problems


As I am using OVERLEAF, it does not support 2017 version of packages so my log shows:

Package: optidef 2016/08/07 - version=2.0


BreakObjective command only works on the latest version of the optidef. Solution : I download my whole project from overleaf and upload it in Sharelatex! it supports the latest version of the package and the problem is solved.

Thanks everyone for help.

• I asked this question almost 7 months ago and still Overleaf does not support the latest version of the optidef. is there anyway that manually add the latest version of the optidef to Overleaf? – Mahraz May 3 '18 at 18:40
• Yes, simply download the cls file at ctan.org/pkg/optidef?lang=en and put it in your top folder – MappaM Jun 14 '19 at 14:04