Commit Graph

2818 Commits

Author SHA1 Message Date
Georg Baum
5dc9568f8d Native support for \smash[t] and \smash[b]
This is a follow-up of bug #8967. The implementation is self-explaining, the
only part which needs a comment is lyx2lyx: Since a 100% correct solution is
not possible, it has been decided not to switch amsmath off in the forward
conversion if no other ams command than \smash[t] and \smash[b] is used, but
to consider it a bug that older versions do not load amsmath automatically for
these commands. In the backward direction it is easy to keep the document
compilable, so just do that.
2014-05-27 22:13:58 +02:00
Enrico Forestieri
7145863466 Generalize control on double blank lines.
We can now tell whether a blank line was just output and so can
avoid outputting another one.
2014-05-20 21:52:29 +02:00
Jean-Marc Lasgouttes
275b7af75e Code cleanup: get rid of RenderPreview::status()
This method is a proxy for LyXRC::preview that forces to forward
declare some wrapper around an enum...

Instead, two simple static methods previewMath() and previewText() are
introduced, that make the code much easier to follow.
2014-05-20 12:19:26 +02:00
Jean-Marc Lasgouttes
3b3d28cf8e Rename misleading parameter.
... and a typo and some whitespace.
2014-05-14 18:09:40 +02:00
Enrico Forestieri
3e681bea4f Fix problem with drawing of math backround with selections. 2014-05-07 14:18:14 -04:00
Jean-Marc Lasgouttes
5c32dc85d5 Fix various warnings issued by clang++.
* remove unused class TexStream.

* remove unused virtual method Inset::cellXOffset

* remove second argument of FileDialog constructor, which was actually
  not used

* remove some dead local code

* remove some unused private members of classes

* in InsetMathNest::updateBuffer, fix the logic of a test
2014-04-22 00:04:04 +02:00
Richard Heck
c0be76a2d6 Whitespace. 2014-04-21 11:52:00 -04:00
Richard Heck
065db68067 Fix a bunch of minor issues discovered by the cppcheck script. 2014-04-21 11:52:00 -04:00
Richard Heck
84d4d45daa Fix two thinkos caught by the cppcheck script. 2014-04-21 11:52:00 -04:00
Juergen Spitzmueller
302228625b Stabilize mouse selection in mathed
Fixes: #9074
2014-04-21 11:51:59 -04:00
Richard Heck
8b00b355ca Change forToc() to forOutliner(), to avoid confusion. The old name
is left over from when the outliner really did just display a TOC.
2014-04-21 11:51:59 -04:00
Richard Heck
7765b1c9a8 Draw a small red frame around preview images that are too small. 2014-04-21 11:51:57 -04:00
Juergen Spitzmueller
33e10ff213 Fix selection drawing after mouse-double/triple in mathed
Fixes: #8829
2014-04-21 11:51:56 -04:00
Juergen Spitzmueller
fb21a63339 Set cursor pos after cursor idx to avoid invalid cursor.
Fixes: #9076
2014-04-04 11:39:22 +02:00
Georg Baum
e85e9424b3 Fix display of predefined macros (bug #9059)
This was a regression of e86cdc40: A newly introduced member variable was
not initialized in the constructor, which made it quite random whether symbols
like \coloneqq where displayed correctly or as an empty edit box.
2014-03-28 23:16:36 +01:00
Georg Baum
c9a49d2145 Arrgh, fix warning 2014-03-09 18:49:09 +01:00
Georg Baum
a6f4aa2d18 MSVC compile fix 2014-03-09 18:19:01 +01:00
Georg Baum
23752e6114 Disable unicode math symbol replacement.
This seems to work only in some cases, so better display the symbol in ERT.
2014-03-09 10:57:09 +01:00
Georg Baum
be0cd47559 Work around broken math symbol display (bug 7954)
This extends the already existing math symbol fallback mechanism in two ways:
1) When considering the availability of the math font, also take broken
   code points into account. These are currently 0x0009 and 0x00ad, depending
   on the platform.
