Commit Graph

36543 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
2acc4fc54c Improve spacing of BOX elements
Tweak the algorithm so that a BOX math row element can have some
spacing. To this end, MathRow::before/after do not look at the type of
an element for deciding when to skip it, but rather to its math class.

In the new setting, the spacing algorithm works on all elements, but
skips the MC_UNKNOWN elements as if they were not present. As a
consequence, the two element types BEGIN and END have been replaced by
a single DUMMY (they can be recognized from their class).

To simply the code, add a new `mclass' argument to the
MathRow::Element constructor (default is MC_UNKNOWN).
2016-12-02 16:14:12 +01:00
Jean-Marc Lasgouttes
190d312e35 Factor out the code that handles default macro arguments 2016-12-02 14:56:09 +01:00
Jean-Marc Lasgouttes
0f15dcc698 Rewrite handling of macro nesting in math rows
Macro nesting is now recorded into the macro inset itself. This allows
the ArgumentProxy inset to determine whether it is editable or not by
looking at its macro.

Remove code in the metrics and draw methods of ArgumentProxy: this
code is AFAICS not active anymore, since arguments are linearized into
math rows.

Use Changer idiom to change locally the values of MecticsInfo::base.macro_nesting.
2016-12-02 11:56:49 +01:00
Jean-Marc Lasgouttes
58e479527e Reintroduce broken support for default macro arguments
This got forgotten in the math typesetting rewrite.

Fixes bug #10508.
2016-12-02 11:18:51 +01:00
Scott Kostyshak
e8844b87ee ctests: invert ar/Tutorial_pdf4_texF
ar/Tutorial.lyx was recently added at f0bc4d43.

Inverting this test is consistent with ar/{Intro,Shortcuts}.
2016-12-01 23:49:05 -05:00
Scott Kostyshak
2d7fd45b90 ctests: uninvert mathmacro tests
These tests now pass (uninverted), likely due to b14e9d52 and
e8f480e7.
2016-12-01 23:37:36 -05:00
Uwe Stöhr
f0bc4d43c1 Arabic Tutorial.lyx: new translation by Hatim 2016-12-02 02:12:58 +01:00
Enrico Forestieri
e8f480e7c2 Fix display and output of math macros with optional arguments
This is a long standing issue, present since the new math macros
inception in version 1.6. It manifests as a display issue when a
macro with optional arguments appears in the optional argument of
another macro. In this case the display is messed up and it is
difficult, if not impossible, changing the arguments as they do not
appear on screen as related to a specific macro instance. It also
manifests as latex errors when compiling, even if the latex output
is formally correct, due to limitations of the xargs package used
to output the macros. Most probably, both aspects have the same
root cause, as simply enclosing in braces the macro and its
parameters solves both issues. However, when reloading a document,
lyx strips the outer braces enclosing a macro argument, thus
frustrating this possible workaround.

This commit solves the display issue by correctly accounting for
macros with optional arguments nested in the argument of another
macro, and circumvents the xargs package limitations causing errors
by enclosing in braces the macros with optional arguments appearing
in the argument of an outer macro when they are output. This means
that when loading an old document with such macros and saving it
again, the macro representation is updated and will have these
additional braces. However, as such braces are stripped by lyx on
loading, there is no risk that they accumulate.

See also this thread:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg197828.html
2016-12-01 18:02:47 +01:00
Günter Milde
a0ebae829c ctests: univert aas_sample with LuaTeX test.
The missing character problem is fixed upstream.

Also fix the scaling of the \sun-symbol-index by wrapping the symbol in \text.
(wasysym's \sun is valid in text and math mode. LyX  currently adds a spurious \ensuremath.)
2016-12-01 11:47:12 +01:00
Günter Milde
b14e9d52ef Remove spurious body tags in macro test file.
As Enrico pointed out in http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg131411.html, the loading error of testcases_speed.lyx is caused by tags from a LyX development version that were later removed but never handled in lyx2lyx.

LaTeX export still fails with
! Argument of \xargs@grab@opt has an extra }.
2016-12-01 10:15:12 +01:00
Scott Kostyshak
795fa586a9 Invert failing unreliable tests
These tests are "unreliable" and thus their export status contains
less information than reliable tests. However, it contains some
information and could still be used to find regressions. This commit
helps keep the output of a vanilla "ctest" command clean.

See discussion here:
https://www.mail-archive.com/search?l=mid&q=20161127205800.epvjxkeri5yoeqwj%40steph
2016-11-30 09:45:11 -05:00
Kornel Benko
f04f7cc26a Development.lyx, updated handling of unreliable tests. 2016-11-30 11:47:39 +01:00
Kornel Benko
f09cc78a9c Cmake tests: make unreliable tests independent of inverted tests 2016-11-30 00:53:31 +01:00
Uwe Stöhr
3fee095a9d Tutorial.lyx: use a simple reference format for the Tutorial
The "<reference> on  <page>" reference format is too tricky for newbies, see e.g. bug #10494

- also update the corresponding example files
2016-11-29 01:56:11 +01:00
Uwe Stöhr
5bee5aa095 EmbeddedObjects.lyx: fix a typo spotted by a user 2016-11-29 01:29:25 +01:00
Uwe Stöhr
7c25e51385 Win installer: fix a bug 2016-11-27 15:33:06 +01:00
Uwe Stöhr
c438a93411 Win installer: finish work for new installer version 2016-11-27 14:35:55 +01:00
Tommaso Cucinotta
cc653feb60 Bump up RC fileformat after [244de5d2/lyxgit] for the new 'needauth' options.
Addressing #10481.
2016-11-25 23:33:08 +01:00
Günter Milde
ffe4471700 ctests: update invertedTests. 2016-11-25 18:23:12 +01:00
Scott Kostyshak
7cbbf00eaf Improve ctesting of Arabic documents
- invert the currently failing tests
- add a new test document that shows LyX's support of pdf2

For more details, see the discussion here:
https://www.mail-archive.com/search?l=mid&q=20161114035123.s5lt4ib4x4obtptp%40steph
2016-11-24 23:10:16 -05:00
Günter Milde
5fba6aed21 ctests: correct inversion pattern for utf8-cjk tests. 2016-11-24 11:53:18 +01:00
Tommaso Cucinotta
c636ded2b9 Better explanations to the user for [244de5d2/lyxgit] and
[830eb234/lyxgit] addressing #10481, so as to provide better clues as
to why the action is being forbidden or user authorization is needed.
2016-11-24 01:06:20 +01:00
Guillaume Munch
c3e33b765e Match the font in MathMacro::metrics with the font in MathMacro::draw
This fixes the "bad keming" of math ERT (in fact wrong metrics) which recently
was worsened by InsetMathChar substitutions and their MathClass spacing.

Also fix a small inefficiency: always prefer:

  Changer dummy = (currentMode() == TEXT_MODE)
    ? pi.base.font.changeShape(UP_SHAPE) : Changer();

over:

  Changer dummy = pi.base.font.changeShape((currentMode() == TEXT_MODE)
    ? UP_SHAPE : pi.base.font.shape());

The former only records and restores a value when the condition is satisfied,
and does not cost anything otherwise.
2016-11-23 23:18:02 +01:00
Tommaso Cucinotta
830eb234be Let LyX remember what documents 'needauth' converters have been authorized to run over by the user.
This is done by moving Converters::auth_files_ into a new SessionSection
subclass, along with the same read/write paradigm, as per Enrico's hint.
2016-11-23 22:17:13 +01:00
Tommaso Cucinotta
309209e319 Fix missing space in string from [244de5d2/lyxgit]. 2016-11-23 21:46:06 +01:00
Guillaume Munch
465260c05e Fix header 2016-11-23 19:16:18 +01:00
Jean-Marc Lasgouttes
7971dc83ef Fix some warnings after 6c9207579 2016-11-23 17:44:22 +01:00
Günter Milde
f174988b7f ctests: correct encoding tests
* Do not test encodings not supported by iconv (see #10502).
* uninvert export test that work.
2016-11-23 17:43:31 +01:00
Enrico Forestieri
6c92075799 Amend fix for #10428
- Allow using logical values for icon sizes as the standard sizes may
  differ among different icon sets
- Do not allow setting sizes smaller than smallIconSize

When the logical sizes differ and the icon set is changed, the correct
sizes are established only after a restart.
2016-11-23 17:30:49 +01:00
Kornel Benko
38199c8bfe Update sk.po 2016-11-23 16:04:54 +01:00
Uwe Stöhr
f3bdc76208 Win installer major review of Packages.txt file
MiKTeX made a major package cleanup during the last 2 weeks. (Which caused a lot of troubles btw.) Many packages were removed and renamed. Now the list is complete again.
2016-11-23 03:07:09 +01:00
Tommaso Cucinotta
244de5d2c1 Add 'needauth' option to converters that need explicit user authorization.
Addressing #10481.

This patch adds the new 'needauth' option for converters launching
external programs that are capable of running arbitrary code on behalf
of the user. These converters won't be run unless the user gives explicit
authorization, which is asked on-demand when the converter is about to
be run (question is not asked if the file is cached and calling the
converter is not needed).

The user prompt has a 3rd button so that he/she's not prompted again
for (any converter over) the same document (identified through
buffer->absFileName()).

Two preference options are added:

lyxrc.use_converter_needauth_forbidden disables any converter with
the 'needauth' option, which is meant to force user to an explicit
action via the preferences pane, before being able to use advanced
converters that can potentially bring security threats;

lyxrc.use_converter_needauth enables prompting the user for 'needauth'
converters, or bypasses the check if not enabled, falling back to the
previous behavior.

So, the first option is for maximum security, the second is for
maximum usability.
2016-11-22 23:54:58 +01:00
Kornel Benko
ff0c95aba6 Cmake build: Prepare for hardening use of external programs 2016-11-22 16:51:44 +01:00
Kornel Benko
7950d109c8 Add select whole buffer shortcut to emacs.bind 2016-11-22 13:10:57 +01:00
Günter Milde
7bb07f179a Mark failing encodings. See #10502. 2016-11-22 11:48:16 +01:00
Günter Milde
a5b5141c30 ctests: uninvert exports that work. 2016-11-22 11:47:12 +01:00
Guillaume Munch
eadc55b8b3 InsetMath: match the screen display with the EnsureMath behaviour in output 2016-11-22 11:30:26 +01:00
Guillaume Munch
b5af229208 frac: Add line thickness to height 2016-11-22 11:30:26 +01:00
Guillaume Munch
d5f139e71b Correct on-screen kerning in math for non-mu units
The current math style should have no impact on \kern1mu. This is another
benefit of a9eb87a8.

Testcase:
\begin{align*}
 & \kern1em a\\
 & {\scriptscriptstyle \kern1em a}\\
 & \kern18mu a\\
 & {\scriptscriptstyle \kern18mu a}
\end{align*}
2016-11-22 11:30:26 +01:00
Juergen Spitzmueller
6a437363fa de.po 2016-11-22 10:35:16 +01:00
Daniel Ramöller
e91572a00b Add the icon-size to the toolbar menu
- Adds LFUNs for setting the icon size
- Adds icons sizes to the Toolbars menu
- Uses the Toolbars menu as application context menu
- The context menu can now be user defined in stdcontext.inc

Fixes ticket #10428.
2016-11-22 10:00:52 +01:00
Juergen Spitzmueller
e5386ce473 Fix Polyglossia options for serbian
Script value is uppercase.
2016-11-21 18:57:04 +01:00
Jean-Marc Lasgouttes
004fdf6aeb Clear temp cutstack before exiting LyX.
Otherwise it is done in the exit handler, which leads to crashes.
2016-11-21 17:03:50 +01:00
Guillaume Munch
34b6b474ea Amend b30f8d3c
Fix assertion. Thanks Scott for the bisect and the trace.
2016-11-21 12:09:48 +01:00
Guillaume Munch
cf45810e43 Fix display of nicefrac solidus 2016-11-21 00:08:12 +01:00
Guillaume Munch
fdd09d6f51 Let math mu skips scale with zoom 2016-11-21 00:08:12 +01:00
Guillaume Munch
a42c315e79 Amend ad7e2435cf
InsetMathKern is also used for non-mu lengths.

Generalise the fix by moving to Length::inPixels (thanks Jaan-Marc).
2016-11-21 00:08:11 +01:00
Guillaume Munch
eacac8bea2 mathedSymbolDim only needs a MathBase 2016-11-21 00:08:11 +01:00
Guillaume Munch
a592f6dc06 Fix display of \slash inside different fonts
Also give slash a proper symbol
2016-11-21 00:08:11 +01:00
Guillaume Munch
71ce34e821 Improve fractions bar
* The bar grows with the zoom according to MetricsBase::solidLineThickness()

* The spacing around the bar grows with the font size.
2016-11-21 00:08:11 +01:00