Commit Graph

28572 Commits

Author SHA1 Message Date
Thibaut Cuvelier
e70cdfd3a2 InsetMathBox: split the boxed text into <mtext> and other tags, while boxing the whole inset within an <mrow>.
Rationales:
- previously, <mstyle> was used, but it's being deprecated for MathML 4 Core in favour of CSS and <mrow> (not a big deal in itself)
- the whole box cannot be hosted within the same tag, because neither <mstyle> nor <mrow> can have text, they need an intermediate container, <mtext> (which cannot hold anything else that pure text)
- new behaviour: always output a container for the whole box that has the right attributes, i.e. an <mrow>; split the content of the cell to have text and other tags set apart (text in <mtext>, other tags left as they were)

Old behaviour, invalid MathML (2 to 4):
<mstyle XXX>text<mn>.</mn></mstyle>

New behaviour, valid MathML:
<mrow XXX><mtext>text</mtext><mn>.</mn></mrow>
2023-01-08 02:36:48 +01:00
Thibaut Cuvelier
d3c81eb2cb InsetMathBox: fix strange indentation (mix of spaces and tabs). 2023-01-08 00:51:43 +01:00
Thibaut Cuvelier
edcaad2419 MathML: convert InsetMathBox as <m:mtext>.
The inset represents text (as opposed to maths in formulae). <m:mstyle> is used to give style to its children, it is not supposed to have any contents on its own.
2023-01-08 00:50:29 +01:00
Thibaut Cuvelier
6a3bd64032 LyXHTML: use a lower-case meta for generator, this is the most common convention. 2023-01-07 16:24:57 +01:00
Thibaut Cuvelier
a5c6215ebd LyXHTML: add a missing space in the content-type annotation. 2023-01-07 16:23:56 +01:00
Thibaut Cuvelier
fb4a26577e LyXHTML: don't explicitly mention that the style is CSS, HTML5 doesn't like it. 2023-01-07 03:42:11 +01:00
Thibaut Cuvelier
fd2078f3aa LyXHTML: remove the double specification of charset.
The choice of content-type is arbitrary.
2023-01-07 03:36:57 +01:00
Thibaut Cuvelier
cabb12ba51 LyXHTML: fix the content-type attribute, it must be lower case (enforced for HTML5). 2023-01-07 03:33:48 +01:00
Thibaut Cuvelier
26e6b1c209 LyXHTML and DocBook: encode language codes as BCP47. 2023-01-07 03:31:40 +01:00
Thibaut Cuvelier
3cf8ced72e Make formatting of DocBook changes more similar to surrounding code.
Spaces between if and condition.
2023-01-07 02:56:40 +01:00
Jean-Marc Lasgouttes
9dd716da3a Row breaking: keep unused tail for later (instead of assertion)
Instead of asserting when there are unprocessed row elements (which,
as I understand it, should almost never happen), play safe and keep
them for later processing.

Related to bug #12617.
2023-01-06 16:02:29 +01:00
Jean-Marc Lasgouttes
cb3de88cc4 Fixup dcef1a9c: better handling of front-of-string splitting
When splitting a string leads to a break before the first character, the
best is to declare that splitting failed.

Fixes bug #12617.
2023-01-06 15:56:54 +01:00
Scott Kostyshak
bee08b19ee Typo in a comment 2023-01-05 23:33:16 -05:00
Stephan Witt
bbc2270972 #12523 check for existence of usable Python interpreter
- present appropriate alert message in case of missing Python
- add the option to quit LyX immediately
- recheck for Python interpreter on reconfigure if it was missing
2023-01-06 00:32:09 +01:00
Jean-Marc Lasgouttes
7c5bad56c4 Add information to Row::operator<< 2023-01-05 11:56:56 +01:00
Richard Kimberly Heck
30189332c8 Fix minor bug mentioned in #10827 2023-01-04 23:23:30 -05:00
Richard Kimberly Heck
04025d0259 Fix compilation problem 2023-01-04 23:04:02 -05:00
Scott Kostyshak
09e25ca5b7 Fix compiler warning -Wstring-plus-int
Similar to d44eaa97.
2022-12-29 16:25:42 -05:00
Juergen Spitzmueller
38c118b02d Fix output of tex2lyx messages in runtests.py 2022-12-29 15:10:05 +01:00
Juergen Spitzmueller
a5115d4e4a tex2lyx: Also factor out error and debug messages 2022-12-29 09:37:00 +01:00
Scott Kostyshak
d44eaa9713 Fix compiler warning -Wstring-plus-int
Warning was as follows:

  src/tex2lyx/Parser.cpp:898:39: error: adding 'uint32_t' (aka 'unsigned int') to a string does not append to the string [-Werror,-Wstring-plus-int]
                  warning_message("ignoring a char: " + static_cast<uint32_t>(c));
                                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  src/tex2lyx/Parser.cpp:898:39: note: use array indexing to silence this warning
                  warning_message("ignoring a char: " + static_cast<uint32_t>(c));
                                                      ^
                                  &                   [                         ]
  1 error generated.