2) If the fallback symbol in the standard "Symbol" font is not given, or if
   the "Symbol" font is not available, or the fallback symbol is one of the
   broken ones, try to use a generic unicode symbol as second fallback instead.
   If this is available, we rely on Qt to find a font which has it. Only if
   this is not available, display the symbol as ERT.
This ensures that we do never get a symbol which is not displayed: Either
it can be displayed, with or without fallback, or it will be shown as ERT.
2014-03-08 11:13:39 +01:00
Georg Baum
a09ec1fe43 whitespace 2014-03-08 10:57:24 +01:00
Richard Heck
e86cdc4020 Fix bug #8999 by locking math macros while they are updating. 2014-03-05 18:46:38 -05:00
Georg Baum
07afd76b7c Fix compilation with libc++
libc++ (http://libcxx.llvm.org/) is used on OS X with newer XCode.
The patch is from Benjamin Piwowarski <benjamin.piwowarski@lip6.fr>, I only
added more comments.
The changes regarding implicit conversion to bool of std::iostream work
because both the C++98 and C++11 standards guarantee that boolean evaluation
of streams returns !fail(). See e.g.
http://stackoverflow.com/questions/1334858/why-dont-iostream-objects-overload-operator-bool
for details.
2014-03-04 23:27:57 +01:00
Georg Baum
5dedf8005d Fix dataloss for align env inside math
The math parser aborts with an error message on \begin{align} and
\begin{align*} if this is not the hull inset. This is now fixed, however
this is not complete support for these two environments (the GUI does not
respect the numbering). It is only the minimal fix that ensures that no data
loss occurs for documents imported by tex2lyx.
2014-02-27 21:25:19 +01:00
Georg Baum
7f373e8de1 Fix misparsing of alternative simple formulas
This comes from trying to run tex2lyx on the AMS math test document
testmath.tex. Both \(...\) and \begin{math}...\end{math} are defined as
inline math formulas in standard LaTeX. tex2lyx recognizes this, but the
math parser in LyX did not handle "\begin_inset Formula \(" and
"\begin_inset Formula \begin{math}" correctly.
The fix is simple and safe: If we are in undecided mode (this is only true
for the first token of a math inset), create a hull inset of the respective
kind. Otherwise, handle the commands as before.
2014-02-26 21:54:09 +01:00
Georg Baum
9130bdb5ec Add missing math delim decorations
This avoids a message "Deco was not found. Programming error?" on stderr.
The added decorations are defined by amsmath, and equivalent to \vert (single
vertical bar) and \Vert (double vertical bar), respectively. They are used to
distinguish the single and paired versions (for use with \left and \right).
These symbols should cause amsmath to be loaded, but this would be too
dangerous to implement now.
2014-02-26 21:18:31 +01:00
Georg Baum
bd79001387 whitespace 2014-02-25 21:21:47 +01:00
Georg Baum
877e73e0a2 Fix bug #8784 (mathml export for scripts)
For displaystyle scripts we need to use munder, mover or munderover.
2014-02-22 19:01:20 +01:00
Enrico Forestieri
3c1969574f Fix bug #8889 by always issuing \protect in fragile environments. 2014-02-22 10:30:55 -05:00
Georg Baum
acb7906fb5 Fix remaining part of bug #8967
Now interactive insertion of \smash[t] and \smash[b] is possible again.
\smash with optional argument behaves now exactly as in LyX 2.0.x, and without
optional argument it is supported by InsetMathPhantom.
2014-02-21 21:31:35 +01:00
Georg Baum
227675ee02 Fix regression of 18779013 for \smash
When adding native support for \smash in 18779013 I overlooked that amsmath
redefines \smash to take an optional argument t or b. These optional
arguments are not parsed correctly anymore (bug 8967). This change fixes
the regression, so that \smash with optional argument appears in red, as it
was before th introduction of the native smash inset.
In the future, we should have native support for \smash[t] and \smash[b]
as well, but this would be a file format change (automatic amsmath loading),
and it is too late for 2.1.0.
2014-02-19 20:50:57 +01:00
Uwe Stöhr
789a6ebf2a InsetMathXArrow.cpp; code simplification 2014-02-17 02:11:57 +01:00
Uwe Stöhr
e9ce68dddc InsetMathXArrow.cpp: the cells of \xleftarrow must be centered
the cells are centered in the output so also center them in LyX
2014-02-17 01:23:16 +01:00
Uwe Stöhr
8c33f73cc7 MathSupport.cpp: fix drawing of leftrightarrow
- to see the difference use this in a formula:
\overleftrightarrow{aasasasasassdsdsdasdsdsd}
2014-02-17 01:19:31 +01:00
Jean-Marc Lasgouttes
e7a1cce551 Rename some LFUN names to match their text name
Also, rename copy-label-as-reference to label-copy-as-reference and update LFUNs.lyx accordingly.
2014-02-13 13:50:33 +01:00
Juergen Spitzmueller
8b1504d7ad Do not crash with empty (invalid) math environments (part of #8359) 2014-02-10 09:24:14 +01:00
Juergen Spitzmueller
d4f04513c2 Fix LFUN_MATH_AMS_MATRIX: it was possible to generate corrupt documents (part of #8359) 2014-02-10 09:23:17 +01:00
Vincent van Ravesteijn
fc6b8c64f8 Return true to indicate we might have invalidated the cursor
If we don't do so, Cursor::notifyCursorLeavesOrEnters might continue with
an invalidated cursor.

Fixes-bug: #8329
2014-02-07 23:04:15 +01:00
Vincent van Ravesteijn
6ed292122d Make the export of macros thread-safer
When we export the file to latex, we use the redefinition_ variable to check whether we should output newcommand or renewcommand. This variable was set by the MathMacroTemplate::metrics() function, and this caused problem when the export is running in a different thread as the GUI.

In general, the metrics() functions should not change the Buffer; we have updateBuffer/updateMacros for that purpose.
2013-10-12 02:36:08 +02:00
Georg Baum
561c5bfd50 Fix missing updates for lazy MacroData
Not all accessors did update the data previously. Therefore it could happen
that document export from the command line would output \newcommand, and from
GUI it would output \renewcommand for the same macro, simply because in the
GUI case the data was updated as a side effect of the GUI thread reading some
other member.
I also removed the mutable flag for requires_, since this member is always
set on construction and does not need any lazy update.
2013-10-11 20:38:05 +02:00
Vincent van Ravesteijn
8164fea772 Encodings: Use BufferEncodings where needed 2013-09-29 15:26:22 +02:00
Tommaso Cucinotta
0b6edb0b2f Revert "Let non-ASCII chars within regexp insets match their occurrence within TEXT, rather than MATHS (seems the most recurrently needed scenario)."
This reverts commit 6a3792bdbb.
2013-08-24 17:42:14 +01:00
Tommaso Cucinotta
203dab97c3 Now the regexp insets entered in Advanced F&R search/replace boxes do not preview anymore independently, unless embedded/nested within other math elements.
Fixing crash as described in #7805.
2013-08-24 13:06:05 +01:00
Richard Heck
30d3fcd640 Fix bug #8746: Images have to have alt tags. 2013-06-12 17:25:39 -04:00
Pavel Sanda
63c193afef Remove years forgotten files.
http://marc.info/?l=lyx-devel&m=136956959518828&w=2
http://marc.info/?l=lyx-devel&m=120506622513617&w=2
2013-06-03 02:35:32 -07:00
Pavel Sanda
f75becdc4e Years forgotten file 2013-05-25 16:40:19 -07:00
Pavel Sanda
0ce10160da Header cleanup cont. 2013-05-25 16:38:20 -07:00
Pavel Sanda
f6d505c1ee Years forgotten files. 2013-05-23 22:17:20 -07:00
Pavel Sanda
84c5e67e07 Header cleanup cont. 2013-05-23 22:12:29 -07:00
Lars Gullik Bjønnes
704328d348 Remove ; from end of function definitions 2013-05-12 13:04:18 +02:00
Jean-Marc Lasgouttes
623d2f9530 More llvm/clang warnings
This is mostly unused private class members.

There are also a few unused functions that got #if'ed out. I never know in this case whether the code should be nuked.
2013-05-02 18:27:32 +02:00