Commit Graph

25823 Commits

Author SHA1 Message Date
Enrico Forestieri
d5567ac36f Compile fix for mingw
This was probably overlooked at [7bb08f10/lyxgit].
2019-04-27 12:53:05 +02:00
Richard Kimberly Heck
c286228315 Make Ctrl-Mouse open an included file for editing.
It might be nice to do this also for other insets that allow editing.
To do that properly, we'd want to standardize how such insets call an
external (or internal) program, which I guess would mean a virtual
method corresponding to editIncluded. When it exists (i.e., isn't null),
then we could call it, and we'd only need one centralized method to do
that. But at the moment, we have editGraphics, etc.
2019-04-26 22:05:42 -04:00
Richard Kimberly Heck
276ffc262c Simplify a bit.
Also, I always worry that "file" will conflict with something....
2019-04-26 22:05:42 -04:00
Günter Milde
e84f6dff77 Fixes for Japanese documents
PDF outline improves with unicode/utf8 (although some chars still wrong).

Math: ERT for umlauts no longer required (now force-converted with unicodesymbols)
2019-04-26 23:02:44 +02:00
Kornel Benko
4e7cbe8b34 Cmate tests: Add citenegine-modules to tests 2019-04-26 16:55:30 +02:00
Enrico Forestieri
2731c5dc55 Correctly protect macros with optionals inserted in an optional argument
The trick turns out to be inserting in braces the whole optional
argument, rather than the single macro.

See #11552 for the long history.
2019-04-26 15:30:08 +02:00
Enrico Forestieri
e763f90244 Revert [60ac25a4/lyxgit], [30f16463/lyxgit], and part of [e8f480e7/lyxgit]
As evidenced in #11552, at loading time there is no way to tell
whether braces were added by LyX with certainty. However, after
[503f7db2/lyxgit], LyX does not automatically removes brace insets.
So, in case one faces the problems mentioned in [e8f480e7/lyxgit],
the workaround of adding a brace inset now will not be frustrated.
In essence, after [503f7db2/lyxgit], the real fix for #11552 would
have been reverting the part in [e8f480e7/lyxgit] that was adding
the braces on output.
2019-04-26 12:34:29 +02:00
Enrico Forestieri
30f1646369 Write braces around macros only when actually needed
When a macro with optionals appeared inside the optional argument of
another one, the onscreen display and latex output were wrong. This
issue was addressed at [e8f480e7/lyxgit] by enclosing in braces macros
with optional arguments. However, this was done even when the macro
with optionals was in a non-optional argument of another macro.
This commit limits the bracing to the cases where it is really needed
and allows to address some particular issues evidenced in #11552.
2019-04-25 11:11:51 +02:00
Enrico Forestieri
60ac25a435 Yet another attempt at properly fixing #11552
This commit supercedes [54147a71/lyxgit] and [acba8476/lyxgit].
2019-04-24 17:28:53 +02:00
Jean-Marc Lasgouttes
ddb51c721c Do not redefine LyXAlignment; reformat a bit 2019-04-24 16:28:08 +02:00
Jean-Marc Lasgouttes
26817e9347 remove dummy LyXRC class that was forgotten 2019-04-24 14:54:49 +02:00
Kornel Benko
ef285cb7c4 Amend 7d021a93: Use interprocedural optimization if possible
Discard test programs using dummy_fuctions from the optimization.
This omits warnings about multiple method definitions.
2019-04-24 14:47:44 +02:00
Enrico Forestieri
acba847649 Amend [54147a71/lyxgit]
If none of the optional arguments of a macro is used, there is no
following '[' after the macro name. Unfortunately, at loading time
the macro machinery is still not initialized, so the optionals()
member of InsetMathMacro is unusable. Hence, we have to track the
creation of macros with optionals as already we do for all macros.
The collected information is only used at loading time, because
the macros are dynamic and they may loose or acquire optional args.

Fixes the particular case reported at #11552.
2019-04-23 21:06:12 +02:00
Juergen Spitzmueller
b77094a497 Only write btUnits if we have a bibliography
Fixes: #11562
2019-04-23 08:58:01 +02:00
Juergen Spitzmueller
89f6de9835 Append rows and columns if necessary when pasting into table 2019-04-23 08:34:53 +02:00
Juergen Spitzmueller
302796ade1 Amend cf1c506d64
Get direct copying fro LibreOffice working
2019-04-22 11:10:07 +02:00
Juergen Spitzmueller
cf1c506d64 Handle plain text/html rows/columns in tabular LFUN_PASTE
Fixes: #7932
2019-04-22 10:56:00 +02:00
Juergen Spitzmueller
c9432ccbbc \cprotect some content in captions
Fixes: #6243
2019-04-21 16:44:29 +02:00
Juergen Spitzmueller
3663f9d0db Some more 0 > nullptr substitutions 2019-04-21 15:49:11 +02:00
Juergen Spitzmueller
96e4001d01 Handle orphaned bibitems
Fixes #7160
2019-04-21 11:17:44 +02:00
Juergen Spitzmueller
faefee3dc6 Fix renaming of citation refs after changing bibitem key
Fixes: #6494
2019-04-21 09:55:17 +02:00
Juergen Spitzmueller
0a4686d8d3 update buffer after fixBiblio
fixes: #2743
2019-04-20 19:53:24 +02:00
Juergen Spitzmueller
9370135c3e reset bibitem counter in the second updateBuffer() routine as well
Fixes: #8499
2019-04-20 19:42:29 +02:00
Juergen Spitzmueller
4f884fc92d Pass proper text to TeXOnePar in Paragrapgh::Private::validate
This fixes InPreamble layouts in insets (#11557)
2019-04-20 17:51:06 +02:00
Juergen Spitzmueller
e325c7cc6a GuiIdListModel: ignore DecorationRole (icons of available list) 2019-04-20 17:50:21 +02:00
Juergen Spitzmueller
b60259fbe1 Add system/local icon to available modules list
Also markup modules with missing requirements (like we do for layouts)
2019-04-20 09:28:46 +02:00
Juergen Spitzmueller
c0f734bcef Fix some listings/minted incompatibilities
The basic problem here is that rather than using an abstract syntax,
backend-specific param strings are produced in the listings dialog,
depending on whether listings or minted is used.

Of course this breaks if a user switches backends inbetween (s/he would
have to open and re-apply each and every listings inset!)

Do at least the most basic translations in InsetListings::latex().
A sane solution would imply the use of only one param syntax with
respective interpretation for each backend. But this would be a file
format change.
2019-04-19 19:03:29 +02:00
Enrico Forestieri
54147a7140 Fix #11552 in a different way
The reported issue is fixed in a different way, not
involving the fix for #9348.

This commit supercedes [f2029fb3/lyxgit] and [17abf68b/lyxgit].
2019-04-19 18:28:42 +02:00
Juergen Spitzmueller
3e516a6219 Use proper listings font styles with polyglossia and RTL
Fixes: #11554

Also load color with minted and polyglossia/RTL, as minted loads it
too late.
2019-04-19 17:18:18 +02:00
Kornel Benko
fe4a5c3bc9 Amend 7bb08f10 2019-04-19 15:40:58 +02:00
Jean-Marc Lasgouttes
7bb08f10b1 Move initial values of LyXRC members to the header
We use a C++11 construct that puts initial values of members along
with their definition. It is a good construct and now the out of line
constructor and the setDefaults() method can go.

This removes the need to define a dummy constructor in tex2lyx and
client.

The only needed change to the rest of code is a change of signature
for the user_(name|email) to return std::string. They are now called
explicitely from the constructor. We now have to include userinfo.h in
LyXRC.h, but this should not be too expensive.
2019-04-19 14:46:12 +02:00
Juergen Spitzmueller
499167b2c5 Another quotation mark fix. 2019-04-19 14:27:27 +02:00
Juergen Spitzmueller
ac84510453 Fix quotation marks in GUI string. 2019-04-19 13:43:33 +02:00
Juergen Spitzmueller
2fa68abd00 Layout tweaking 2019-04-19 11:27:54 +02:00
Juergen Spitzmueller
7cadacb19b The Author(Year) label format is also mandatory for numeric natbib! 2019-04-19 09:53:42 +02:00
Juergen Spitzmueller
e97546c9a8 More formalia
(this are just things QtCreator nags about, and I address them in passing)
2019-04-19 09:34:12 +02:00
Juergen Spitzmueller
bebc184054 Display full author list with Natbib (non-BibTeX) if requested 2019-04-19 09:33:31 +02:00
Juergen Spitzmueller
df0d7c0049 Do not owerwrite specific CiteFormat def with default def
amends 5996b2e373 and fixes natbib numerical display
2019-04-19 09:04:23 +02:00
Juergen Spitzmueller
d8afb81832 Break long string 2019-04-19 09:04:11 +02:00
Juergen Spitzmueller
5e385d0513 Formalia 2019-04-19 09:03:47 +02:00
Juergen Spitzmueller
8ecef0fcbc Available modules should not be editable. 2019-04-18 17:33:37 +02:00
Juergen Spitzmueller
8ee2ffaa52 Amend 3615a6a75b
Natbib provides separation of abbreviated and full author list also
beyond BibTeX
2019-04-18 16:27:22 +02:00
Jean-Marc Lasgouttes
c6754ed548 Do not redefine a stripped-down LyXRC object.
I am not sure why it was done this way, but it is not really necessary.
Moreover gcc LTO does not like it.
2019-04-18 15:55:40 +02:00
Günter Milde
6dd505c67a Don't force encoding switch for Japanese "listings" auto-strings.
listings copes with variable-width encodings under platex.
2019-04-18 15:27:24 +02:00
Kornel Benko
6eb9452836 Amend [f2029fb3/lyxgit]
Omitting acces to invalid index
2019-04-18 15:07:30 +02:00
Kornel Benko
d11bcac11a Add Notion entry to paragraph-select function
Thanks Pavel
2019-04-18 14:55:51 +02:00
Juergen Spitzmueller
aec50eec49 Fix doxygen comment 2019-04-18 14:51:10 +02:00
Juergen Spitzmueller
3615a6a75b Make usage of natbib without BibTeX more obvious
Fixes: #5549
2019-04-18 14:48:01 +02:00
Juergen Spitzmueller
70b3d3adcc Add NewlineCmd InsetLayout and Argument option
This allows to specific an alternative macro for newlines

Fixes: #10407
2019-04-18 11:35:03 +02:00
Juergen Spitzmueller
ed44bbddee Add MenuString to InsetLayout
Fixes: #8818
2019-04-18 10:27:19 +02:00
Enrico Forestieri
17abf68bac Amend [f2029fb3/lyxgit]
The fix for #11552 was reintroducing #9348. This commit makes sure
it stays fixed.
2019-04-17 18:08:46 +02:00
Enrico Forestieri
f2029fb386 Fix bug #11552
Do not insert a brace inset when we know that LyX wrote the braces.

This commit amends [503f7db2/lyxgit].
2019-04-17 16:03:13 +02:00
Kornel Benko
6747b3fe97 Don't switch encodings if in search modus 2019-04-17 07:40:31 +02:00
Günter Milde
27ba6f282d Rename legacy input encoding settings.
Format incremented to 573
2019-04-16 20:17:32 +02:00
Kornel Benko
e0f5641089 Select the whole paragraph with tripple-left-click
Fixes #9175

Also added new function: paragraph-select.
2019-04-16 19:50:31 +02:00
Jean-Marc Lasgouttes
f6f08f0c50 Revert "Make math autocorrrect work with more than 2 chars"
This reverts commit 144e7d7159.
2019-04-16 16:04:12 +02:00
Jean-Marc Lasgouttes
8e3972c35d Revert "Allow to undo partly math autocorrect"
This reverts commit f7a11ca711.
2019-04-16 16:03:57 +02:00
Jean-Marc Lasgouttes
048f9ee08e Rewrite the code that sets caret height in mathed
Instead of remembering the caret ascent and descent for the cell that contains the cursor, the new code remembers caret dimension for each MathRow object. This makes the code much less fragile (ans slightly smaller).

This fixes caret size issues when the Update::SinglePar flag is active.

Fixes bug #11541.
2019-04-16 15:58:51 +02:00
Jean-Marc Lasgouttes
f7a11ca711 Allow to undo partly math autocorrect
To this end, introduce Undo::splitUndoGroup, which ends currently
group and creates a new one with same nesting level.
2019-04-16 14:12:34 +02:00
Isaac
144e7d7159 Make math autocorrrect work with more than 2 chars 2019-04-16 14:12:34 +02:00
Enrico Forestieri
506324ef9d Properly fix #9616
Now all symbols in the unicodesymbols file having a mathcommand
are not wrapped in a \text inset anymore.
2019-04-15 20:56:52 +02:00
Juergen Spitzmueller
7ec81c651e Listings: language updates
Patch by Sergei Winitzki
2019-04-15 11:55:46 +02:00
Günter Milde
da23637d7f Do not switch the input encoding inside documents using platex.
Fixes wrong and missing characters in text parts in other languages
(platex does not support "inputenc").

Fixes compilation errors due to desynchronized encoding switches.
2019-04-12 18:08:17 +02:00
Günter Milde
ad8d1af907 platex input encodings: move handling of some "force" exceptions to unicodesymbols. 2019-04-12 18:08:17 +02:00
Günter Milde
f838b4fb18 platex fixes.
* Force unicodesymbols conversion for all *-platex input encodings,
* except some characters that work well in utf8.
* Use platex if document language is "japanese" and input encoding is "utf8".
2019-04-11 01:43:44 +02:00
Günter Milde
02e7bb80d3 Force unicodesymbols conversion with uf8-platex.
Fixes Japanese (platex) documents with text parts in other languages.
2019-04-10 16:08:43 +02:00
Günter Milde
6fd263122d Typographical corrections. 2019-04-10 15:59:17 +02:00
Jean-Marc Lasgouttes
f9da28428a Fix bold-like characters when selecting bidi text
In painter, restrting paining regions does not really work when region is empty.

Fixes bug #11198.
2019-04-09 11:32:22 +02:00
Kornel Benko
3f9cdc7c63 Amend e55ed79d: Extend handling of Noto fonts
Also renamed
        known_roman_fonts -> known_roman_font_packages
        known_sans_fonts -> known_sans_font_packages
        known_typewriter_fonts -> known_typewriter_font_packages
        known_math_fonts -> known_math_font_packages
2019-04-08 11:44:53 +02:00
Juergen Spitzmueller
dfde45a01a Do not attempt to show module info for category headers 2019-04-07 13:57:41 +02:00
Kornel Benko
6fc7739053 Adapt tex2lyx to the noto fonts extension 2019-04-07 13:47:45 +02:00
Kornel Benko
35ac73a425 Update tex2lyx tests due to format change 2019-04-07 13:30:31 +02:00
Juergen Spitzmueller
6482ddee30 tabular-style-insert: add rows also for 1x and 2x tables
Fixes: #11537
2019-04-07 12:10:03 +02:00
Juergen Spitzmueller
823263904f GuiDocument: Sort available modules by category
Also improve display of module information
2019-04-07 11:23:19 +02:00
Kornel Benko
e55ed79da9 Extend handling of Noto fonts
Added the possibility to use options Regular, Medium, Thin, Light, Extralight
2019-04-07 11:05:42 +02:00
Juergen Spitzmueller
6fef1cec1f Fix crash in GuiBibtex 2019-04-05 17:53:41 +02:00
Günter Milde
2183978f1a Amend 6def81f30f. Never switch encodings with XeTeX or LuaTeX. 2019-04-05 16:14:58 +02:00
Juergen Spitzmueller
38fbbf07cd GuiDocument: Add filter to modules selection
Sorting by category is needs more work, since the GuiIdListModel is
not suitable for trees.
2019-04-05 11:54:44 +02:00
Juergen Spitzmueller
fa79ff2db2 Resolve some implicit conversion warnings. 2019-04-05 11:54:44 +02:00
Juergen Spitzmueller
b5af05b4a7 Make module categories (almost) great again
The category tag was rarely used and thus not very useful. This adds
categorization to most modules (the rest will follow) and uses the
\DeclareCategory tag we use in layouts rather than the extra syntax
we used in modules. Categories are now added to the po files and
translated.

Note that this is work in progress: the current categories are still
subject to change.

The ultimate goal of this is to sort the modules in the GUI by category
as we do with layouts, examples and templates (and add a filter to search
for specific modules)

As it is now (with the many modules we accumulated), the module selector
is not really usable anymore. If you don't happen to know how exactly a
module is named, selecting a module is really a PITA.
2019-04-04 18:43:29 +02:00
Juergen Spitzmueller
f51fa38123 Prevent multiplication of preamble code
Fixes rest of #8229
2019-04-04 16:39:20 +02:00
Juergen Spitzmueller
0b54650f0e tex2lyx: improve module support
The current heuristics only considered modules with styles that defined
a searched command in their preamble, and only for commands/environments
that were defined in the document's preamble. This limited the module
support drastically.

The new heuristics also checks for commands coming from packages. If the
command is not (re-)defined in the document preamble, it checks modules
that provide a style with a matching LaTeXName, checks for their
requirements and matches those with the packages loaded by the document.

If no module provides a searched style, but we found modules that load
packages that are loaded in the imported tex file, and if those packages
are not auto-loaded by LyX anyway, we also load this module.

fixes: #11259, part of #8229
2019-04-04 16:01:07 +02:00
Juergen Spitzmueller
a5e89c842f update tex2lyx tests
\cmidrule(lr) now natively imported.
2019-04-04 09:33:53 +02:00
Juergen Spitzmueller
171e251189 tex2lyx: support for cmidrule trimming 2019-04-04 09:33:36 +02:00
Juergen Spitzmueller
7f24e3ad4f Update tex2lyx tests 2019-04-04 08:24:51 +02:00
Juergen Spitzmueller
97d3b73e9a Disable TABLUAR_STYLE_INSERT with TABULAR_INSERT 2019-04-04 08:24:25 +02:00
Juergen Spitzmueller
2709c5fb58 Initialize TabularCreate dialog enabled.
As pointed out in #10105.
2019-04-04 08:23:27 +02:00
Juergen Spitzmueller
324bfe90df Improve error message
* Take preceding line break out of the l10n range. This is bound to get
  lost in translation
* Display encoding names that people actually find in the GUI
2019-04-03 17:58:20 +02:00
Juergen Spitzmueller
4d513ca49e de.po 2019-04-03 17:57:38 +02:00
Juergen Spitzmueller
f60bda37a6 booktabs trimming: fix some thinkos 2019-04-03 17:18:21 +02:00
Juergen Spitzmueller
bf5d5e5d66 Fix cmidline trimming with multicolumns 2019-04-03 16:35:08 +02:00
Günter Milde
6def81f30f Fix #10600: XeTeX with 8-bit TeX fonts requires input encodings "utf8" or "ascii".
* New: support also utf8 (working around false positive test in "inputenc.sty").

* Do not force the change of input encoding to "ascii".

  Deny compilation with XeTeX if a document uses TeX fonts and a non-supported input encoding.
2019-04-03 15:32:44 +02:00
Jean-Marc Lasgouttes
051da4ba25 Fixup 283ac91a: Forgotten test for null pointer 2019-04-03 12:13:13 +02:00
Jean-Marc Lasgouttes
5e2b24c2a9 Document itemize bullets
Make the unicode value explicit as we do elsewhere.

Also change the value used for labeliv, since the current one may be
square with some fonts.
2019-04-03 12:03:24 +02:00
Jean-Marc Lasgouttes
283ac91aa7 Put end label on own row after display inset
This corresponds to what is done on display. The same should be done
for start label too (e.g. beginning of a proof), but this requires more
work.

This required to move the static function getEndLabel to Text.

Fixes bug #11536.
2019-04-03 11:17:14 +02:00
Juergen Spitzmueller
8085fc21f8 booktabs: support for \cmidrule trimming
This has probably still some rough edges, so please test thoroughly.

Fixes: #3072
2019-04-03 07:59:52 +02:00
Jean-Marc Lasgouttes
3b58e38dc6 Fixup ad79ac40: reintroduce markers around delimiters
The reasoning behind this change was not correct.

Fixes bug #11516.
2019-04-02 14:32:32 +02:00
Jean-Marc Lasgouttes
f609a4717f Pass a pit to Text::isRTL(), not a paragraph 2019-04-02 09:56:42 +02:00
Juergen Spitzmueller
0c18f6a8c1 Remove TODO entry
This is covered in the "Consider layouts in modules that do not have a
preamble definition" general TODO item.
2019-04-01 13:04:05 +02:00
Juergen Spitzmueller
9d384c3c12 Fix tooltip.
Thanks, Kornel.
2019-04-01 11:28:54 +02:00