Size expressions that contain the variable max with other components

As explained in Size expressions for bordered boxes, the value of max is automatically adjusted by the border values. This causes unexpected results in expressions such as max-2cm"or "max/2", for example, where max is only a component of a more complex expression. Modify such expressions as follows:

  1. Take the original formula and replace any occurrence of "max" with "(max+borders+padding+margin)" where "borders", "padding" and "margin" denote the width values for each on both sides of the box.

  2. Take the resulting formula (which we'll call "f") from step 1, and create the final formula as "f-borders-padding-margin".

Example

LAYOUTNODE: x-Size="max/2", leftBorderWidth="2mm", leftMargin="1mm", rightBorderWidth="1.5mm", rightPadding="3mm"

Changing the expression for x-Size:

The final property values for the box are:

LAYOUTNODE: x-Size="(max-7.5mm)/2-7.5mm", leftBorderWidth="2mm", leftMargin="1mm", rightBorderWidth="1.5mm", rightPadding="3mm"