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.
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.
These are biblatex-specific multicite commands that allow for multiple
pre- and postnotes, as in:
\cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}...
with an optional general pre- and postnote, which applies to the whole
list (like [][] in normal cite commands) and an optional pre- and
postnotes for each item, so that pagination can actually be specified in
multi-cite references, as in:
(cf. Miller 2015, 2; furthermore Smith 2013, 23-23; Jenkins 2012, 103,
also refer to chapter 6 in this book)
See the biblatex manual, sec. 3.8.3., for details.
File format change.
This entails a change of getAbbrAuthor to getAuthorList (the default is
still abbreviated with respect to MaxCiteItems, but the list can be, at
explicit request, shortened or full notwithstanding MaxCiteItems.
Next to the cmd name, introduce optional latex names (that might differ
from the cmd name) and aliases (that are "obsoleted by" the cmd).
This enhances portability between the engines.
* Justification and nicer line breaks.
* Much nicer tooltip for lists of bibliographical references.
* Removed unnecessary iterated copies of the string buffer in
InsetText::ToolTipText() which looked bad. This function used to be costly
(cf64064), maybe it is quicker now.
Use the function support:truncateWithEllipsis() to shorten a docstring with
... at the end. Actually we use U+2026 HORIZONTAL ELLIPSIS instead of "..." when
automatically shortening strings. This is to be consistent with Qt's own
truncation and is much nicer on the screen.
This includes the bugs #9575 and #9572 regarding broken text elision in the
outliner.
Known issues (non-regressions):
* TocBackend::updateItem() should be rewritten to update all TOCs. (#8386)
* "..." should be replaced with … everywhere else on the interface (including
translation strings).
* We should prefer to rely on QFontMetrics::elidedText() to truncate strings
with an ellipsis whenever possible, or an equivalent for the buffer view
dependent on the font metrics. See the warning in src/support/lstrings.h.
* New TOC "math-macro". This means that math macros can now be accessed in the
outline pane in their order of appearance or in alphabetical order, and can be
searched using the filter.
* Lists of floats now show subfloats deeper in the navigation menu
* The arbitrary 30 element cut-off after which nothing is shown except "Open
Navigator..." is removed. Menus now have no limit in size, so Qt may display
them scrollable. In exchange, we always show "Open outliner..." at the
beginning. I tested for performance issues with a rather complex document and
it is fine; but this does not exclude corner cases with lots of TOC entries of
a certain kind. If necessary, populating the navigation sub-menu should be
delayed like the main menu.
* Elements that do not contribute to the output (e.g. in a note, a disabled
branch) are now preceded with a symbol indicating this status. (The machinery
was already there; I wonder why it was not implemented already.) I have chosen
U+274E NEGATIVE SQUARED CROSS MARK.
* Fix the contextual menus in the outliner (bug introduced at 94e992c5).
* Toc item now move to the caption when present, but first center on the float,
to prevent the situation where the caption is at the top of the screen and the
contents of the float is off-screen above the caption.
(Internally, the action of the toc items can now be customised)
* Fix the LyXHTML output. Disabled captions no longer appear in the list of
figures.
We introduce TocBuilder for building TOCs that take into account both float
insets and their captions.
* Floats without caption are shown with their content.
* Floats with a caption are shown with their caption, but clicking the entry now
correctly moves to the float and not to the caption.
* Subsequent captions produce additional entries in the TOC.
* Figures and subfigures are correctly ordered in the outliner.
* New TOC "senseless" for captions appearing alone (a bit like broken references
are still displayed in the menu and outliner).
* Disable LFUN_CAPTION_INSERT if there is already a caption in a listing
Known issues:
* Inconsistent output for includes located inside floats
* We should record the end of the float in addition of the beginning for a more
accurate cursor -> outliner entry conversion
The firs tinvolves a thinko in BibTeXInfo::expandFormat. We were previously
counting passes through this routine, which means: one for every character,
more or less. So long strings would hit the "recursion limit". But what
we are worried about is an infinite loop caused by misues of macros, so that
is what we need to count.
This prevents the error we were previously getting, but it reveals a huge
slowdown when one tries to open a citation inset with a large nubmer of keys.
So we also limit the number of keys we try to process, and the length of the
string we try to display, when we are generating citation information.
I'm convinced that there is a deeper problem in how citation information is
generated (see the bug tracker for more info), but that will require major
surgery and a file format change
output, due to failure to clean the ids in the new citation stuff.
I've solved this by allowing the citation format information to contain
keys of the form "clean:key". This signals that we are to apply the
html::cleanAttr() function to the key before returning it. I.e., we
strip non-alphanumeric stuff, basically.
so we can write a limited amount when using this for TOC and
tooltip output.
This should solve the problem with slowness that Kornel noticed,
which was caused by our trying to write an entire plaintext
bibliography every time we updated the TOC. We did that because
he had a bibliography inside a branch, and we use plaintext for
creating the tooltip that goes with the branch list.
Other related bugs were fixed along the way. E.g., it turns out
that, if someone had an InsetInclude inside a branch, then we would
have been writing a *plaintext file* for that inset every time we
updated the TOC. I wonder if some of the other reports of slowness
we have received might be due to this kind of issue?
Reordering citations is one case where catching "Citation undefined
on page ..." doesn't catch the need for a bibtex rerun. This patch
ensures the proper ordering is obtained in pdf output without having
to resort to closing and reopening the LyX document.
What was previously accomplished by wrapCitation is now customizable in the
layout files. What we provide by default here corresponds roughly to the
LyX 2.0 behavior.
Add a new layout syntax CiteEngine to define the citation commands
available for a given citation engine.
Also extend the CiteFormat syntax to allow more customization. This
mechanism, previously used to produce bibliography entries in the
citation GUI based on the BibTeX entrytype, is now also used to
produce the textual labels for citation insets in the buffer view.
Thus citation styles are almost completely customizable by modules.
Modules for the basic, jurabib and natbib engines are implemented.
Layout format incremented to 37.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40820 a592a061-630c-0410-9148-cb99ea01b6c8
To avoid duplicity, remove natbib_authoryear and natbib_numerical
and replace them by natbib, and keep track of the engine `type'
in the new \cite_engine_type document setting. This will make it
easier to add more citation engines.
LyX format incremented to 424.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40592 a592a061-630c-0410-9148-cb99ea01b6c8
inset to know that the BibTeX data had changed. So we introduce a
Buffer-wide variable that we can query for that information.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38619 a592a061-630c-0410-9148-cb99ea01b6c8
counting when exporting to latex. This is done for the code comprised
between \begin{document} and \end{document}, while the preamble code
still needs manual calls to TexRow::newline() for registering new lines.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37584 a592a061-630c-0410-9148-cb99ea01b6c8
blank lines may be inadvertently output. This is achieved by using two
special iomanip-like variables (breakln and safebreakln) in the lyx::
namespace. When they are inserted in the stream, a newline is output
only if not already at the beginning of a line. The difference between
breakln and safebreakln is that, if needed, the former outputs '\n'
and the latter "%\n".
In future, the new class will also be used for counting the number of
newlines issued. Even if the infractrure for doing that is already in
place, the counting is essentially still done the old way.
There are still places in the code where the functionality of the
class could be used, most probably. ATM, it is used for InsetTabular,
InsetListings, InsetFloat, and InsetText.
The Comment and GreyedOut insets required a special treatment and a
new InsetLayout parameter (Display) has been introduced. The default
for Display is "true", meaning that the corresponding latex
environment is of "display" type, i.e., it stands on its own, whereas
"false" means that the contents appear inline with the text. The
latter is the case for both Comment and GreyedOut insets.
Mostly, the only visible effects on latex exports should be the
disappearing of some redundant % chars and the appearing/disappearing
of null {} latex groups after a comment or lyxgreyedout environments
(they are related to the presence or absence of a space immediately
after those environments), as well as the fact that math environments
are now started on their own lines.
As a last thing, only the latex code between \begin{document} and
\end{document} goes through the new class, the preamble being directly
output through odocstream, as usual.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37360 a592a061-630c-0410-9148-cb99ea01b6c8
of things like:
pit.push_back(CursorSlice(*this));
which I've had to change to:
pit.push_back(CursorSlice(const_cast<InsetCaption &>(*this)));
and similarly in a few other places.
If anyone thinks we should instead have:
explicit CursorSlice(Inset const &);
then we can also do that.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37192 a592a061-630c-0410-9148-cb99ea01b6c8
that also makes sure it doesn't do more work than it needs to do, by
limiting the size to 40 characters. Previously, InsetBranch::addToToc()
would have added a string representing the entire contents of the
branch! It's hard to imagine that having to recalculate that sort of
thing doesn't cause some problems with speed, especially in documents
with lots of notes and branches and such.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36974 a592a061-630c-0410-9148-cb99ea01b6c8