1

How do I draw a horizontal line (possibly with some text) in optidef? I'm looking for something like:

\documentclass{article}
\usepackage{optidef}

\begin{document}

\begin{mini} {x}{x^2}{}{} \addConstraint{x}{<5}{} %\hrule \addConstraint{x}{>0}{} \end{mini}

\end{document}


So far, I came up with:

...
\newcommand\optiComment[1]{\addConstraint{ \relbar\joinrel\relbar\joinrel\relbar \text{#1} \relbar\joinrel\relbar\joinrel\relbar } \nonumber}
...
\begin{mini*}
...
optiComment{ text }
...
\end{mini*}
...

It would be nice to have a rule along the whole line with a comment in the middle.


How about grouping constraints instead using a big left brace for each group?


Solution: start the problem with optidef (or just write it manually), then proceed with

\begin{subequations}
\begin{empheq}[left = \empheqlbrace]{align}
F &= ma\\
v &= at\\
W &= Fs
\end{empheq}
\end{subequations}

which can be adjusted with no limitations (e.g. rules). Conclusion: use a package if it's convenient and provides the proper shortcut. If it requires too many hack, then do it "manually."

Zohar Levi
  • 1,237

0 Answers0