Commit Graph

23985 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
f73bb3f16e Fix glitch in drawing fractions
This is a fixup to 89662a68.
2017-01-17 16:28:48 +01:00
Jean-Marc Lasgouttes
596c9065e6 BOX tweak 2017-01-16 15:35:45 +01:00
Juergen Spitzmueller
4859a1f6bb Don't load bibtopic with Biblatex 2017-01-15 15:40:20 +01:00
Guillaume Munch
fdf805956b Fix font of macro template name 2017-01-14 23:13:14 +01:00
Guillaume Munch
3391fed36a Make the generation of children's tocs more robust
Let the children directly access the TocBuilders, instead of concatenating
after the fact.
2017-01-14 23:13:14 +01:00
Guillaume Munch
461fda9ca9 Collect the outliner names for the children's tocs
Fixes missing outliner names in various situations. Now if the warning "Missing
outliner name" appears in the console, this correctly hints at an actual issue
with the layout.
2017-01-14 23:13:14 +01:00
Guillaume Munch
54f5100e74 Simplify
The main point is the flag which is much simpler now.
2017-01-14 23:13:14 +01:00
Guillaume Munch
bd1ce03b40 Two separators collapse into one
It seems guaranteed by the Qt docs that two menu separators collapse into
one. This allows this little simplification.
2017-01-14 23:13:14 +01:00
Juergen Spitzmueller
33fa147fca Minor string fixes 2017-01-14 17:48:37 +01:00
Juergen Spitzmueller
ed7d3a33ab Some master/child biblio fixes. 2017-01-14 14:44:18 +01:00
Juergen Spitzmueller
b3cc07e3a6 Trim biblio options and biblatex styles 2017-01-14 14:28:35 +01:00
Juergen Spitzmueller
16701fa39e Address FIXME 2017-01-14 14:25:49 +01:00
Juergen Spitzmueller
34943a4e5f Make Japanese Biblatex-aware
Biblatex can be used with Japanese, but then, biber (not pbibtex) should
be used as processor.

I this context, bring the jbibtex UI in line with bibtex, allowing for
a selection of alternatives.
2017-01-14 12:13:33 +01:00
Juergen Spitzmueller
5b0de8c373 Allow new buffer params to be reset to empty 2017-01-14 09:59:33 +01:00
Juergen Spitzmueller
1eb43536da Add an "Automatic" bibliography processor pref option
This is now set as default. It selects biber for Biblatex (with
fall-back to first bibtex8, then bibtex, if the former is not
installed), and bibtex for BibTeX-based engines.

With this, users do not normally need to care for the processor when
they switch cite engines.
2017-01-13 19:18:35 +01:00
Juergen Spitzmueller
384723b63f update tex2lyx tests 2017-01-13 18:27:38 +01:00
Juergen Spitzmueller
fc546b7dcc Basic support for natbib & jurabib options
This re-uses the options line edit introduced for biblatex.
2017-01-13 18:23:42 +01:00
Kornel Benko
cf3f4814d9 Adapt the cmake-build-system to the reworked biblatex handling 2017-01-13 13:17:12 +01:00
Juergen Spitzmueller
493f6c6cd3 update tex2lyx tests once more 2017-01-13 11:57:39 +01:00
Juergen Spitzmueller
327602d01d Implement "key only" citation style
File format change.
2017-01-13 11:53:22 +01:00
Juergen Spitzmueller
d401a46267 Clear styles widgets only if needed. 2017-01-13 10:57:53 +01:00
Juergen Spitzmueller
013515e450 Update tex2lyx tests 2017-01-13 10:13:47 +01:00
Juergen Spitzmueller
7f97ace83b Merge branch 'master' into biblatex2 2017-01-13 09:11:04 +01:00
Juergen Spitzmueller
6b214804f6 Assure long tooltip is correctly formatted.
Amendment to ffb195b5e9
2017-01-13 09:07:44 +01:00
Juergen Spitzmueller
239b9919ff Merge branch 'master' into biblatex2 2017-01-12 14:29:55 +01:00
Juergen Spitzmueller
9b13217f7b Use master buffer params when appropriate 2017-01-12 12:19:14 +01:00
Jean-Marc Lasgouttes
cdc847fd30 Fix drawing of empty boxes
They were actually bigger than their metrics.
2017-01-12 12:15:17 +01:00
Jean-Marc Lasgouttes
8361fb603e Rename InsetMathNest::metrics to cellsMetrics
Re-using the name of a virtual method with different semantics is not
a good idea anyway.
2017-01-12 11:22:51 +01:00
Jean-Marc Lasgouttes
4cea47d1eb Implement mathClass() for \big and friends
The information here is obtained by reading LaTeX sources.
2017-01-12 10:28:52 +01:00
Juergen Spitzmueller
ce8929e9b2 Merge branch 'master' into biblatex2 2017-01-12 09:05:28 +01:00
Richard Heck
a7aef29600 Update tex2lyx tests. 2017-01-11 14:16:28 -05:00
Jean-Marc Lasgouttes
89662a6852 Re-implement math markers logic.
The goal of this patch is to be able to properly remove the space
needed for markers in the case of insets that are inside macros and do
not need these markers. This was attempted at 9a9a6a8, but did not
work reliably.

