The current version was wrong for non-English dialogs, and even for
the English one, due to the translator commands that were not removed
for calculation (as in "Formats[[output]]").
Candidate for stable.
This adds support for the chapterbib package, but also adds ways to
produce this sort of multibib with biblatex and bibtopic (which are
both incompatible with chapterbib).
File format change.
InsetMathDelim does not need markers because the delimiters are
visually enough.
CommandInset (like InsetMathRef) does have cells, but they are hidden
(only for storage). Therefore the default InsetMath::markers() method
mistakenly added markers. In practice, the markers were never active
(since the cursor cannot go into the inset), but some space was
reserved for them.
This allows to somewhat simplify the text and avoid some uses of
Paragraph (in the long term, RowPainter should not have to access
these things).
At the same time do a small cleanup to RowPainter: rename
text_metrics_ to tm_, remove pm_ and width_.
The enum values BEG_MACRO/END_MACRO and BEG_AR/END_AR are replaced by a
single BEGIN/END pair.
The MathRow code now only knows about insets and math arrays.
New hooks (before|after)(Metrics|Draw) are run by the MathRow code
as needed. They are actually also used internally by the MathMacro
code.
The gain is that most traces of explicit macro handling (and
the MathRow::Element::macro member) have been removed from MathRw.cpp.
The next step will be to extend the tokenizing process to allow for
linearizing insets other than macros.
* Convert the kerning into a proper right margin for mathnormal, mathscr and
mathcal (fonts with \fontdimen2 == 0 as per rule 17 from TeXBook).
* Simulate the fact that characters in mathnormal fonts have a 0-width left
bearing.
* Implement subscript positioning in the case of rule 17 using negative italic
correction (kerning_).
File format change.
This allows for the relevant InsetCommand-based dialogs (such as
citation text before/after, Bibitem label, hyperlink name etc.)
to provide both the input of verbatim code or text that is transformed
to proper LaTeX code.
Some dialogs (Nomencl, Href) already had some methods (although they
could not be toggled), which are now centralized and streamlined.
The initial work of this patch has been done by Georg Baum (see
http://www.lyx.org/trac/attachment/ticket/2751/x.diff)
Fixes: #2751, #8227.
When using Qt stuff in breakAt, it may happen that the row is broken
after an hyphen (whereas the old code would only consider spaces).
The fact that we abuse the Row::right_boundary() property to detect when
a row should be flushed broke justification when a row is cut at an
hyphen.
Fix this by introducing a new Row::flushed() property and set it as needed.
The code that tries to decide whether it is worth splitting a given
text row element had a shortcoming: it did not take into account the
left margin of the new row that would be created.
The problem is that this left margin is not the same as the left
margin of the current row, because there can be for example
indentation effects.
To fix this problem, we pass the amount of available space on the
next row as a parameter of Row::shortenIfNeeded.
Note that there is no need to care about RtL row elements at this
point, since the bidi algorithm will be applied to the row
subsequently.
This avoids some duplicate code. Note that the return value of
Paragraph::getAlign had to be changed. I suspect it was set to char to
avoid reading one header file in Paragraph.h.
Whenever an argument delimiter is used inside the argument, the argument
needs to be grouped, that is
\cites({text (text) text})
or
\cite[{text [text] text}]
This fixes the original case reported in #2751 which is independent
from the general issue that the pre- and postnote field take literal
code.