2022-12-28 21:58:30 -05:00
Juergen Spitzmueller
9ecc30174a Factor out tex2lyx warnings and add -q option (#11328) 2022-12-28 16:29:38 +01:00
Juergen Spitzmueller
9047d60c5a tex2lyx: exit earlier if input file could not be found
In particular, do not write an empty .lyx file (#12339)
2022-12-28 14:05:23 +01:00
Juergen Spitzmueller
992e3aec88 Support suffix-less tex file input in tex2lyx (#12340) 2022-12-28 13:35:12 +01:00
Thibaut Cuvelier
7a67302c01 Amend febd1855eb: fix compilability 2022-12-28 12:57:45 +01:00
Juergen Spitzmueller
abe7adc8af Update tex2lyx tests again 2022-12-28 12:32:39 +01:00
Juergen Spitzmueller
b3a1caa9b9 Update tex2lyx tests after 7868929aac 2022-12-28 12:32:39 +01:00
Juergen Spitzmueller
32b5d253d1 tex2lyx: consider utf8 default encoding in newer LaTeX 2022-12-28 12:32:39 +01:00
Juergen Spitzmueller
2dafc6af0d Fix indentation 2022-12-28 10:58:36 +01:00
Juergen Spitzmueller
7868929aac tex2lyx: put adjacent comment lines in one ERT inset (#4797) 2022-12-28 09:40:22 +01:00
Thibaut Cuvelier
8b5bfa971b Amend febd1855eb: fix compilability of tex2lyx 2022-12-28 02:33:11 +01:00
Thibaut Cuvelier
4aeba17895 Fix a typo in a comment 2022-12-28 02:32:05 +01:00
Thibaut Cuvelier
febd1855eb XML: overhaul the tag-comparison operators.
First and foremost, this patch implements the latest best practices in C++ (i.e. comparison operators are not member functions).

The main objective of this rewrite is to have these operators callable in slightly more general contexts (*this->asFontTag() == *rhs.asFontTag() yielded an error because no member function could be called). This feature is no more required.

The rewrite took place in the context of https://www.lyx.org/trac/ticket/12585. The first iteration was using more complex code to circumvent XMLStream in DocBook (see details in the bug above and in the mailing list), while this one uses XMLStream fully. The bug was due to font tags being considered equal when they were not, due to the comparison done only on the XML tag and not on the actual font change (XML attributes can complement the tag for various font changes).
2022-12-27 16:52:51 +01:00
Thibaut Cuvelier
16a1aa9901 DocBook: add support for DocBookGenerateTitle.
The new parameter allows more flexibility when encoding some elements that have a poor mapping in DocBook, like theorems. The major use is to wrap the environment in a generic container, figure, which requires a title (but none is available).
2022-12-27 15:52:26 +01:00
Juergen Spitzmueller
69d54ff9d8 Master/Child: do not clean includeonly list while editing (part of #12470) 2022-12-27 15:36:36 +01:00
Juergen Spitzmueller
4c8a698a28 MasterChild.ui: Group radio buttons (part of #12470) 2022-12-27 15:10:37 +01:00
Thibaut Cuvelier
ed7072985e DocBook: for computing font changes, simplify code by removing state evolution from iteration to iteration. This surely makes the code slightly slower (although the compiler should be smart enough), but (much) easier to reason about. 2022-12-27 01:58:48 +01:00
Thibaut Cuvelier
2b03f0a2c1 DocBook: add some TODOs for the future. 2022-12-27 00:03:07 +01:00
Thibaut Cuvelier
e3eddd4cf9 Add comments about variable usage. 2022-12-26 20:57:44 +01:00
Thibaut Cuvelier
8b6ec979ff Fix a typo in a comment. 2022-12-26 20:57:24 +01:00
Thibaut Cuvelier
b2fdc04f96 InsetIPAMacro: implement the XHTML conversion, refactor plaintext and DocBook to share more code. 2022-12-26 20:54:36 +01:00
Thibaut Cuvelier
3839897c0f InsetMathExFunc: use XML entities instead of HTML in MathML.
This part should have been committed with bc73a857 in the first place.
2022-12-26 20:38:06 +01:00
Thibaut Cuvelier
9b80a5ba9e InsetMathSpace: use XML entities instead of HTML in MathML.
This part should have been committed with bc73a857 in the first place.
2022-12-26 20:35:26 +01:00
Thibaut Cuvelier
df025d15df InsetIPAMacro: refactor code between DocBook and XHTML. 2022-12-26 20:23:05 +01:00
Thibaut Cuvelier
21d1d917ba DocBook/HTML: use XML entities for spaces.
This part should have been committed with bc73a857 in the first place.
2022-12-26 19:11:41 +01:00
Juergen Spitzmueller
0c56f60535 Associate "run:" link types with "Other" 2022-12-26 13:19:52 +01:00
Juergen Spitzmueller
be25181d87 Disambiguate string 2022-12-26 11:24:29 +01:00
Juergen Spitzmueller
14d74c9578 Try to be more precise in the hyperlink type tooltips 2022-12-26 10:46:54 +01:00
Juergen Spitzmueller
d3b5905007 tex2lyx: support "Other" type 2022-12-26 10:40:39 +01:00
Juergen Spitzmueller
5f8e41dc9b GuiHyperlink: some minor fixes
* disambiguate "Other" label
* Add accelerator
* Add tooltip to "Other" widget
* Amend tooltip of "Web" widget (since "other" now seems to have taken
part of its function)
2022-12-26 10:13:51 +01:00