To this end, the following simplifications are made:

* instead of drawing its own markers, each inset has a virtual method
  marker() which prescribes either NO_MARKER, MARKER (normal bottom
  marker) or MARKER2 (top and bottom marker). All explicit calls to
  (draw|metrics)Markers(|2) are removed.

* the space necessary for the markers is now counted in the
  before/above margins in the row structure. Therefore painting will
  not happen at (x + 1, y), but just (x,y).

* the methods drawDecoration are removed.

* the helper methods InsetMath::(draw|metrics)Markers(|2) are removed
  and replaced by a new function drawMarkers in MathRow.cpp.

Now the marker type is kept in the MathRow::Element object (and set to
NO_MARKER in not editable context) and the marker is accounted for in
MathRow::(metrics|draw).

Moreover, the extra pixel for the marker is taken on the before/After
space if possible. The marker will only require extra space when
before/after is 0.

See comment 168 of #8883 to understand what issues are fixed.
2017-01-11 17:35:34 +01:00
Jean-Marc Lasgouttes
605438f26d Fix issues with macro_nesting handling
The rewrite of macro_nesting done at 0f15dcc6 was faulty, in
particular since the information should be available also at draw
time. To this end, we revert the patch of the said commit that removes
macro nesting information from MathRow::Element. In the next commit,
we will change the marker code so that MathRow::draw does not need the
nesting information.

