LinebreakAdjustments

This function has not been fully integrated into the long-term Mathematica system, and is subject to change.

LinebreakAdjustments
is an option for selections that sets parameters used for calculating where automatic line breaks should be inserted.

DetailsDetails

  • The automatic linebreaking of expressions uses a complex algorithm that takes into account many factors that affect the length of lines. Each such factor is assigned a weight, which is then used as a parameter in a global optimization routine that determines the exact positions of the line breaks. By adjusting the parameters, you can control the relative importance given to the different linebreaking criteria. For most cases, the default settings provide a good solution, and it is not necessary to adjust the parameters yourself.
  • LinebreakAdjustments is specified as a list of five numbers: LinebreakAdjustments->{a, b, c, d, e}. Here, a specifies the optimal line width to aim for, expressed as a percentage of the total line width; b is the penalty assigned for deviating from the line width specified by a; c is a penalty based on the depth of the box tree (the deeper in the box tree the line break would occur, the greater the penalty for line breaks); d is a penalty based on how bad the break was at the previous line; e is a penalty based on the total number of lines (the larger the number d, the smaller the number of lines used to format the expression).
  • The default setting LinebreakAdjustments->{0.85, 2, 12, 1, 1} represents an empirical choice that works well for most Mathematica input. An alternative setting that gives good results for program code is LinebreakAdjustments->{0.5, 10, 100, 1, 0.5}.
New in 4.0
New to Mathematica? Find your learning path »
Have a question? Ask support »