Actually the code is now cleaner since the macro nesting stack of
MathRow::metrics can be removed.
2017-01-11 17:33:43 +01:00
Juergen Spitzmueller
74f774d6cf Merge branch 'master' into biblatex2 2017-01-11 10:45:48 +01:00
Juergen Spitzmueller
96ffb70cd5 Command line option to ignore error msgs
Needed by the test framework
2017-01-11 09:21:13 +01:00
Jean-Marc Lasgouttes
d221d1734a Fix display of empty box in nested macros
The rewrite of nesting handling at 0f15dcc6 was incomplete: the
macro nesting has to be reset to 0 when inside a macro argument at
level 1.
2017-01-10 14:14:57 +01:00
Juergen Spitzmueller
b9aabe6d89 Merge branch 'master' into biblatex2 2017-01-10 08:20:49 +01:00
Guillaume Munch
8914ddeaee Reorganise and simplify 2017-01-09 23:15:16 +01:00
Guillaume Munch
597de9bb8d Remove comments about enumification of toc types
This is no longer likely to happen.
2017-01-09 23:15:16 +01:00
Juergen Spitzmueller
425c190d62 merge recent changes from master 2017-01-09 20:04:32 +01:00
Juergen Spitzmueller
ffb195b5e9 Clarify layout and add some tooltips
Addresses: #9795
2017-01-09 18:54:49 +01:00
Guillaume Munch
5fdc577bad Improve the list of equations
Also convert other Tocs to TocBuilder when trivial, to make them customisable
2017-01-09 18:27:26 +01:00
Guillaume Munch
e11a3cb895 Remove some hardcoded addToToc: note, footnote, marginalnote, branch
Define their Toc from the layout instead.
2017-01-09 18:27:26 +01:00
Guillaume Munch
68109443f3 Implement AddToToc for paragraph layouts
Enables table of Theorems & Definitions
2017-01-09 18:27:25 +01:00
Guillaume Munch
5e20713769 Implement IsTocCaption for InsetArgument
Shows the title of Sweave, Knitr chunks in the Navigate menu.
2017-01-09 18:22:22 +01:00
Guillaume Munch
28dfc48fb2 Implement AddToToc layout command for Flex insets
Enables TOC for FiXme, ToDo, Knitr, Sweave (#7790)
2017-01-09 18:22:22 +01:00
Guillaume Munch
089b80fc7d Menus: Factor Toc code 2017-01-09 18:22:22 +01:00
Guillaume Munch
ab98adf925 Move Tocs to the "Other lists" submenu based on a blacklist
This causes user-defined Tocs to appear in the main list
2017-01-09 18:22:22 +01:00
Juergen Spitzmueller
a751c5b846 Extend and improve name list handling
This allows to generate different name lists depending on the need and
context.

Also addresses #8489.
2017-01-09 17:54:56 +01:00
Juergen Spitzmueller
322808281f Merge branch 'master' into biblatex2 2017-01-09 09:53:20 +01:00
Juergen Spitzmueller
a04a2f9a8a Remove Requires and Excludes from CiteEngines
These are exclusive anyway.
2017-01-09 09:04:37 +01:00
Enrico Forestieri
25e6b5da39 Avoid useless warning from Qt
When cloning InsetExternal, the tempname_ member of InsetExternalParams
has yet to be initialized. So, trying to remove it causes the warning
"QFile::remove: Empty or null file name".
2017-01-08 23:11:04 +01:00
Richard Heck
06e2669b35 Escape link name for DocBook.
Thanks to Martin Brown for pointing out the bug, and the obvious
solution.
2017-01-08 13:38:48 -05:00
Richard Heck
b730419470 Fix DocBook DTD identifier for XML output.
Thanks to Martin Brown for the correct one.
2017-01-08 13:37:00 -05:00
Juergen Spitzmueller
b81b439dec No punctuation in labels! 2017-01-08 15:24:39 +01:00
Juergen Spitzmueller
8319b3e9d6 Biblatex support
File format change
2017-01-08 09:39:46 +01:00
Juergen Spitzmueller
ecbd047cff Merge branch 'master' into biblatex2 2017-01-08 09:06:26 +01:00
Richard Heck
21259b66b5 Allow use of noprefix option even if we're not using refstyle.
I'm not sure why that would be useful, but there's no reason not
to allow it.
2017-01-07 17:26:06 -05:00
Richard Heck
2fbd9f6405 Alphabetize the list of LFUNs in LyXAction.cpp.
No one seems to  have been adding them `thematically', and it's too
hard to know how to do that, anyway. This at least makes it easier
to scan through the list.

I have verified, by re-generating LFUNs.lyx, that no significant
changes have been made here.
2017-01-07 16:00:37 -05:00
Richard Heck
ff3690a5fd Add a "noprefix" option to the "labelonly" version of the reference
inset.

If the reference is "sec:mysec", then this will output just "mysec".
This is what is needed, e.g., to use refstyle's range commands, e.g.,
    \secrangeref{mysec1}{mysec2}
You *cannot* use:
    \secrangeref{sec:mysec1}{sec:mysec2}
even if those are the actual labels.

Eventually, I'd like to add native support for this, but I'm a bit
frightened of trying to make the reference dialog support multiple
selections.
2017-01-07 15:07:44 -05:00
Juergen Spitzmueller
6974e1ceb2 Correctly set quote styles combo 2017-01-07 20:07:45 +01:00
Juergen Spitzmueller
dbbefcd321 Dynamically set final punctuation of bib entries
Fullcite does not need the punct.
2017-01-07 17:55:38 +01:00
Juergen Spitzmueller
53654b430e Make max_key_size limit adjustable
This _must_ be increased for xhtml output of fullcite, else we get
fragmentary html code.

I am aware of the reason for this size limit (#8944) and have carefully
checked that this is not affected.
2017-01-07 17:46:18 +01:00
Juergen Spitzmueller
2ff40fba72 Add a couple more BiblioInfo conditionals
* ifentrytype:<type> whether we are a specific entry type (e.g. "book")

* export: export context (as opposed to dialog or workarea)

* second: whether we are in the second item of a list (useful when you
  need to separate by " and " or ", and "
2017-01-07 17:45:51 +01:00
Juergen Spitzmueller
378a2c8257 Outsource jurabib specials to the style file. 2017-01-07 17:40:23 +01:00
Juergen Spitzmueller
fa2cbb730c Limit InsetCitation tooltip to sensible length 2017-01-07 17:38:25 +01:00
Juergen Spitzmueller
db889bc6a7 Add items to toggle "Force uppercase" and "Full author list" to the context menu 2017-01-07 17:37:35 +01:00
Juergen Spitzmueller
eba2f0479e Implement display of starred cite commands
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.
2017-01-07 17:32:45 +01:00
Juergen Spitzmueller
6933051747 Implement display of forceUpperCase 2017-01-07 17:21:41 +01:00
Juergen Spitzmueller
3a0d1d1049 Implement CiteItem in the chain
This allows us to get rid of many idiosyncratic arguments and gives us
a cleaner chain (plus easier extensibility).
2017-01-07 17:17:02 +01:00
Juergen Spitzmueller
2f1d1a60ac Add CiteItem class
This will be used to transfer any single-cite related information from
anywhere to BiblioInfo (instead of the many strings and bools we use
until now).

This is a prerequisite for some forthcoming fixes and enhancements.
2017-01-07 16:46:00 +01:00
Juergen Spitzmueller
979294d5ec New tag MaxCiteNames
This determines the number of authors before "et al.". We had it
hardcoded to 2, but actually the nuumber differs.
2017-01-07 16:44:27 +01:00
Guillaume Munch
ca6bc682e4 Lost in refactoring 2017-01-07 14:38:00 +01:00
Juergen Spitzmueller
23c231c761 Merge branch 'master' into biblatex2 2017-01-05 14:30:26 +01:00
Juergen Spitzmueller
4590f1016b Tweaks to the quotes GUI
This follows some suggestions put forward yesterday.
2017-01-05 14:25:36 +01:00
Guillaume Munch
d9018f14a6 Fine tune the math class of InsetMathScript after a4676712 2017-01-05 12:04:35 +01:00
Richard Heck
fe0d73dead Not sure why "notr = 'true'" got in there. 2017-01-04 16:01:32 -05:00
Richard Heck
e2ef07207e Some tooltips. 2017-01-04 12:50:51 -05:00
Juergen Spitzmueller
78eb821038 Fix default biblio style detection 2017-01-04 17:11:25 +01:00
Juergen Spitzmueller
7fe596b459 Consider possibility of empty tooltip 2017-01-04 13:29:57 +01:00
Juergen Spitzmueller
f6d4bce123 Merge branch 'master' into biblatex2 2017-01-03 21:49:56 +01:00
Guillaume Munch
a467671283 Define mathClass of MathMacro
Enables intelligent splitting for math macros.

Crucially improves the detection of math words for the new Ctrl-Arrow movement.
2017-01-03 20:35:41 +01:00
Guillaume Munch
eb2d373e4b Fix wrong parse of macro parameter and crash
Copy-pasting $#\n$ from text to LyX gives the error message:

    MathMacroArgument::MathMacroArgument: wrong Argument id

and it is not hard to get a crash soon after.

There are legitimate uses of # not followed by 1..9 in LaTeX and it is good to
parse them correctly when importing from LaTeX.
2017-01-03 20:35:41 +01:00
Guillaume Munch
981f065bde New word-movement behaviour in Math
Following discussion on the list:
https://www.mail-archive.com/lyx-users@lists.lyx.org/msg103012.html

This defines a new behaviour for Ctrl[+Shift]+Arrow in math:

* Left/Right does not enter insets

* Left/Right jump groups of insets that have the same math class ("words")

* Enable Up/Down for consistency.
2017-01-03 20:35:41 +01:00
Guillaume Munch
087f72202e Use math class information from lib/symbols for intelligent splitting
This was missing for macros defined in lib/symbols. This only affects the
equation splitting since global macros are always linearized. This fixes #10107.
2017-01-03 20:35:41 +01:00
Guillaume Munch
3e79e0f5f0 Fix wrong mode on output for macros that shadow global macros
Testcase: Define a math macro \AA, overriding the definition of \AA from
lib/symbols, then insert it in math mode.

* Before this commit: \text{\AA}, and \lyxmathsym{\AA} after deleting \text, but
  displayed like \AA.

* After this commit: \text{\AA} is inserted, but one gets \AA after deleting
  \text. The output is now consistent with the display and the meaning.

* Expected: only \AA is inserted. This is unfortuately not what one gets; for
  this to work, the scope of the macros would need to be resolved upon creating
  the inset.
2017-01-03 20:35:20 +01:00
Guillaume Munch
e35fda62a7 Some code factoring for changing mode.
About removing the changeEnsureMath in MathMacro::{metrics,draw} : as it is only
called in edition mode, it only happened for user macros for which no ensureMath
is needed anyway. ChangeEnsureMath should indeed be applied for global macros,
but since they are linearized there is no obvious place to call it.
2017-01-03 20:18:48 +01:00
Guillaume Munch
2de30c62f8 Remove hardcoded values 2017-01-03 20:18:48 +01:00
Juergen Spitzmueller
18d6701a40 No need to hardcode the possible cite commands
We fall back to a sensible default anyway.
2017-01-03 17:27:51 +01:00
Juergen Spitzmueller
e6666bd62a Generalize starred cite commands
Not all of them expand the author list. Thus rename the parameter to
hasStarredVersion and provide a means to adjust the GUI accordingly.
2017-01-03 17:25:41 +01:00
Juergen Spitzmueller
c88259453c Fix the alias detection 2017-01-03 15:05:55 +01:00
Juergen Spitzmueller
958f6193ed Differentiate InsetCite
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.
2017-01-03 13:11:11 +01:00
Juergen Spitzmueller
0b4d9d8d4a Generalize uppercase test
Biblatex has \Textcite and friends.
2017-01-03 13:01:41 +01:00
Richard Heck
c13fa33d87 Update tex2lyx tests to new format. 2017-01-02 22:32:45 -05:00
Richard Heck
00b8f04988 Adapt tex2lyx to the new file format. 2017-01-02 22:32:45 -05:00
Richard Heck
73f59e87bd Add ability to use refstyle's plural and capitalization features. 2017-01-02 22:32:36 -05:00
Richard Heck
78a76cc8d4 Update tex2lyx tests. 2017-01-02 18:14:41 -05:00
Richard Heck
c513c26e62 Label only command for reference dialog. 2017-01-02 18:08:30 -05:00
Juergen Spitzmueller
867cdb0662 Extend the Bibfiles cache
For biblatex, we need the file name as it was entered in the inset
(abs path, rel path, only file name) in order to resolve it properly
for the export (as in the BibTeX inset intself).

Therefore, we now store a pair<docstring, FileName>.

A FileNamePairList has been added to FileNameList for this purpose.
2017-01-02 13:00:14 +01:00
Juergen Spitzmueller
ee653e1968 Amend 8add88ee49: Show Biblatex files in the TeXInfo dialog
UI file was forgotten.
2017-01-02 12:05:14 +01:00