Re: Regressions in 2.4 xhtml export [was: TESTING Tarballs for 2.4.0]
On Mon, 20 May 2024 at 15:50, Pavel Sanda wrote: > On Mon, May 20, 2024 at 03:24:30AM +0200, Thibaut Cuvelier wrote: > > > InsetInfo shortcuts export to xhtml is borken compared to 2.3. > > > > > > In 2.3 we exported: Ctrl+N > > > In 2.4 we expor: Ct+r+l+++N > > > > > > Thibaut, I guess this is due to new xml routines, could you have a > look? > > > > > > > Actually, it was due to the refactoring for direction in HTML5. I have > > pushed 7cfe36e6aa4460ae8641cd36f4aab5f013390326 and > > e3f2b10842cdc808e9f2bf235692f283009d3734 to fix that. This could make it > to > > 2.4.0, as it is a bit serious. > > I vote for 2.4.0 as well, the fix is restricted to xhtml code which > shows regression anyway. > Riki? > > > Related issue: > > > > When exporting the document (User's guide) as XHTML (I haven't configured > > LaTeX with my development LyX), I am repeatedly getting this message: > > > > Warning: No bibliography processor found! > > > > The bibliography processor requested by this document (bibtex) is not > > available and no appropriate alternative has been > > found. No bibliography and references will be generated. > > Please fix your installation! > > > > The problem is that it appears repeatedly, meaning more than 10 times for > > the user's guide at HEAD, apparently at each call to Inkscape to > transform > > SVGZ to PNG. > > Seems as two independent problems to me. Isn't it that you actually miss > both svg converter and bibtex? > The problem is that LyX tells me there is a problem more than 10 times for one document, 10 times the same error, with a modal window that seems to block further processing of the document. I can just set the PATH in LyX' configuration for these messages not to appear any longer, but they shouldn't be that present if you haven't configured LaTeX. In other words, my only complaint is about the number of errors that LyX shows the user, a single occurrence would be better. > > > - nested bullet points in listings shifted by an inch and overlap with > > > text - e.g. section 2.8, 3.1.4, 3.7.6 etc > > > > > > > That's both a CSS and an HTML issue: CSS for the subitems (like Ctrl in > > 2.8), HTML for continuing items (like Alt in 2.8). For the CSS part, > adding > > this rule seems to help: > > > > li.labeling_item ul, li.labeling_item ol { > > text-indent: 0; > > margin-left: -5em; > > } > > > > However, the result with nested lists is still very poor (with ".." > being a > > subitem to Home and End): > > > > [image: image.png] > > Not great indeed, but better than the current situation. > > > The problem is that this is configured in most layouts (HTMLStyle block), > > so it is painful to fix. > > > > The best solution in the long term, in my opinion, is to switch to HTML > > definition lists, which is semantically correct (while the current output > > is not a good use of lists). It mostly works out of the box, with no CSS > > changes. I believe the C++ changes would be quite minimal, but it would > > break any custom CSS. I am attaching an excerpt from the User's guide: > > `UserGuide_list.xhtml` for the current output, `UserGuide_list - > > Copy.xhtml` for my proposed refactoring. The result is quite close to > what > > we have in LyX. I bet this change should be delayed to 2.4.1, as it might > > break a bit more, or even 2.5 if we consider this kind of change > breaking. > > Riki, might want to chime in here as he was behind original xhtml design. > I find switch to html lists conceptually better, though they are visually > somewhat distinct - label is on it's own line AFAICS. > That's fixable, for instance https://stackoverflow.com/questions/1713048/how-to-style-dt-and-dd-so-they-are-on-the-same-line. > When it comes to timing: > - CSS change could go IMHO into 2.4.0, but it will break custom CSS anyway > right? > It might break some of the custom CSS. > - I do not know how C++ changes would look like, if they are indeed minimal > I would consider them for 2.4 as well. I understand that it might break > custom CSS but at the moment we are producing trash by default. > I dug deeper into the problem. Actually, it will require some change in the module format to specify that the label must be output outside the item in InsetText. With the current code, here is the best I can get: Label desc The change is that a Style should allow an HTMLInnerTag. A layout configuration like this should suffice, otherwise: Style Labeling HTMLTag
[LyX/master] XHTML: in InsetGraphics, use the bounding box that LyX computes for each image instead of using the scale.
commit ce5f84ff02e04a10d345776571ae0a2439b09e8f Author: Thibaut Cuvelier Date: Mon May 20 16:59:46 2024 +0200 XHTML: in InsetGraphics, use the bounding box that LyX computes for each image instead of using the scale. --- src/insets/InsetGraphics.cpp | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index d4d0fd7049..1d19507d00 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -1086,17 +1086,24 @@ docstring InsetGraphics::xhtml(XMLStream & xs, OutputParams const & op) const bool const haveheight = !params().height.zero(); if (havewidth || haveheight) { if (havewidth) - imgstyle += "width: " + params().width.asHTMLString() + ";"; + imgstyle = "width: " + params().width.asHTMLString() + ";"; if (haveheight) imgstyle += " height: " + params().height.asHTMLString() + ";"; } else if (params().scale != "100") { - // The `scale` CSS property is supposed to be used for responsive - // designs, but it behaves mostly as LyX. The only problem is that - // the image's bounding box is not scaled. (As opposed to a width, - // which is a percentage of the HTML container: the meaning of the - // percentage is completely different, but the bounding box has the - // right size.) - imgstyle = "scale: " + params().scale + "%;"; + // Use the scale on the bounding box. + char* endPtr; + double const scale = strtod(params().scale.c_str(), ); + if (*endPtr == '\0') { // Parsing was possible. + Length width = params().width; + width.value(scale * width.value()); + Length height = params().height; + height.value(scale * height.value()); + + imgstyle = "width: " + width.asHTMLString() + "; "; + imgstyle += "height: " + height.asHTMLString() + ";"; + } + // Otherwise, failure to parse the scale: no information to pass on + // to the HTML output. } if (!imgstyle.empty()) imgstyle = "style='" + imgstyle + "' "; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] XHTML: export paragraph IDs also for list items, but not for the opening tag of the list.
commit 2d86b881242c3ea4756af28f8458aeb7cbfa6822 Author: Thibaut Cuvelier Date: Mon May 20 03:21:00 2024 +0200 XHTML: export paragraph IDs also for list items, but not for the opening tag of the list. The IDs are used to link to specific elements (for instance, the User's guide nomenclature). The beginning of the list ( or ) has the same magic ID as the first item of the list. --- src/output_xhtml.cpp | 33 - 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index c83fdeed82..4cb1d2f7c0 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -210,25 +210,32 @@ inline void closeLabelTag(XMLStream & xs, Layout const & lay) } -inline void openItemTag(XMLStream & xs, Layout const & lay) +inline void openItemTag(XMLStream & xs, Layout const & lay, +std::string const & parlabel) { if (lay.htmlitemtag() != "NONE") { - xs << xml::StartTag(lay.htmlitemtag(), lay.htmlitemattr(), true); + string attrs = lay.htmlitemattr(); + if (!parlabel.empty()) + attrs += " id='" + parlabel + "'"; + xs << xml::StartTag(lay.htmlitemtag(), attrs, true); } } void openItemTag(XMLStream & xs, Layout const & lay, - ParagraphParameters const & params) + ParagraphParameters const & params, + std::string const & parlabel) { if (lay.htmlitemtag() != "NONE") { // FIXME Are there other things we should handle here? string const align = alignmentToCSS(params.align()); if (align.empty()) { - openItemTag(xs, lay); + openItemTag(xs, lay, parlabel); return; } string attrs = lay.htmlGetAttrString() + " style='text-align: " + align + ";'"; + if (!parlabel.empty()) + attrs += " id='" + parlabel + "'"; xs << xml::StartTag(lay.htmlitemtag(), attrs); } } @@ -411,7 +418,8 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, ParagraphList::const_iterator const begin = text.paragraphs().begin(); ParagraphList::const_iterator par = pbegin; Layout const & bstyle = par->layout(); - depth_type const origdepth = pbegin->params().depth(); + depth_type const origdepth = par->params().depth(); + string const parId = bstyle.htmlitemtag().empty() ? par->magicLabel() : ""; // open tag for this environment if ((bstyle.labeltype == LABEL_ENUMERATE || bstyle.labeltype == LABEL_ITEMIZE) @@ -444,12 +452,12 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, // not a valid enumdepth... break; } - openParTag(xs, bstyle, - string( isenum ? "lyxenum" : "lyxitem" ) + " " - + to_utf8(enumcounter), pbegin->magicLabel()); + const string cssClass = string(isenum ? "lyxenum" : "lyxitem") + " " + + to_utf8(enumcounter); + openParTag(xs, bstyle, cssClass, parId); } else - openParTag(xs, bstyle, pbegin->magicLabel()); + openParTag(xs, bstyle, parId); xs << xml::CR(); // we will on occasion need to remember a layout from before. @@ -491,7 +499,7 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, pos_type sep = 0; bool const labelfirst = style.htmllabelfirst(); if (!labelfirst) - openItemTag(xs, style, par->params()); + openItemTag(xs, style, par->params(), par->magicLabel()); // label output if (style.labeltype != LABEL_NO_LABEL && @@ -529,7 +537,7 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, } // end label output if (labelfirst) - openItemTag(xs, style, par->params()); + openItemTag(xs, style, par->params(), par->magicLabel()); docstring deferred = par->simpleLyXHTMLOnePar(buf, xs, runparams, text.outerFont(distance(begin, par
[LyX/master] XHTML: fix typo in comment.
commit a4f675a0408f4af13a7ea3a7856763dac8175e9a Author: Thibaut Cuvelier Date: Mon May 20 03:11:41 2024 +0200 XHTML: fix typo in comment. --- src/output_xhtml.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index f01b0b8e62..c83fdeed82 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -422,7 +422,7 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, // (We also do not deal with 'resume' counters, though I'm not sure that can // be done at all in HTML.) - // Code adapated from Buffer::Impl::setLabel + // Code adapted from Buffer::Impl::setLabel bool const isenum = bstyle.labeltype == LABEL_ENUMERATE; docstring enumcounter = bstyle.counter.empty() ? ( isenum ? from_ascii("enum") : from_ascii("lyxitem") ) : -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] InsetGraphics: use the `scale` CSS property instead of `width` with percentages.
commit f2660d172c3f38e2dad1f32d7b3b4d953e2efb8a Author: Thibaut Cuvelier Date: Mon May 20 01:09:43 2024 +0200 InsetGraphics: use the `scale` CSS property instead of `width` with percentages. The effect is closer to what LyX offers. Previously, the percentage was of the HTML container (often, the whole page), meaning that images were oversized. Now, the scale is respected in the same way as LyX, but its bounding box is off. Overall, the result is better, but not what users expect. --- src/insets/InsetGraphics.cpp | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index b092ff44ff..d4d0fd7049 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -1086,15 +1086,17 @@ docstring InsetGraphics::xhtml(XMLStream & xs, OutputParams const & op) const bool const haveheight = !params().height.zero(); if (havewidth || haveheight) { if (havewidth) - imgstyle += "width:" + params().width.asHTMLString() + ";"; + imgstyle += "width: " + params().width.asHTMLString() + ";"; if (haveheight) - imgstyle += " height:" + params().height.asHTMLString() + ";"; + imgstyle += " height: " + params().height.asHTMLString() + ";"; } else if (params().scale != "100") { - // Note that this will not have the same effect as in LaTeX export: - // There, the image will be scaled from its original size. Here, the - // percentage will be interpreted by the browser, and the image will - // be scaled to a percentage of the window size. - imgstyle = "width:" + params().scale + "%;"; + // The `scale` CSS property is supposed to be used for responsive + // designs, but it behaves mostly as LyX. The only problem is that + // the image's bounding box is not scaled. (As opposed to a width, + // which is a percentage of the HTML container: the meaning of the + // percentage is completely different, but the bounding box has the + // right size.) + imgstyle = "scale: " + params().scale + "%;"; } if (!imgstyle.empty()) imgstyle = "style='" + imgstyle + "' "; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Make comment clearer.
commit e3f2b10842cdc808e9f2bf235692f283009d3734 Author: Thibaut Cuvelier Date: Sat May 18 19:38:52 2024 +0200 Make comment clearer. --- src/insets/InsetInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index cfb5b7eafc..4ed6142430 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -1563,7 +1563,7 @@ void xhtmlShortcutInfo(XMLStream & xs, const InsetInfoParams & params) { sequence = theTopLevelKeymap().printBindings(func, KeySequence::ForGui); seq_untranslated = theTopLevelKeymap().printBindings(func, KeySequence::ForGui, true); } - // No other possible case. + // No other possible case (`return` at the beginning of the function otherwise). Language const * tryguilang = languages.getFromCode(Messages::guiLanguage()); // Some info insets use the language of the GUI (if available) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] InsetInfo: no need to output + explicitly in a shortcut, it is already contained in the sequence.
commit 7cfe36e6aa4460ae8641cd36f4aab5f013390326 Author: Thibaut Cuvelier Date: Sat May 18 19:41:44 2024 +0200 InsetInfo: no need to output + explicitly in a shortcut, it is already contained in the sequence. --- src/insets/InsetInfo.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index 4ed6142430..7ed5662b10 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -1589,9 +1589,6 @@ void xhtmlShortcutInfo(XMLStream & xs, const InsetInfoParams & params) { } else { xs << c; } - - if (i > 0 && i + 1 < sequence.length()) - xs << from_ascii("+"); } xml::closeTag(xs, "bdo", "inline"); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
Re: Install LuCI for snapshots builds
Hi, > Le 8 mai 2024 à 09:30, Jo-Philipp Wich a écrit : > > Hi, > >> [...] >> Let me explain why: >> Currently the snapshot builders are only building **target-specific** >> packages as well as packages included in the image by default. (We call >> that "phase1"). That means that a single build takes around 2~3 hours, >> depending on the target and the machine carrying out the build. In this >> way we manage to have every target build once approximately every 24 >> hours. >> If we wanted to include LuCI, that would basically mean that we will not >> only have to include all the LuCI modules and applications, but also >> **all their dependencies** which is basically half of the packages feed. Nope, that’s not how it works. > This does not sound correct. They would only build those LuCI sub-packages > being included in the image (luci-base, luci-theme-bootstrap, > luci-mod-network, luci-mod-system, luci-mod-status, ...) and they mostly > depend on stuff being present in the default image anyway. Correct indeed, that’s how it’s done on release builds. Snapshots would be slower to build, but inasmuch as release builds are (it may add up overall). There may also be some dependency problems for users who try to install additional packages from the repo (e.g. if a version as new as the one on the image hasn’t yet been built by phase2), but that’s *expected* with snapshot. I personally have no opinion on embedding Luci in snapshots so this is just to provide extra datapoints :) Cheers, T ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[Bug 2061322] [NEW] package nvidia-driver-535-server 535.161.07-0ubuntu0.22.04.1 failed to install/upgrade: problèmes de dépendances - laissé non configuré
Public bug reported: i don't know ProblemType: Package DistroRelease: Ubuntu 22.04 Package: nvidia-driver-535-server 535.161.07-0ubuntu0.22.04.1 ProcVersionSignature: Ubuntu 6.5.0-27.28~22.04.1-generic 6.5.13 Uname: Linux 6.5.0-27-generic x86_64 NonfreeKernelModules: nvidia_modeset nvidia ApportVersion: 2.20.11-0ubuntu82.5 Architecture: amd64 CasperMD5CheckResult: pass Date: Thu Apr 11 18:55:04 2024 ErrorMessage: problèmes de dépendances - laissé non configuré InstallationDate: Installed on 2022-11-01 (529 days ago) InstallationMedia: Ubuntu 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809.1) Python3Details: /usr/bin/python3.10, Python 3.10.12, python3-minimal, 3.10.6-1~22.04 PythonDetails: N/A RelatedPackageVersions: dpkg 1.21.1ubuntu2.3 apt 2.4.12 SourcePackage: nvidia-graphics-drivers-535-server Title: package nvidia-driver-535-server 535.161.07-0ubuntu0.22.04.1 failed to install/upgrade: problèmes de dépendances - laissé non configuré UpgradeStatus: No upgrade log present (probably fresh install) ** Affects: nvidia-graphics-drivers-535-server (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-package jammy -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2061322 Title: package nvidia-driver-535-server 535.161.07-0ubuntu0.22.04.1 failed to install/upgrade: problèmes de dépendances - laissé non configuré To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-535-server/+bug/2061322/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Kernel-packages] [Bug 2061322] [NEW] package nvidia-driver-535-server 535.161.07-0ubuntu0.22.04.1 failed to install/upgrade: problèmes de dépendances - laissé non configuré
Public bug reported: i don't know ProblemType: Package DistroRelease: Ubuntu 22.04 Package: nvidia-driver-535-server 535.161.07-0ubuntu0.22.04.1 ProcVersionSignature: Ubuntu 6.5.0-27.28~22.04.1-generic 6.5.13 Uname: Linux 6.5.0-27-generic x86_64 NonfreeKernelModules: nvidia_modeset nvidia ApportVersion: 2.20.11-0ubuntu82.5 Architecture: amd64 CasperMD5CheckResult: pass Date: Thu Apr 11 18:55:04 2024 ErrorMessage: problèmes de dépendances - laissé non configuré InstallationDate: Installed on 2022-11-01 (529 days ago) InstallationMedia: Ubuntu 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809.1) Python3Details: /usr/bin/python3.10, Python 3.10.12, python3-minimal, 3.10.6-1~22.04 PythonDetails: N/A RelatedPackageVersions: dpkg 1.21.1ubuntu2.3 apt 2.4.12 SourcePackage: nvidia-graphics-drivers-535-server Title: package nvidia-driver-535-server 535.161.07-0ubuntu0.22.04.1 failed to install/upgrade: problèmes de dépendances - laissé non configuré UpgradeStatus: No upgrade log present (probably fresh install) ** Affects: nvidia-graphics-drivers-535-server (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-package jammy -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to nvidia-graphics-drivers-535-server in Ubuntu. https://bugs.launchpad.net/bugs/2061322 Title: package nvidia-driver-535-server 535.161.07-0ubuntu0.22.04.1 failed to install/upgrade: problèmes de dépendances - laissé non configuré Status in nvidia-graphics-drivers-535-server package in Ubuntu: New Bug description: i don't know ProblemType: Package DistroRelease: Ubuntu 22.04 Package: nvidia-driver-535-server 535.161.07-0ubuntu0.22.04.1 ProcVersionSignature: Ubuntu 6.5.0-27.28~22.04.1-generic 6.5.13 Uname: Linux 6.5.0-27-generic x86_64 NonfreeKernelModules: nvidia_modeset nvidia ApportVersion: 2.20.11-0ubuntu82.5 Architecture: amd64 CasperMD5CheckResult: pass Date: Thu Apr 11 18:55:04 2024 ErrorMessage: problèmes de dépendances - laissé non configuré InstallationDate: Installed on 2022-11-01 (529 days ago) InstallationMedia: Ubuntu 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809.1) Python3Details: /usr/bin/python3.10, Python 3.10.12, python3-minimal, 3.10.6-1~22.04 PythonDetails: N/A RelatedPackageVersions: dpkg 1.21.1ubuntu2.3 apt 2.4.12 SourcePackage: nvidia-graphics-drivers-535-server Title: package nvidia-driver-535-server 535.161.07-0ubuntu0.22.04.1 failed to install/upgrade: problèmes de dépendances - laissé non configuré UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-535-server/+bug/2061322/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp
[LyX features/biginset] Amend 16660d12.
commit fd378450755b698cc3ddb1a8d14e8b78d19c57a2 Author: Thibaut Cuvelier Date: Thu Mar 21 21:32:45 2024 +0100 Amend 16660d12. The previous commit introduced wrong behaviours for <>. The new code carefully escapes what needs to be escaped from LaTeX, using the now-standard XML tools (XMLStream). --- autotests/export/xhtml/math_output_latex.lyx | 2 +- autotests/export/xhtml/math_output_latex.xhtml | 2 +- src/insets/InsetLabel.cpp | 2 + src/mathed/InsetMathHull.cpp | 62 -- src/mathed/InsetMathHull.h | 4 +- 5 files changed, 45 insertions(+), 27 deletions(-) diff --git a/autotests/export/xhtml/math_output_latex.lyx b/autotests/export/xhtml/math_output_latex.lyx index 59d77d2f9b..7c49de59f6 100644 --- a/autotests/export/xhtml/math_output_latex.lyx +++ b/autotests/export/xhtml/math_output_latex.lyx @@ -100,7 +100,7 @@ The problem occurs when adding a label. \begin_layout Standard \begin_inset Formula \begin{equation} -x^{2}\label{eq:1} +x^{2}<\log x\label{eq:1} \end{equation} \end_inset diff --git a/autotests/export/xhtml/math_output_latex.xhtml b/autotests/export/xhtml/math_output_latex.xhtml index cec2d5ba0d..713def3459 100644 --- a/autotests/export/xhtml/math_output_latex.xhtml +++ b/autotests/export/xhtml/math_output_latex.xhtml @@ -22,7 +22,7 @@ div.standard { Math formula output as raw LaTeX The problem occurs when adding a label. https://www.lyx.org/trac/ticket/13048 -x^{2}(1) +x^{2}<\log x(1) diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp index 1ca8ea08ae..ab5a5e1716 100644 --- a/src/insets/InsetLabel.cpp +++ b/src/insets/InsetLabel.cpp @@ -380,6 +380,8 @@ void InsetLabel::docbook(XMLStream & xs, OutputParams const & runparams) const docstring InsetLabel::xhtml(XMLStream & xs, OutputParams const &) const { + // Print the label as an HTML anchor, so that an external link can point to this equation. + // (URL: FILE.html#EQ-ID.) // FIXME XHTML // Unfortunately, the name attribute has been deprecated, so we have to use // id here to get the document to validate as XHTML 1.1. This will cause a diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index bb368b3b93..94d293870d 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -2574,35 +2574,56 @@ void InsetMathHull::mathmlize(MathMLStream & ms) const } -void InsetMathHull::mathAsLatex(TeXMathStream & os) const +docstring InsetMathHull::mathAsLatex() const { - MathEnsurer ensurer(os, false); bool const havenumbers = haveNumbers(); bool const havetable = havenumbers || nrows() > 1 || ncols() > 1; if (!havetable) { + odocstringstream ls; + otexrowstream ots(ls); + TeXMathStream os(ots, false, true, TeXMathStream::wsPreview); + ModeSpecifier specifier(os, MATH_MODE); + MathEnsurer ensurer(os, false); + os << cell(index(0, 0)); - return; + return ls.str(); } - os << ""; + odocstringstream ods; + XMLStream xs(ods); + + xs << xml::StartTag("table", "class='mathtable'"); for (row_type row = 0; row < nrows(); ++row) { - os << ""; + xs << xml::StartTag("tr"); for (col_type col = 0; col < ncols(); ++col) { - os << ""; - os << cell(index(row, col)); - os << ""; + xs << xml::StartTag("td", "class='math'"); + + odocstringstream ls; + otexrowstream ots(ls); + TeXMathStream os(ots, false, true, TeXMathStream::wsPreview); + ModeSpecifier specifier(os, MATH_MODE); + MathEnsurer ensurer(os, false); + + os << cell(index(0, 0)); + // ls.str() contains a raw LaTeX string, which might require some encoding before being valid XML. + xs << ls.str(); + + xs << xml::EndTag("td"); } if (havenumbers) { - os << ""; + xs << xml::StartTag("td"); docstring const & num = numbers_[row]; - if (!num.empty()) - os << '(' << num << ')'; - os << ""; + if (!num.empty()) { + xs << '(' << num << ')'; +
[LyX features/biginset] MathML in HTML: don't escape <> for a raw LaTeX output.
commit 16660d12b4333f6486259048dec2b0a2e48a64d9 Author: Thibaut Cuvelier Date: Thu Mar 21 00:29:23 2024 +0100 MathML in HTML: don't escape <> for a raw LaTeX output. In some cases (I only found numbered equations), the LaTeX output still has a bit of HTML. For numbered equations, using \tag{X} (as suggested in https://www.lyx.org/trac/ticket/13048) would require fiddling with the output. KaTeX doesn't support \label. This patch is probably the easiest and most reliable fix. Fixes https://www.lyx.org/trac/ticket/13048. --- autotests/export/xhtml/math_output_latex.lyx | 112 + autotests/export/xhtml/math_output_latex.xhtml | 28 +++ src/mathed/InsetMathHull.cpp | 3 +- 3 files changed, 142 insertions(+), 1 deletion(-) diff --git a/autotests/export/xhtml/math_output_latex.lyx b/autotests/export/xhtml/math_output_latex.lyx new file mode 100644 index 00..59d77d2f9b --- /dev/null +++ b/autotests/export/xhtml/math_output_latex.lyx @@ -0,0 +1,112 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass article +\use_default_options true +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 3 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Title +Math formula output as raw LaTeX +\end_layout + +\begin_layout Standard +The problem occurs when adding a label. + https://www.lyx.org/trac/ticket/13048 +\end_layout + +\begin_layout Standard +\begin_inset Formula +\begin{equation} +x^{2}\label{eq:1} +\end{equation} + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/autotests/export/xhtml/math_output_latex.xhtml b/autotests/export/xhtml/math_output_latex.xhtml new file mode 100644 index 00..cec2d5ba0d --- /dev/null +++ b/autotests/export/xhtml/math_output_latex.xhtml @@ -0,0 +1,28 @@ + +http://www.w3.org/1999/xhtml; lang="en-US"> + + +Math formula output as raw LaTeX + +/* Layout-provided Styles */ +h1.title { +font-size: x-large; +margin-bottom: 1ex; +text-align: center; + +} +div.standard { + margin-bottom: 2ex; +} + + + + + +Math formula output as raw LaTeX +The problem occurs when adding a label. https://www.lyx.org/trac/ticket/13048 + +x^{2}(1) + + + diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 2ba98b3d4d..bb368b3b93 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -2729,7 +2729,8 @@ docstring InsetMathHull::xhtml(XMLStream & xs, OutputParams const & op) const // probably should allow for some kind of customization here string const tag = (getType() == hullSimple) ? "span" : "div"; xs << xml::StartTag(tag, "class='math'") - << latex + << XMLStream::ESCAPE_AND << latex // Don't escape <> tags: latex might contain them + // (typically, when there is a label). << xml::EndTag(tag) << xml::CR(); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] MathML: stop stretching all delimiters.
commit 8f820d7ccb0cb6129c8e3c1d495905d61db97355 Author: Thibaut Cuvelier Date: Mon Mar 11 01:40:16 2024 +0100 MathML: stop stretching all delimiters. No form? Reference: https://w3c.github.io/mathml-core/#dfn-form. The MathML processor is smart enough to determine whether the delimiter is prefix or postfix. No stretchy/symmetric/fence in all cases? Reference: https://w3c.github.io/mathml-core/#algorithm-for-determining-the-properties-of-an-embellished-operator and https://w3c.github.io/mathml-core/#operator-dictionary-human (example entry: U+0028). Delimiters have the right properties by default. --- src/mathed/InsetMathDelim.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index d32029b818..fab72db88d 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -190,15 +190,16 @@ void InsetMathDelim::mathematica(MathematicaStream & os) const void InsetMathDelim::mathmlize(MathMLStream & ms) const { // Ignore the delimiter if: it is empty or only a space (one character). + const std::string attr = is_extracted_ ? "stretchy='false'" : ""; if (!left_.empty() && ((left_.size() == 1 && left_[0] != ' ') || left_.size() > 1)) { ms << MTag("mrow") - << MTagInline("mo", "form='prefix' fence='true' stretchy='true' symmetric='true'") + << MTagInline("mo", attr) << convertDelimToXMLEscape(left_) << ETagInline("mo"); } ms << cell(0); if (!right_.empty() && ((right_.size() == 1 && right_[0] != ' ') || right_.size() > 1)) { - ms << MTagInline("mo", "form='postfix' fence='true' stretchy='true' symmetric='true'") + ms << MTagInline("mo", attr) << convertDelimToXMLEscape(right_) << ETagInline("mo") << ETag("mrow"); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] MathML: don't let the processor stretch operators when they are single characters for LyX.
commit 7e6597a5b47c22ed22966a75c149264dacd6e289 Author: Thibaut Cuvelier Date: Mon Mar 11 02:00:47 2024 +0100 MathML: don't let the processor stretch operators when they are single characters for LyX. The main goal is to match TeX' behaviour. If you want stretchy operators, use InsetMathDelim / \left & \right. This patch will change the output in many files, but making the rendering much closer to that of TeX (which users should expect, due to LyX' roots in TeX). --- src/mathed/InsetMathChar.cpp | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp index 71aba6f6f7..a642a5e6da 100644 --- a/src/mathed/InsetMathChar.cpp +++ b/src/mathed/InsetMathChar.cpp @@ -230,6 +230,8 @@ void InsetMathChar::octave(OctaveStream & os) const // mathalpha, then we'll treat it as an identifier, otherwise as an // operator. // Worst case: We get bad spacing, or bad italics. +// In any case, never let MathML stretch a single character when it +// is recognised as an operator, to match TeX' behaviour. void InsetMathChar::mathmlize(MathMLStream & ms) const { std::string entity; @@ -253,7 +255,7 @@ void InsetMathChar::mathmlize(MathMLStream & ms) const } if (!entity.empty()) { - ms << MTagInline("mo") + ms << MTagInline("mo", "stretchy='false'") << from_ascii(entity) << ETagInline("mo"); return; @@ -262,7 +264,7 @@ void InsetMathChar::mathmlize(MathMLStream & ms) const char const * type = (isAlphaASCII(char_) || Encodings::isMathAlpha(char_)) ? "mi" : "mo"; - ms << MTagInline(type) + ms << MTagInline(type, std::string(type) == "mo" ? "stretchy='false'" : "") << char_type(char_) << ETagInline(type); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] MathML: don't output delimiters in InsetMathBinom and InsetMathDelim if the delimiter is a space.
commit be03d699463fba896f90e3046b0814d527368771 Author: Thibaut Cuvelier Date: Mon Mar 11 01:30:48 2024 +0100 MathML: don't output delimiters in InsetMathBinom and InsetMathDelim if the delimiter is a space. --- src/mathed/InsetMathDelim.cpp | 23 ++- src/mathed/InsetMathFrac.cpp | 21 + 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index 78d26fceea..d32029b818 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -189,15 +189,20 @@ void InsetMathDelim::mathematica(MathematicaStream & os) const void InsetMathDelim::mathmlize(MathMLStream & ms) const { - ms << MTag("mrow") - << MTagInline("mo", "form='prefix' fence='true' stretchy='true' symmetric='true'") - << convertDelimToXMLEscape(left_) - << ETagInline("mo") - << cell(0) - << MTagInline("mo", "form='postfix' fence='true' stretchy='true' symmetric='true'") - << convertDelimToXMLEscape(right_) - << ETagInline("mo") - << ETag("mrow"); + // Ignore the delimiter if: it is empty or only a space (one character). + if (!left_.empty() && ((left_.size() == 1 && left_[0] != ' ') || left_.size() > 1)) { + ms << MTag("mrow") + << MTagInline("mo", "form='prefix' fence='true' stretchy='true' symmetric='true'") + << convertDelimToXMLEscape(left_) + << ETagInline("mo"); + } + ms << cell(0); + if (!right_.empty() && ((right_.size() == 1 && right_[0] != ' ') || right_.size() > 1)) { + ms << MTagInline("mo", "form='postfix' fence='true' stretchy='true' symmetric='true'") + << convertDelimToXMLEscape(right_) + << ETagInline("mo") + << ETag("mrow"); + } } diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index f6f2f95b0a..b0ff55bc4d 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -768,15 +768,20 @@ void InsetMathBinom::mathmlize(MathMLStream & ms) const rdelim = ']'; break; } - ms << MTagInline("mo", "fence='true' stretchy='true' form='prefix'") - << ldelim - << ETagInline("mo") - << MTagInline("mfrac", "linethickness='0'") + + if (ldelim != ' ') { + ms << MTagInline("mo", "fence='true' stretchy='true' form='prefix'") + << ldelim + << ETagInline("mo"); + } + ms << MTagInline("mfrac", "linethickness='0'") << cell(0) << cell(1) - << ETagInline("mfrac") - << MTagInline("mo", "fence='true' stretchy='true' form='postfix'") - << rdelim - << ETagInline("mo"); + << ETagInline("mfrac"); + if (rdelim != ' ') { + ms << MTagInline("mo", "fence='true' stretchy='true' form='postfix'") + << rdelim + << ETagInline("mo"); + } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Extract vert, langle, rangle in MathExtern like parentheses and brackets.
commit 9e6b810b37f28499a5573468ae61d68be0bb2e75 Author: Thibaut Cuvelier Date: Mon Mar 11 01:22:12 2024 +0100 Extract vert, langle, rangle in MathExtern like parentheses and brackets. This patch is part of a series that aims at solving https://www.lyx.org/trac/ticket/12891. It is an excerpt of the patch that lynx published at https://www.lyx.org/trac/ticket/12270. --- src/mathed/MathExtern.cpp | 67 ++- 1 file changed, 54 insertions(+), 13 deletions(-) diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index b07c08b56e..e273aac791 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -292,6 +292,19 @@ bool testString(MathAtom const & at, char const * const str) return testString(at, from_ascii(str)); } + +bool testSymbol(MathAtom const & at, docstring const & name) +{ + return at->asSymbolInset() && at->asSymbolInset()->name() == name; +} + + +bool testSymbol(MathAtom const & at, char const * const name) +{ + return testSymbol(at, from_ascii(name)); +} + + // search end of nested sequence MathData::iterator endNestSearch( MathData::iterator it, @@ -523,12 +536,52 @@ MathAtom replaceBracketDelims(const MathData & ar) } -// replace '('...')' and '['...']' sequences by a real InsetMathDelim +bool testOpenVert(MathAtom const & at) +{ + return testSymbol(at, "lvert"); +} + + +bool testCloseVert(MathAtom const & at) +{ + return testSymbol(at, "rvert"); +} + + +MathAtom replaceVertDelims(const MathData & ar) +{ + return MathAtom(new InsetMathDelim(const_cast(ar.buffer()), + from_ascii("lvert"), from_ascii("rvert"), ar, true)); +} + + +bool testOpenAngled(MathAtom const & at) +{ + return testSymbol(at, "langle"); +} + + +bool testCloseAngled(MathAtom const & at) +{ + return testSymbol(at, "rangle"); +} + + +MathAtom replaceAngledDelims(const MathData & ar) +{ + return MathAtom(new InsetMathDelim(const_cast(ar.buffer()), + from_ascii("langle"), from_ascii("rangle"), ar, true)); +} + + +// replace '('...')', '['...']', '|'...'|', and '<'...'>' sequences by a real InsetMathDelim void extractDelims(MathData & ar) { //lyxerr << "\nDelims from: " << ar << endl; replaceNested(ar, testOpenParen, testCloseParen, replaceParenDelims); replaceNested(ar, testOpenBracket, testCloseBracket, replaceBracketDelims); + replaceNested(ar, testOpenVert, testCloseVert, replaceVertDelims); + replaceNested(ar, testOpenAngled, testCloseAngled, replaceAngledDelims); //lyxerr << "\nDelims to: " << ar << endl; } @@ -622,18 +675,6 @@ void extractFunctions(MathData & ar, ExternalMath kind) // search integrals // -bool testSymbol(MathAtom const & at, docstring const & name) -{ - return at->asSymbolInset() && at->asSymbolInset()->name() == name; -} - - -bool testSymbol(MathAtom const & at, char const * const name) -{ - return testSymbol(at, from_ascii(name)); -} - - bool testIntSymbol(MathAtom const & at) { return testSymbol(at, from_ascii("int")); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Improve const correctness.
commit b1a4eb118cd3d271a35b2260cde077e21c62c32c Author: Thibaut Cuvelier Date: Mon Mar 11 01:15:48 2024 +0100 Improve const correctness. --- src/mathed/MathExtern.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index d101904e83..b07c08b56e 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -295,7 +295,7 @@ bool testString(MathAtom const & at, char const * const str) // search end of nested sequence MathData::iterator endNestSearch( MathData::iterator it, - MathData::iterator last, + const MathData::iterator& last, TestItemFunc testOpen, TestItemFunc testClose ) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Memorise whether delims are extracted from MathExtern.
commit 93444892c504fdd7b8fdfbc7f2bf67f9b250eb82 Author: Thibaut Cuvelier Date: Mon Mar 11 01:07:25 2024 +0100 Memorise whether delims are extracted from MathExtern. This patch is part of a series that aims at solving https://www.lyx.org/trac/ticket/12891. It should not change any output. --- src/mathed/InsetMathDelim.cpp | 12 ++-- src/mathed/InsetMathDelim.h | 6 ++ src/mathed/MathExtern.cpp | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index 486ed97580..78d26fceea 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -45,13 +45,21 @@ static docstring convertDelimToLatexName(docstring const & name) InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l, docstring const & r) - : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0) + : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0), is_extracted_(false) {} InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l, docstring const & r, MathData const & ar) - : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0) + : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0), is_extracted_(false) +{ + cell(0) = ar; +} + + +InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l, docstring const & r, + MathData const & ar, bool const is_extracted) + : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0), is_extracted_(is_extracted) { cell(0) = ar; } diff --git a/src/mathed/InsetMathDelim.h b/src/mathed/InsetMathDelim.h index cad8da49de..3d8bd2ce36 100644 --- a/src/mathed/InsetMathDelim.h +++ b/src/mathed/InsetMathDelim.h @@ -27,6 +27,9 @@ public: InsetMathDelim(Buffer * buf, docstring const & left, docstring const & right, MathData const &); /// + InsetMathDelim(Buffer * buf, docstring const & left, docstring const & right, + MathData const &, bool const is_extracted); + /// InsetMathDelim * asDelimInset() override { return this; } /// InsetMathDelim const * asDelimInset() const override { return this; } @@ -73,6 +76,9 @@ private: Inset * clone() const override; /// mutable int dw_; + /// Is it extracted by MathExtern routines? They try to extract as much + /// semantics from a raw LaTeX formula in terms of LyX insets. + bool const is_extracted_; }; } // namespace lyx diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index 22124cc13d..d101904e83 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -500,7 +500,7 @@ bool testCloseParen(MathAtom const & at) MathAtom replaceParenDelims(const MathData & ar) { return MathAtom(new InsetMathDelim(const_cast(ar.buffer()), - from_ascii("("), from_ascii(")"), ar)); + from_ascii("("), from_ascii(")"), ar, true)); } @@ -519,7 +519,7 @@ bool testCloseBracket(MathAtom const & at) MathAtom replaceBracketDelims(const MathData & ar) { return MathAtom(new InsetMathDelim(const_cast(ar.buffer()), - from_ascii("["), from_ascii("]"), ar)); + from_ascii("["), from_ascii("]"), ar, true)); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Reduce code duplication.
commit 1680eaf5f0edeed089e2bdc2b539b80187b88d3c Author: Thibaut Cuvelier Date: Sun Mar 10 16:55:12 2024 +0100 Reduce code duplication. --- src/mathed/MathExtern.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index daf171981f..22124cc13d 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -630,7 +630,7 @@ bool testSymbol(MathAtom const & at, docstring const & name) bool testSymbol(MathAtom const & at, char const * const name) { - return at->asSymbolInset() && at->asSymbolInset()->name() == from_ascii(name); + return testSymbol(at, from_ascii(name)); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] MathML: consider ordinary and alphabetical characters as identifiers instead of operators.
commit 011c3d73c0c3137dcd67bf8bb09644ac064b2342 Author: Thibaut Cuvelier Date: Sat Mar 9 20:59:12 2024 +0100 MathML: consider ordinary and alphabetical characters as identifiers instead of operators. The goal is to consider all Greek letters as identifiers instead of operators. Solves: https://www.lyx.org/trac/ticket/12948. --- .../export/docbook/mathml_greek_operators.lyx | 112 + .../export/docbook/mathml_greek_operators.xml | 20 src/mathed/MathParser.cpp | 4 +- 3 files changed, 135 insertions(+), 1 deletion(-) diff --git a/autotests/export/docbook/mathml_greek_operators.lyx b/autotests/export/docbook/mathml_greek_operators.lyx new file mode 100644 index 00..f7d2ce --- /dev/null +++ b/autotests/export/docbook/mathml_greek_operators.lyx @@ -0,0 +1,112 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass article +\use_default_options true +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Title +MathML: + all Greek letters are symbols, + none of them is an operator +\end_layout + +\begin_layout Standard +Issue: + https://www.lyx.org/trac/ticket/12948 +\end_layout + +\begin_layout Standard +\begin_inset Formula +\[ +1\alpha2\Xi3 +\] + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/autotests/export/docbook/mathml_greek_operators.xml b/autotests/export/docbook/mathml_greek_operators.xml new file mode 100644 index 00..c5fc17c0b8 --- /dev/null +++ b/autotests/export/docbook/mathml_greek_operators.xml @@ -0,0 +1,20 @@ + + +http://docbook.org/ns/docbook; xmlns:xlink="http://www.w3.org/1999/xlink; xmlns:m="http://www.w3.org/1998/Math/MathML; xmlns:xi="http://www.w3.org/2001/XInclude; version="5.2"> +MathML: all Greek letters are symbols, none of them is an operator +Issue: https://www.lyx.org/trac/ticket/12948 + +1\alpha2\Xi3 + + + + 1 + + 2 + + 3 + + + + \ No newline at end of file diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index e94b6cea32..9b43da8cdd 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -2141,8 +2141,10 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags, // FIXME This will likely need some work. char const * latexkeys::MathMLtype() const { - if (extra == "mathord") + // Consider as identifier (mml:mi): ordinary and alphabetical characters. + if (extra == "mathord" || extra == "mathalpha") return "mi"; + // Consider as operators (mml:mo): everything else. return "mo"; } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Simplify a loop with a for-each.
commit 1b11dfeca5c4e11585129221d966e84c5c775402 Author: Thibaut Cuvelier Date: Sat Mar 9 20:46:54 2024 +0100 Simplify a loop with a for-each. These loops were brought by C++11. The next step could be using std::any_of. --- src/mathed/MathSupport.cpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index 57e8c6ee4e..585320f11a 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -1070,10 +1070,10 @@ bool isAlphaSymbol(MathAtom const & at) if (at->asFontInset()) { MathData const & ar = at->asFontInset()->cell(0); - for (size_t i = 0; i < ar.size(); ++i) { - if (!(ar[i]->asCharInset() || - (ar[i]->asSymbolInset() && - ar[i]->asSymbolInset()->isOrdAlpha( + for (const auto & i : ar) { + if (!(i->asCharInset() || + (i->asSymbolInset() && + i->asSymbolInset()->isOrdAlpha( return false; } return true; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] DocBook: add missing mapping for AASTeX 6.3.
commit 04beccca4c7170273748e14827b8af62e5726b25 Author: Thibaut Cuvelier Date: Sat Mar 9 15:09:45 2024 +0100 DocBook: add missing mapping for AASTeX 6.3. The result is far from perfect, see the TODOs. The corresponding tests are still inverted. --- development/autotests/invertedTests | 2 ++ lib/layouts/aastex6.layout | 9 - lib/layouts/aastex62.layout | 12 +++- lib/layouts/aastex63.layout | 16 +--- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/development/autotests/invertedTests b/development/autotests/invertedTests index c88e67cda5..ec366b9745 100644 --- a/development/autotests/invertedTests +++ b/development/autotests/invertedTests @@ -412,6 +412,8 @@ export/doc(|/de|/es|/fr|/ja|/ru)/Additional_docbook5 # - AASTeX. export/export/docbook/bibliography_precooked_aastex_docbook5 export/(examples|templates)/Articles/American_Astronomical_Society_%28AASTeX_v._6.2%29_docbook5 +export/(examples|templates)/Articles/American_Astronomical_Society_%28AASTeX_v._6.3%29_docbook5 +export/(examples|templates)/Articles/American_Astronomical_Society_%28AASTeX_v._6.3.1%29_docbook5 # - Springer. (The svmono_light should still pass.) export/templates/Books/Springer.*/.*_docbook5 !export/export/docbook/svmono_light_docbook5 diff --git a/lib/layouts/aastex6.layout b/lib/layouts/aastex6.layout index c6ab5ea03f..3ae8486cce 100644 --- a/lib/layouts/aastex6.layout +++ b/lib/layouts/aastex6.layout @@ -44,7 +44,14 @@ # # TODO: - support for new commands (see below) # - aastex6.cls loads hyperref (with pre-set options) and url -# -> option clash if "Use Hyerref" is selected in Document>Settings +# -> option clash if "Use Hyperref" is selected in Document>Settings +# - in DocBook, the appendix is not output (not a standard LyX appendix +# separator (needs a layout update) +# - in DocBook, the "Software" part should really be a section on its own, +# but that would require a way to provide the section title within the +# layout (needs a layout update) +# - in DocBook, the table notes are not supported at all (move the remarks +# into the table cells instead of outputting tablenotemark in the cells?) Format 104 diff --git a/lib/layouts/aastex62.layout b/lib/layouts/aastex62.layout index 5080cc06e8..5bfc03111e 100644 --- a/lib/layouts/aastex62.layout +++ b/lib/layouts/aastex62.layout @@ -48,7 +48,14 @@ # # TODO: - support for new commands (see below) # - aastex6.cls loads hyperref (with pre-set options) and url -# -> option clash if "Use Hyerref" is selected in Document>Settings +# -> option clash if "Use Hy^perref" is selected in Document>Settings +# - in DocBook, the appendix is not output (not a standard LyX appendix +# separator (needs a layout update) +# - in DocBook, the "Software" part should really be a section on its own, +# but that would require a way to provide the section title within the +# layout (needs a layout update) +# - in DocBook, the table notes are not supported at all (move the remarks +# into the table cells instead of outputting tablenotemark in the cells?) Format 104 @@ -231,6 +238,9 @@ Style Acknowledgments LabelFont Color textlabel2 EndFont + DocBookTag para + DocBookWrapperTag acknowledgements + DocBookSection true End Counter appendix diff --git a/lib/layouts/aastex63.layout b/lib/layouts/aastex63.layout index e2438986d7..e94d490e91 100644 --- a/lib/layouts/aastex63.layout +++ b/lib/layouts/aastex63.layout @@ -52,9 +52,16 @@ ## # TODO: - support for new commands (see below) # - aastex6.cls loads hyperref (with pre-set options) and url -# -> option clash if "Use Hyerref" is selected in Document>Settings +# -> option clash if "Use Hyperref" is selected in Document>Settings # support for new commands in aastex 6.3 and aastex 6.31 versions # string freeze for lyx-2.4.0, must be done for lyx-2.4.1 +# - in DocBook, the appendix is not output (not a standard LyX appendix +# separator (needs a layout update) +# - in DocBook, the "Software" part should really be a section on its own, +# but that would require a way to provide the section title within the +# layout (needs a layout update) +# - in DocBook, the table notes are not supported at all (move the remarks +# into the table cells instead of outputting tablenotemark in the cells?) Format 104 @@ -232,11 +239,14 @@ Style Acknowledgments Font Shape Up EndFont - LabelType Above - Margin Static + LabelType Above +
[LyX features/biginset] DocBook: amend e3020a6b.
commit 5c5765061fa1ce1b829c1b1dad05d3fc8d879079 Author: Thibaut Cuvelier Date: Fri Mar 1 13:45:28 2024 +0100 DocBook: amend e3020a6b. Book authorship and authorship can be quite distinct. As far as I know, there is no standard way to represent book authorship in DocBook bibliographies. --- autotests/export/docbook/basic.xml | 9 - src/BiblioInfo.cpp | 15 --- src/BiblioInfo.h | 5 - src/insets/InsetBibtex.cpp | 32 +--- 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/autotests/export/docbook/basic.xml b/autotests/export/docbook/basic.xml index cafbe46547..82bec18b72 100644 --- a/autotests/export/docbook/basic.xml +++ b/autotests/export/docbook/basic.xml @@ -424,7 +424,14 @@ I am no more code. - + + + +Michel +Foucault + + + A small paper diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index 0f697ab297..253fb3759c 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -1748,13 +1748,19 @@ string citationStyleToString(const CitationStyle & cs, bool const latex) } -void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf) +void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf, + const std::string type) { // This function closely mimics getAuthorList, but produces DocBook instead of text. // It has been greatly simplified, as the complete list of authors is always produced. No separators are required, // as the output has a database-like shape. // constructName has also been merged within, as it becomes really simple and leads to no copy-paste. + if (! type.empty() && (type != "author" && type != "book")) { + LYXERR0("ERROR! Unexpected author contribution `" << type <<"'."); + return; + } + if (authorsString.empty()) { return; } @@ -1772,7 +1778,10 @@ void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs auto it = authors.cbegin(); auto en = authors.cend(); for (size_t i = 0; it != en; ++it, ++i) { - xs << xml::StartTag("author"); + const std::string tag = (type.empty() || type == "author") ? "author" : "othercredit"; + const std::string attr = (type == "book") ? R"(class="other" otherclass="bookauthor")" : ""; + + xs << xml::StartTag(tag, attr); xs << xml::CR(); xs << xml::StartTag("personname"); xs << xml::CR(); @@ -1812,7 +1821,7 @@ void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs xs << xml::EndTag("personname"); xs << xml::CR(); - xs << xml::EndTag("author"); + xs << xml::EndTag(tag); xs << xml::CR(); // Could add an affiliation after , but not stored in BibTeX. diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h index 7a8ffb9081..aeaf0fcecc 100644 --- a/src/BiblioInfo.h +++ b/src/BiblioInfo.h @@ -37,7 +37,10 @@ CitationStyle citationStyleFromString(std::string const & latex_str, std::string citationStyleToString(CitationStyle const &, bool const latex = false); /// Transforms the information about authors into a (directly written to a XMLStream). -void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf); +/// Type: "author" or empty means author of the entry (article, book, etc.); "book" means author of the book +/// (but not necessarily of this entry in particular). +void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf, +std::string type); /// Class to represent information about a BibTeX or diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index b4bf535014..d452434ab5 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -1402,29 +1402,15 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const // // Example: http://tdg.docbook.org/tdg/5.1/authorgroup.html - if (hasTag("fullnames:author") || hasTag("fullbynames:bookauthor")) { - // If several author tags are present, only output one.
[LyX features/biginset] DocBook: authorsToDocBookAuthorGroup never needs to return anything.
commit 3973bbcf9915ad16cdd7dec3c20bd2f722dfb52e Author: Thibaut Cuvelier Date: Fri Mar 1 13:32:17 2024 +0100 DocBook: authorsToDocBookAuthorGroup never needs to return anything. --- src/BiblioInfo.cpp | 11 +-- src/BiblioInfo.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index a9245c6a77..0f697ab297 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -1748,7 +1748,7 @@ string citationStyleToString(const CitationStyle & cs, bool const latex) } -docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf) +void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf) { // This function closely mimics getAuthorList, but produces DocBook instead of text. // It has been greatly simplified, as the complete list of authors is always produced. No separators are required, @@ -1756,7 +1756,7 @@ docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream // constructName has also been merged within, as it becomes really simple and leads to no copy-paste. if (authorsString.empty()) { - return docstring(); + return; } // Split the input list of authors into individual authors. @@ -1776,9 +1776,10 @@ docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream xs << xml::CR(); xs << xml::StartTag("personname"); xs << xml::CR(); - docstring name = *it; + const docstring name = *it; - // All authors go in a . If more structure is known, use it; otherwise (just "et al."), print it as such. + // All authors go in a . If more structure is known, use it; otherwise (just "et al."), + // print it as such. if (name == "others") { xs << buf.B_(etal); } else { @@ -1818,8 +1819,6 @@ docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream } xs << xml::EndTag("authorgroup"); xs << xml::CR(); - - return docstring(); } } // namespace lyx diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h index f4051bf225..7a8ffb9081 100644 --- a/src/BiblioInfo.h +++ b/src/BiblioInfo.h @@ -37,7 +37,7 @@ CitationStyle citationStyleFromString(std::string const & latex_str, std::string citationStyleToString(CitationStyle const &, bool const latex = false); /// Transforms the information about authors into a (directly written to a XMLStream). -docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf); +void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf); /// Class to represent information about a BibTeX or -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] DocBook: support bookauthor in bibliographies.
commit e3020a6b2d240d0e1ae2aec8dfd754f6cd64dee1 Author: Thibaut Cuvelier Date: Fri Mar 1 12:55:40 2024 +0100 DocBook: support bookauthor in bibliographies. --- autotests/export/docbook/basic.bib | 11 +++ autotests/export/docbook/basic.lyx | 2 +- autotests/export/docbook/basic.xml | 31 +-- src/insets/InsetBibtex.cpp | 25 ++--- 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/autotests/export/docbook/basic.bib b/autotests/export/docbook/basic.bib index 88a9fe7b14..b106326c4d 100644 --- a/autotests/export/docbook/basic.bib +++ b/autotests/export/docbook/basic.bib @@ -107,3 +107,14 @@ volume = {MCMXCVII}, month= 7, note = {An optional note} } + +@incollection{Foucault:Kritik-EN92, +author = {Foucault, Michel}, +title = {What is Critique?}, +bookauthor = {Foucault, Michel}, +booktitle = {The Politics of Truth}, +pages = {41-82}, +publisher = {Semiotext(e)}, +address = {Los Angeles}, +year = {1997} +} diff --git a/autotests/export/docbook/basic.lyx b/autotests/export/docbook/basic.lyx index d1078b9721..83b907fb54 100644 --- a/autotests/export/docbook/basic.lyx +++ b/autotests/export/docbook/basic.lyx @@ -876,7 +876,7 @@ Many things, \begin_inset CommandInset citation LatexCommand cite -key "article,book,booklet,conference,inbook,incollection" +key "article,book,booklet,conference,inbook,incollection,Foucault:Kritik-EN92" literal "false" \end_inset diff --git a/autotests/export/docbook/basic.xml b/autotests/export/docbook/basic.xml index 2248a2cbf4..cafbe46547 100644 --- a/autotests/export/docbook/basic.xml +++ b/autotests/export/docbook/basic.xml @@ -264,7 +264,7 @@ I am no more code. I am the sixth section and I really like bibliographies This text has references. First reference: . Second reference: . Both at the same time: , . A book: . -Many things, just testing for completeness: , , , , , . +Many things, just testing for completeness: , , , , , , . I am the seventh section and I deal with indices @@ -358,12 +358,17 @@ I am no more code. The title of the work +4 +3 201-213 inbook The name of the publisher - +The address of the publisher 1993 + + + @@ -372,6 +377,7 @@ I am no more code. +An optional note The title of the work @@ -399,6 +405,27 @@ I am no more code. An optional note + +What is Critique? +41-82 +incollection + +Semiotext(e) +Los Angeles +1997 + +The Politics of Truth + + + + +Michel +Foucault + + + + + A small paper -1 diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 2e6f7f7fb7..b4bf535014 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -1142,6 +1142,7 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const // Store the mapping between BibTeX and DocBook. map toDocBookTag; toDocBookTag["fullnames:author"] = "SPECIFIC"; // No direct translation to DocBook: . + toDocBookTag["fullbynames:bookauthor"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["publisher"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["address"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["editor"] = "SPECIFIC"; // No direct translation to DocBook: . @@ -1401,11 +1402,29 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const // // Example: http://tdg.docbook.org/tdg/5.1/authorgroup.html - if (hasTag("fullnames:author")) { + if (hasTag("fullnames:author") || hasTag("fullbynames:bookauthor")) { + // If several author tags are present, only output one. + const docstring authorName = getTag( + hasTag("fullnames:author") ? "fullnames:author" : "fullbynames:bookauthor"); + // Perform full parsing of the BibTeX string, dealing with the many corner cases that might // be encountered. - authorsToDocBookAuthorGroup(getTag("fullnames:author"), xs, buffer()); - eraseTag("fullnames:author"); + authorsToDocBookAuthorGroup(authorName, xs, buffer()); + + if (hasTag("fullnames:author") && hasTag("fullbynames:bookauthor")) { + xs << XMLStream::ESCAPE_NONE << + from_utf8(
Re: Conclusions from CVE-2024-3094 (libxz disaster)
> Le 31 mars 2024 à 19:06, Thibaut a écrit : >> Le 31 mars 2024 à 18:46, Daniel Golle a écrit : >> >> I've seen that, and by itself it does not present a security risk in >> the context libarchive is intended to be used. BTW in case that isn’t obvious, the deadliest exploits typically invovlve uses cases *outside* of the software intended use. Just because you or I don’t see a security implication doesn’t mean there isn’t one :) Cheers, T ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: Conclusions from CVE-2024-3094 (libxz disaster)
> Le 31 mars 2024 à 18:46, Daniel Golle a écrit : > > On Sun, Mar 31, 2024 at 12:05:03PM +0200, Thibaut wrote: >> >>> Le 31 mars 2024 à 01:07, Elliott Mitchell a écrit : >>> >>>> Normally upstream publishes release tarballs that are different than the >>>> automatically generated ones in GitHub. In these modified tarballs, a >>>> malicious version of build-to-host.m4 is included to execute a script >>>> during the build process. >>> >>> So the malicious source code was part of all tarballs, but only the >>> tarballs with the modified `build-to-host.m4` would trigger the malicious >>> payload. >>> >>> So obtaining GitHub's tarballs which came directly from the Git >>> repository *does* avoid the breach. >> >> https://git.tukaani.org/?p=xz.git;a=commitdiff;h=f9cf4c05edd14dedfe63833f8ccbe41b55823b00 >> >> Let’s not lure ourselves into thinking that not using upstream-provided >> tarballs but upstream-provided repo instead is inherently safer. With >> adversarial upstream, *nothing* is safe anyway. > > Just using git checkouts (or **repoducible** tarballs generated from a > repo's git-ref, ie. tag or commit) by itself of course doesn't help > much. *nod* > But for myself, maintaining a medium 2-digit number of packages, using > git checkouts (or **reproducible** tarballs generated from git > checkouts) would mean that I can at least be sure that the git > commits I've been seeing and the diff between version tags **would > really correspond to the content of tarball**, without having to put > extra work just into that (which imho nobody does). I believe most maintainers don’t even do commits lookup. Happy to be proven wrong tho. > I've never claimed that this alone is the solution, but if we are > already used to > > a) the content of a release tarball not matching the git repo > (because of `make dist` autotools nonsense, for example), > b) the hash of such tarball being different depending on who generates > it with subtle difference such as the folder name, > c) people all the time "fix" PKG_MIRROR_HASH without anyone having > any option to validate the cause for the "wrong" hash in first > place. > > Then the added security of PKG_HASH and esp. PKG_MIRROR_HASH is very > small. Too small, if you ask me. ACK. > And other than the complex > social/economical/political problems which lead to something like the > xz backdoor (out of question: those are the bigger problems), that's a > technical problem we could quite easily improve **and it would have > been sufficient to prevent the attack** in this case. > > There is a reason the attacker(s) went through great lengths to move > the official mirror site of the project, change the PGP key and hide > the key piece of the exploit in the tarballs they generated (and > signed) instead of in a git commit. This is not by chance. You could chalk it on extra precaution, but they could conceivably have achieved the same result more openly, given the level of control they had over the repo and the level of scrutiny they received (essentially none). > What we need is "Reproducible Source/Release Tarballs", not as a > solution to all our problems, but as a **pre-condition** which > currently isn't met for obvious reasons. ACK. > Hence I'm still arguing that the lesser resource use of downloading > Github archive/codeload/release tarballs is not worth the loss of > integrity and audit-trail of git. ACK. > Yes, I know SHA-1 is outdated, but in the context of git it's not so > easy to add lots of random padding which would be required to generate > a hash collission, which has yet to be seen even for contexts with > much more freedom than the narrow syntax of a git diff (and commit > message). So sure, it's not perfect, but it's better than nothing. > > And while release tarballs (being *delibertely* different from the content > of the source repo at their corresponding tag for things like an added > VERSION or ChangeLog file or stuff like that which is information the > build process could otherwise learn from .git) have some small arguable > value, hard or impossible to reproduce Github-generated tarballs really > do NOT have any value. They are an obstacle, and lure people into bad > practices such as all those "Fix PKG_MIRROR_HASH" commits which become > the norm (and should really not). ACK. I agree with all that, although earlier you seemed to claim that using GH-generated tarballs would somehow be better than using upstream-provided tarballs, and here it seems you’re reverting course :) My point is: neither is secure, and neither is using a git check
Re: Conclusions from CVE-2024-3094 (libxz disaster)
> Le 31 mars 2024 à 01:07, Elliott Mitchell a écrit : > >> Normally upstream publishes release tarballs that are different than the >> automatically generated ones in GitHub. In these modified tarballs, a >> malicious version of build-to-host.m4 is included to execute a script >> during the build process. > > So the malicious source code was part of all tarballs, but only the > tarballs with the modified `build-to-host.m4` would trigger the malicious > payload. > > So obtaining GitHub's tarballs which came directly from the Git > repository *does* avoid the breach. https://git.tukaani.org/?p=xz.git;a=commitdiff;h=f9cf4c05edd14dedfe63833f8ccbe41b55823b00 Let’s not lure ourselves into thinking that not using upstream-provided tarballs but upstream-provided repo instead is inherently safer. With adversarial upstream, *nothing* is safe anyway. And even when upstream repo isn’t entirely under adversarial control, a bad actor can sneak stuff in: https://github.com/libarchive/libarchive/commit/6110e9c82d8ba830c3440f36b990483ceaaea52c My 2c. T ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: Layout file format change proposal
On Thu, 28 Mar 2024 at 12:41, Lorenzo Bertini wrote: > Il giorno gio 28 mar 2024 alle ore 11:40 José Matos > ha scritto: > > > > On Wed, 2024-03-27 at 11:02 -0400, Scott Kostyshak wrote: > > > Cool idea, Lorenzo! There have been some discussions in the past on > > > using standard formats, even for the .lyx file itself. I can see the > > > advantages of that but I don't know what the cost of converting to > > > them > > > is. > > > > > > Scott > > > > Typical answer to this: > > https://xkcd.com/927/ > > > > :-) > > > > It makes sense for us to use a standard format. > > Some of the questions then are: > > * which one is chosen (what is the most appropriate for our needs)? > > * what the are advantages and drawbacks from this change? > > * what is the transition plan? > > * what is the effort required for this transition? > > > > Best regards, > > -- > > José Abílio > > -- > > Ah, a classic xkcd. For once, however, the talk is about "removing" > one standard :) > Many standards aim at removing older standards :)! > * Which one to choose? > See research below. > > * The advantages and drawbacks > As already mentioned, using a more common format means > - people generally more familiar with the format > - having more tools able to produce them, easing the efforts of > publishers trying to provide layouts > - having parsers already available, for LyX and for people wanting > to manipulate them externally > The drawbacks that i can think of are > - migration always takes developer effort > - migration can take user effort too, to adapt to the new format > (this can be greatly mitigated by which format is chosen) > > * The transition plan: > The new format is introduced *alongside* the old format. The LyX > version that brings the format will have all layouts converted, but > will accept the old format too. This "transition period" can last > indefinitely. > In a way, that's how LyX works right now: you can import a very old document or layout, it should still work thanks to upgrade scripts. YAML, TOML, or something else would just be a new version (which means you must keep the version field: the format evolves a lot between versions). Here is the script that does the conversion: https://git.lyx.org/gitweb/?p=lyx.git;a=blob;f=lib/scripts/layout2layout.py;h=611639412a78e4235a55e41c890546f4e080c06f;hb=HEAD. > * The efforts required for the transition > We need to: > - write or choose a parser for the new format that maps a file to a > LyX's params > - write a converter from the old format to the new one > - convert all the files to the new formats and test them > > Here is some info I dug up regarding configuration formats. For pros > and cons I tried to limit them to one single aspect where they excel > or fail > - JSON: > . pros: most widely supported > . cons: not concise or readable, very distant from .layout > - TOML: > . pros: very easy to read and write, even for humans > . cons: not widespread, distant from .layout > - YAML: > . pros: very easy to read and write, very close to .layout > . cons: indentation is prone to syntax errors > - XML: > . pros: the one and only, supports validation through schemas, > widely supported > . cons: hard to read and write, very distant from .layout > All of these formats are rather well supported and far from shiny new things (I think all of them have at least a decade of existence). Regarding validation: XML Schema has many offsprings, such as JSON Schema ( https://json-schema.org/), with implementations that work on YAML and TOML ( https://json-schema-everywhere.github.io/toml). In any case, these schemas are extremely lacking compared to 21st-century XML validation (RelaxNG with Schematron). We currently have no validation, but it would be great to have it as part of the test suite. How well do these formats work with (long) strings? What's great with the current format is that you don't need to escape anything when LyX expects a string. This aspect of the design removes a huge source of typos. > I asked a chatbot to convert LyX's following layout extract into those > formats: > > LYX'S LAYOUT > > InsetLayout Marginal > LabelString Margin > LatexType command > Font > SizeSmall > EndFont > LabelFont > Color marginlabel > SizeSmall > EndFont > HTMLStyle > div.marginal { > border: 2px solid black; > font-style: normal; > } > EndHTMLStyle > End > > JSON: > > { > "InsetLayout": { > "LabelString": "Margin", > "LatexType": "command", > "Font": { > "Size": "Small" > }, > "LabelFont": { > "Color": "marginlabel", > "Size": "Small" > }, > "HTMLStyle": { > "div.marginal": { > "border": "2px solid black", > "font-style": "normal" > } > } > } > } > > TOML: > > [InsetLayout] > LabelString =
[TYPES/announce] SYCO 12, Call For Participation
[ The Types Forum (announcements only), http://lists.seas.upenn.edu/mailman/listinfo/types-announce ] - CALL FOR PARTICIPATION TWELFTH SYMPOSIUM ON COMPOSITIONAL STRUCTURES (SYCO 12) Birmingham, UK 15-16 April, 2024 Registration deadline: Wednesday 03 April 2024 https://urldefense.com/v3/__https://www.cl.cam.ac.uk/events/syco/12/__;!!IBzWLUs!SRMsx8_O1cDI2Tz16T6TKBK7QSWnbOvhkSloHD62n6ZZfQeL_nm-EedcGhmAf32vn65Oz3yIOyTBtdoAkdpN-3U4H4HUp0I$ - The Symposium on Compositional Structures (SYCO) is an interdisciplinary series of meetings aiming to support the growing community of researchers interested in the phenomenon of compositionality, from both applied and abstract perspectives, and in particular where category theory serves as a unifying common language. Previous SYCO events have been held in Birmingham, Strathclyde, Oxford, Chapman, Leicester, Tallinn, Como, Edinburgh and Palaiseau. The program consists of 2 invited talks and 14 contributed talks. We will try to offer the possibility of following the talks online. REGISTRATION Registration is open until Wednesday 03 April 2024 at https://urldefense.com/v3/__https://forms.gle/XxKEssgXiYSo4TUZ8__;!!IBzWLUs!SRMsx8_O1cDI2Tz16T6TKBK7QSWnbOvhkSloHD62n6ZZfQeL_nm-EedcGhmAf32vn65Oz3yIOyTBtdoAkdpN-3U4XbXVfpM$ Registration is free and required even if you plan to follow the event online. INVITED SPEAKERS The invited speakers are - Miriam Backens (INRIA Nancy): Graphical rewriting of quantum computations using the ZX-calculus and flow properties - Sean Moss (University of Birmingham): The Markov category of a random graph CONTRIBUTED TALKS = The full schedule is available at https://urldefense.com/v3/__https://www.cl.cam.ac.uk/events/syco/12/__;!!IBzWLUs!SRMsx8_O1cDI2Tz16T6TKBK7QSWnbOvhkSloHD62n6ZZfQeL_nm-EedcGhmAf32vn65Oz3yIOyTBtdoAkdpN-3U4H4HUp0I$ - Tanguy Massacrier, Philippe Malbos, Georg Struth Single-set cubical categories and their formalisation with a proof assistant - Filippo Bonchi, Alessandro Di Giorgio, Nathan Haydon, Pawel Sobocinski Diagrammatic Algebra of First Order Logic - Aziz Kharoof Homotopical characterization of strong contextuality - Pablo Donato The Flower Calculus - Flavien Breuvart, Quan Long, Vladimir Zamdzhiev On the Centre of Strong Graded Monads - Grégoire Sergeant-Perthuis Compositional statistical mechanics, entropy and variational inference - Nathan Corbyn, Lukas Heidemann, Nick Hu, Chiara Sarti, Calin Tataru, Jamie Vicary homotopy.io: a proof assistant for finitely-presented globular n-categories - Aloïs Rosset, Maaike Zwart, Helle Hvid Hansen, Jörg Endrullis Correspondence between Composite Theories and Distributive Laws - Adrián Doña Mateo Pushing monads forward - Joshua Wrigley A topos-theoretic framework for reconstruction theorems in model theory - David Forsman Monoidal Meta-Theorem - Paul B Levy Game-enriched categories - Bruno Gavranović, Paul Lessard, Andrew Joseph Dudzik, Tamara von Glehn, João Guilherme Madeira Araújo, Petar Veličković Categorical Deep Learning: An Algebraic Theory of Architectures - Alexei Lisitsa, Andrew Fish Automated Reasoning for Tangles with Quantum Verification Applications PROGRAM COMMITTEE = Todd Ambridge, University of Birmingham Thibaut Benjamin, University of Cambridge (Chair) Olivia Caramello, Univserity of Insubria, Université Paris-Saclay Ross Duncan, University of Strathclyde Chris Heunen, University of Edinburgh Dominic Horsman, University of Grenoble George Kaye, University of Birmingham Aleks Kissinger, University of Oxford Jean-Simon Lemay, Macquarie University Paul Levy, University of Birmingham Ioannis Markakis, University of Cambridge Samuel Mimram, Ecole Polytechnique Paige North, Utrecht University Simona Paoli, University of Aberdeen Daniela Petrisan, Université Paris Cité Morgan Rogers, Université Sorbonne Paris Nord Mehrnoosh Sadrzadeh, University College London Pawel Sobocinski, Tallinn University of Technology Jamie Vicary, University of Cambridge STEERING COMMITTEE == Ross Duncan, University of Strathclyde Chris Heunen, University of Edinburgh Dominic Horsman, University of Oxford Aleks Kissinger, University of Oxford Samuel Mimram, Ecole Polytechnique Simona Paoli, University of Aberdeen Mehrnoosh Sadrzadeh, University College London Pawel Sobocinski, Tallinn University of Technology Jamie Vicary, University of Cambridge
[gphoto-devel] TAKARA CAM MV137
Bonjour, J'aimerais arriver à faire fonctionner ma caméra TAKARA CAM MV137 sur gphoto2. Je suis sur RPI 3 Bullseye. Voici les informations : * Lsusb : Bus 001 Device 015: ID 1f3a:1002 Allwinner Technology mediacom XPRO 415 * gphoto2 --auto-detect : Model Port -- * LANG=C gphoto2 --summary >summary.txt *** Error *** Could not detect any camera *** Error (-105: 'Unknown model') *** * LANG=C gphoto2 --list-all-config >config.txt *** Error *** Could not detect any camera *** Error *** An error occurred in the io-library ('Unknown error'): No error description available *** Error (-105: 'Unknown model') *** * gphoto2 --capture-image *** Error *** Could not detect any camera *** Error (-105: 'Unknown model') *** For debugging messages, please use the --debug option. Debugging messages may help finding a solution to your problem. If you intend to send any error or debug messages to the gphoto developer mailing list gphoto-devel@lists.sourceforge.net<mailto:gphoto-devel@lists.sourceforge.net>, please run gphoto2 as follows: env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --capture-image Please make sure there is sufficient quoting around the arguments. Je vous remercie, Cordialement, Thibaut TURRIER thibaut.turr...@hotmail.fr<mailto:thibaut.turr...@hotmail.fr> For debugging messages, please use the --debug option. Debugging messages may help finding a solution to your problem. If you intend to send any error or debug messages to the gphoto developer mailing list , please run gphoto2 as follows: env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --list-all-config Please make sure there is sufficient quoting around the arguments. For debugging messages, please use the --debug option. Debugging messages may help finding a solution to your problem. If you intend to send any error or debug messages to the gphoto developer mailing list , please run gphoto2 as follows: env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --summary Please make sure there is sufficient quoting around the arguments. ___ Gphoto-devel mailing list Gphoto-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gphoto-devel
[LyX/master] Amend 16660d12.
commit fd378450755b698cc3ddb1a8d14e8b78d19c57a2 Author: Thibaut Cuvelier Date: Thu Mar 21 21:32:45 2024 +0100 Amend 16660d12. The previous commit introduced wrong behaviours for <>. The new code carefully escapes what needs to be escaped from LaTeX, using the now-standard XML tools (XMLStream). --- autotests/export/xhtml/math_output_latex.lyx | 2 +- autotests/export/xhtml/math_output_latex.xhtml | 2 +- src/insets/InsetLabel.cpp | 2 + src/mathed/InsetMathHull.cpp | 62 -- src/mathed/InsetMathHull.h | 4 +- 5 files changed, 45 insertions(+), 27 deletions(-) diff --git a/autotests/export/xhtml/math_output_latex.lyx b/autotests/export/xhtml/math_output_latex.lyx index 59d77d2f9b..7c49de59f6 100644 --- a/autotests/export/xhtml/math_output_latex.lyx +++ b/autotests/export/xhtml/math_output_latex.lyx @@ -100,7 +100,7 @@ The problem occurs when adding a label. \begin_layout Standard \begin_inset Formula \begin{equation} -x^{2}\label{eq:1} +x^{2}<\log x\label{eq:1} \end{equation} \end_inset diff --git a/autotests/export/xhtml/math_output_latex.xhtml b/autotests/export/xhtml/math_output_latex.xhtml index cec2d5ba0d..713def3459 100644 --- a/autotests/export/xhtml/math_output_latex.xhtml +++ b/autotests/export/xhtml/math_output_latex.xhtml @@ -22,7 +22,7 @@ div.standard { Math formula output as raw LaTeX The problem occurs when adding a label. https://www.lyx.org/trac/ticket/13048 -x^{2}(1) +x^{2}<\log x(1) diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp index 1ca8ea08ae..ab5a5e1716 100644 --- a/src/insets/InsetLabel.cpp +++ b/src/insets/InsetLabel.cpp @@ -380,6 +380,8 @@ void InsetLabel::docbook(XMLStream & xs, OutputParams const & runparams) const docstring InsetLabel::xhtml(XMLStream & xs, OutputParams const &) const { + // Print the label as an HTML anchor, so that an external link can point to this equation. + // (URL: FILE.html#EQ-ID.) // FIXME XHTML // Unfortunately, the name attribute has been deprecated, so we have to use // id here to get the document to validate as XHTML 1.1. This will cause a diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index bb368b3b93..94d293870d 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -2574,35 +2574,56 @@ void InsetMathHull::mathmlize(MathMLStream & ms) const } -void InsetMathHull::mathAsLatex(TeXMathStream & os) const +docstring InsetMathHull::mathAsLatex() const { - MathEnsurer ensurer(os, false); bool const havenumbers = haveNumbers(); bool const havetable = havenumbers || nrows() > 1 || ncols() > 1; if (!havetable) { + odocstringstream ls; + otexrowstream ots(ls); + TeXMathStream os(ots, false, true, TeXMathStream::wsPreview); + ModeSpecifier specifier(os, MATH_MODE); + MathEnsurer ensurer(os, false); + os << cell(index(0, 0)); - return; + return ls.str(); } - os << ""; + odocstringstream ods; + XMLStream xs(ods); + + xs << xml::StartTag("table", "class='mathtable'"); for (row_type row = 0; row < nrows(); ++row) { - os << ""; + xs << xml::StartTag("tr"); for (col_type col = 0; col < ncols(); ++col) { - os << ""; - os << cell(index(row, col)); - os << ""; + xs << xml::StartTag("td", "class='math'"); + + odocstringstream ls; + otexrowstream ots(ls); + TeXMathStream os(ots, false, true, TeXMathStream::wsPreview); + ModeSpecifier specifier(os, MATH_MODE); + MathEnsurer ensurer(os, false); + + os << cell(index(0, 0)); + // ls.str() contains a raw LaTeX string, which might require some encoding before being valid XML. + xs << ls.str(); + + xs << xml::EndTag("td"); } if (havenumbers) { - os << ""; + xs << xml::StartTag("td"); docstring const & num = numbers_[row]; - if (!num.empty()) - os << '(' << num << ')'; - os << ""; + if (!num.empty()) { + xs << '(' << num << ')'; +
Re: [elixir-core:11718] Code.eval_string() raises warnings when parsing Mix.lock
Thanks Wojtek - I was unsure if this would result in a potential change request (on the format of Mix.lock itself), hence my posting here, but well noted! Thanks for hint as well, that should do! -- Thibaut Le jeudi 21 mars 2024 à 17:14:18 UTC+1, woj...@wojtekmach.pl a écrit : > Please use ElixirForum and such to ask questions as broader community can > answer as well as see replies. This ML tends to be focus on feature > requests. > > On v1.16 you should be able to pass emit_warnings: false. I believe there > are equivalents on prior versions, they should be documented in this > function: https://hexdocs.pm/elixir/Code.html#string_to_quoted/2 > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/48c21cff-0435-400f-8ba6-1fd9d524a732n%40googlegroups.com.
[elixir-core:11716] Code.eval_string() raises warnings when parsing Mix.lock
Hello! A slightly exotic use-case, but I would like to have your opinion :-) While doing maintenance work, I often leverage the fact that Mix.lock content is "valid Elixir" to implement useful stuff. Two examples are: - https://github.com/etalab/transport-site/blob/master/generate_deps_changelogs.exs to automatically generate "diff" sections on maintenance PR (see "Changelogs" sections at https://github.com/etalab/transport-site/pull/3814) - other tooling to verify that unwanted dependencies have not been replaced unwillingly (example at https://github.com/etalab/transport-site/issues/3820, there is code in addition to French!) The point I want to bring is that this call (at least on Elixir 1.15): Code.eval_string(File.read!("mix.lock")) raises warnings such as: warning: found quoted keyword "mox" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes nofile:78:4 This is not a super blocking point at this stage, but I wonder if ensuring that Mix.lock is formatted in a way that does not lead to warning would be a possibility here? Alternatively, what would be better ways to get the same value (maybe leveraging Mix internals), without having to "migrate" the format? The tooling I use is here to stay, and worst case I can either ignore the warnings, or "pre-process" the file to remove them, if needed. Thanks! -- Thibaut -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/c7d279b7-0b8a-4a8f-8225-2d4cd99ffdfdn%40googlegroups.com.
[LyX/master] MathML in HTML: don't escape <> for a raw LaTeX output.
commit 16660d12b4333f6486259048dec2b0a2e48a64d9 Author: Thibaut Cuvelier Date: Thu Mar 21 00:29:23 2024 +0100 MathML in HTML: don't escape <> for a raw LaTeX output. In some cases (I only found numbered equations), the LaTeX output still has a bit of HTML. For numbered equations, using \tag{X} (as suggested in https://www.lyx.org/trac/ticket/13048) would require fiddling with the output. KaTeX doesn't support \label. This patch is probably the easiest and most reliable fix. Fixes https://www.lyx.org/trac/ticket/13048. --- autotests/export/xhtml/math_output_latex.lyx | 112 + autotests/export/xhtml/math_output_latex.xhtml | 28 +++ src/mathed/InsetMathHull.cpp | 3 +- 3 files changed, 142 insertions(+), 1 deletion(-) diff --git a/autotests/export/xhtml/math_output_latex.lyx b/autotests/export/xhtml/math_output_latex.lyx new file mode 100644 index 00..59d77d2f9b --- /dev/null +++ b/autotests/export/xhtml/math_output_latex.lyx @@ -0,0 +1,112 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass article +\use_default_options true +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 3 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Title +Math formula output as raw LaTeX +\end_layout + +\begin_layout Standard +The problem occurs when adding a label. + https://www.lyx.org/trac/ticket/13048 +\end_layout + +\begin_layout Standard +\begin_inset Formula +\begin{equation} +x^{2}\label{eq:1} +\end{equation} + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/autotests/export/xhtml/math_output_latex.xhtml b/autotests/export/xhtml/math_output_latex.xhtml new file mode 100644 index 00..cec2d5ba0d --- /dev/null +++ b/autotests/export/xhtml/math_output_latex.xhtml @@ -0,0 +1,28 @@ + +http://www.w3.org/1999/xhtml; lang="en-US"> + + +Math formula output as raw LaTeX + +/* Layout-provided Styles */ +h1.title { +font-size: x-large; +margin-bottom: 1ex; +text-align: center; + +} +div.standard { + margin-bottom: 2ex; +} + + + + + +Math formula output as raw LaTeX +The problem occurs when adding a label. https://www.lyx.org/trac/ticket/13048 + +x^{2}(1) + + + diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 2ba98b3d4d..bb368b3b93 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -2729,7 +2729,8 @@ docstring InsetMathHull::xhtml(XMLStream & xs, OutputParams const & op) const // probably should allow for some kind of customization here string const tag = (getType() == hullSimple) ? "span" : "div"; xs << xml::StartTag(tag, "class='math'") - << latex + << XMLStream::ESCAPE_AND << latex // Don't escape <> tags: latex might contain them + // (typically, when there is a label). << xml::EndTag(tag) << xml::CR(); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[TYPES/announce] SYCO 12 - Third call for papers
[ The Types Forum (announcements only), http://lists.seas.upenn.edu/mailman/listinfo/types-announce ] - CALL FOR SUBMISSIONS TWELFTH SYMPOSIUM ON COMPOSITIONAL STRUCTURES (SYCO 12) Birmingham, UK 15-16 April, 2024 Submission deadline: Monday 11 March 2024 https://urldefense.com/v3/__https://www.cl.cam.ac.uk/events/syco/12/__;!!IBzWLUs!UXt7goq_Q-eJqUMUOgwfqV8ClcTsfI8Ov-FWRB1LYOVNZhx5PFwY_O0qE5gva6RtXu5CPtEC_P4ButFqOLXbc2ZtE_mgd50$ - The Symposium on Compositional Structures (SYCO) is an interdisciplinary series of meetings aiming to support the growing community of researchers interested in the phenomenon of compositionality, from both applied and abstract perspectives, and in particular where category theory serves as a unifying common language. Previous SYCO events have been held in Palaiseau, Birmingham, Strathclyde, Oxford, Chapman, Leicester, Tallinn, and Como. We welcome submissions from researchers across computer science, mathematics, physics, philosophy, and beyond, with the aim of fostering friendly discussion, disseminating new ideas, and spreading knowledge between fields. Submission is encouraged for both mature research and work in progress, and by both established academics and junior researchers, including students. Submissions is easy, with no formatting or page restrictions. The meeting does not have proceedings, so work can be submitted even if it has been submitted or published elsewhere. You could submit work-in-progress, or a recently completed paper, or even a PhD or Masters thesis. While no list of topics could be exhaustive, SYCO welcomes submissions with a compositional focus related to any of the following areas, in particular from the perspective of category theory: - logical methods in computer science, including classical and quantum programming, type theory, concurrency, natural language processing and machine learning; - graphical calculi, including string diagrams, Petri nets and reaction networks; - languages and frameworks, including process algebras, proof nets, type theory and game semantics; - abstract algebra and pure category theory, including monoidal category theory, higher category theory, operads, polygraphs, and relationships to homotopy theory; - quantum algebra, including quantum computation and representation theory; - tools and techniques, including rewriting, formal proofs and proof assistants, and game theory; - industrial applications, including case studies and real-world problem descriptions. IMPORTANT DATES === All deadlines are 23:59 Anywhere on Earth. Submission deadline: Monday 11 March, 2024 Author notification: Monday 18 March, 2024 Symposium dates: Monday 15 and Tuesday 16 April 2024 SUBMISSION INSTRUCTIONS === Submissions are by OpenReview, via the SYCO 12 submission page: https://urldefense.com/v3/__https://openreview.net/group?id=cl.cam.ac.uk*SYCO*2024*Symposium__;Ly8v!!IBzWLUs!UXt7goq_Q-eJqUMUOgwfqV8ClcTsfI8Ov-FWRB1LYOVNZhx5PFwY_O0qE5gva6RtXu5CPtEC_P4ButFqOLXbc2ZtLy1lyjc$ (be aware that you will need to create an account on OpenReview, which is automatic if you are using an academic e-mail address, but might take up to 2 weeks with a non-academic e-mail address) Submission is easy, with no format requirements or page restrictions. The meeting does not have proceedings, so work can be submitted even if it has been submitted or published elsewhere. Think creatively: you could submit a recent paper, or notes on work in progress, or even a recent Masters or PhD thesis. In the event that more good-quality submissions are received than can be accommodated in the timetable, the programme committee may choose to *defer* some submissions to a future meeting, rather than reject them. Deferred submissions can be re-submitted to any future SYCO meeting, where they will not need peer review, and where they will be prioritised for inclusion in the programme. Meetings will be held sufficiently frequently to avoid a backlog of deferred papers. If you have a submission which was deferred from a previous SYCO meeting, it will not automatically be considered for SYCO 12; you still need to submit it again through OpenReview. When submitting, append the words "DEFERRED FROM SYCO X" to the title of your paper, replacing "X" with the appropriate meeting number. There is no need to attach any documents. INVITED SPEAKERS Miriam Backens, INRIA Nancy, Graphical rewriting of quantum computations using the ZX-calculus and flow properties Sean Moss, University of Birmingham, TBA PROGRAMME COMMITTEE === Todd Ambridge, University of Birmingham Thibaut Benjamin, University of Cambridge (Chair) Olivia Caramello, Univserity of Insubria, Université Paris-Saclay Ross Duncan, University of Strathclyde Chris Heunen, University of
[LyX/master] MathML: stop stretching all delimiters.
commit 8f820d7ccb0cb6129c8e3c1d495905d61db97355 Author: Thibaut Cuvelier Date: Mon Mar 11 01:40:16 2024 +0100 MathML: stop stretching all delimiters. No form? Reference: https://w3c.github.io/mathml-core/#dfn-form. The MathML processor is smart enough to determine whether the delimiter is prefix or postfix. No stretchy/symmetric/fence in all cases? Reference: https://w3c.github.io/mathml-core/#algorithm-for-determining-the-properties-of-an-embellished-operator and https://w3c.github.io/mathml-core/#operator-dictionary-human (example entry: U+0028). Delimiters have the right properties by default. --- src/mathed/InsetMathDelim.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index d32029b818..fab72db88d 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -190,15 +190,16 @@ void InsetMathDelim::mathematica(MathematicaStream & os) const void InsetMathDelim::mathmlize(MathMLStream & ms) const { // Ignore the delimiter if: it is empty or only a space (one character). + const std::string attr = is_extracted_ ? "stretchy='false'" : ""; if (!left_.empty() && ((left_.size() == 1 && left_[0] != ' ') || left_.size() > 1)) { ms << MTag("mrow") - << MTagInline("mo", "form='prefix' fence='true' stretchy='true' symmetric='true'") + << MTagInline("mo", attr) << convertDelimToXMLEscape(left_) << ETagInline("mo"); } ms << cell(0); if (!right_.empty() && ((right_.size() == 1 && right_[0] != ' ') || right_.size() > 1)) { - ms << MTagInline("mo", "form='postfix' fence='true' stretchy='true' symmetric='true'") + ms << MTagInline("mo", attr) << convertDelimToXMLEscape(right_) << ETagInline("mo") << ETag("mrow"); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] MathML: don't let the processor stretch operators when they are single characters for LyX.
commit 7e6597a5b47c22ed22966a75c149264dacd6e289 Author: Thibaut Cuvelier Date: Mon Mar 11 02:00:47 2024 +0100 MathML: don't let the processor stretch operators when they are single characters for LyX. The main goal is to match TeX' behaviour. If you want stretchy operators, use InsetMathDelim / \left & \right. This patch will change the output in many files, but making the rendering much closer to that of TeX (which users should expect, due to LyX' roots in TeX). --- src/mathed/InsetMathChar.cpp | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp index 71aba6f6f7..a642a5e6da 100644 --- a/src/mathed/InsetMathChar.cpp +++ b/src/mathed/InsetMathChar.cpp @@ -230,6 +230,8 @@ void InsetMathChar::octave(OctaveStream & os) const // mathalpha, then we'll treat it as an identifier, otherwise as an // operator. // Worst case: We get bad spacing, or bad italics. +// In any case, never let MathML stretch a single character when it +// is recognised as an operator, to match TeX' behaviour. void InsetMathChar::mathmlize(MathMLStream & ms) const { std::string entity; @@ -253,7 +255,7 @@ void InsetMathChar::mathmlize(MathMLStream & ms) const } if (!entity.empty()) { - ms << MTagInline("mo") + ms << MTagInline("mo", "stretchy='false'") << from_ascii(entity) << ETagInline("mo"); return; @@ -262,7 +264,7 @@ void InsetMathChar::mathmlize(MathMLStream & ms) const char const * type = (isAlphaASCII(char_) || Encodings::isMathAlpha(char_)) ? "mi" : "mo"; - ms << MTagInline(type) + ms << MTagInline(type, std::string(type) == "mo" ? "stretchy='false'" : "") << char_type(char_) << ETagInline(type); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] MathML: don't output delimiters in InsetMathBinom and InsetMathDelim if the delimiter is a space.
commit be03d699463fba896f90e3046b0814d527368771 Author: Thibaut Cuvelier Date: Mon Mar 11 01:30:48 2024 +0100 MathML: don't output delimiters in InsetMathBinom and InsetMathDelim if the delimiter is a space. --- src/mathed/InsetMathDelim.cpp | 23 ++- src/mathed/InsetMathFrac.cpp | 21 + 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index 78d26fceea..d32029b818 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -189,15 +189,20 @@ void InsetMathDelim::mathematica(MathematicaStream & os) const void InsetMathDelim::mathmlize(MathMLStream & ms) const { - ms << MTag("mrow") - << MTagInline("mo", "form='prefix' fence='true' stretchy='true' symmetric='true'") - << convertDelimToXMLEscape(left_) - << ETagInline("mo") - << cell(0) - << MTagInline("mo", "form='postfix' fence='true' stretchy='true' symmetric='true'") - << convertDelimToXMLEscape(right_) - << ETagInline("mo") - << ETag("mrow"); + // Ignore the delimiter if: it is empty or only a space (one character). + if (!left_.empty() && ((left_.size() == 1 && left_[0] != ' ') || left_.size() > 1)) { + ms << MTag("mrow") + << MTagInline("mo", "form='prefix' fence='true' stretchy='true' symmetric='true'") + << convertDelimToXMLEscape(left_) + << ETagInline("mo"); + } + ms << cell(0); + if (!right_.empty() && ((right_.size() == 1 && right_[0] != ' ') || right_.size() > 1)) { + ms << MTagInline("mo", "form='postfix' fence='true' stretchy='true' symmetric='true'") + << convertDelimToXMLEscape(right_) + << ETagInline("mo") + << ETag("mrow"); + } } diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index f6f2f95b0a..b0ff55bc4d 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -768,15 +768,20 @@ void InsetMathBinom::mathmlize(MathMLStream & ms) const rdelim = ']'; break; } - ms << MTagInline("mo", "fence='true' stretchy='true' form='prefix'") - << ldelim - << ETagInline("mo") - << MTagInline("mfrac", "linethickness='0'") + + if (ldelim != ' ') { + ms << MTagInline("mo", "fence='true' stretchy='true' form='prefix'") + << ldelim + << ETagInline("mo"); + } + ms << MTagInline("mfrac", "linethickness='0'") << cell(0) << cell(1) - << ETagInline("mfrac") - << MTagInline("mo", "fence='true' stretchy='true' form='postfix'") - << rdelim - << ETagInline("mo"); + << ETagInline("mfrac"); + if (rdelim != ' ') { + ms << MTagInline("mo", "fence='true' stretchy='true' form='postfix'") + << rdelim + << ETagInline("mo"); + } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Extract vert, langle, rangle in MathExtern like parentheses and brackets.
commit 9e6b810b37f28499a5573468ae61d68be0bb2e75 Author: Thibaut Cuvelier Date: Mon Mar 11 01:22:12 2024 +0100 Extract vert, langle, rangle in MathExtern like parentheses and brackets. This patch is part of a series that aims at solving https://www.lyx.org/trac/ticket/12891. It is an excerpt of the patch that lynx published at https://www.lyx.org/trac/ticket/12270. --- src/mathed/MathExtern.cpp | 67 ++- 1 file changed, 54 insertions(+), 13 deletions(-) diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index b07c08b56e..e273aac791 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -292,6 +292,19 @@ bool testString(MathAtom const & at, char const * const str) return testString(at, from_ascii(str)); } + +bool testSymbol(MathAtom const & at, docstring const & name) +{ + return at->asSymbolInset() && at->asSymbolInset()->name() == name; +} + + +bool testSymbol(MathAtom const & at, char const * const name) +{ + return testSymbol(at, from_ascii(name)); +} + + // search end of nested sequence MathData::iterator endNestSearch( MathData::iterator it, @@ -523,12 +536,52 @@ MathAtom replaceBracketDelims(const MathData & ar) } -// replace '('...')' and '['...']' sequences by a real InsetMathDelim +bool testOpenVert(MathAtom const & at) +{ + return testSymbol(at, "lvert"); +} + + +bool testCloseVert(MathAtom const & at) +{ + return testSymbol(at, "rvert"); +} + + +MathAtom replaceVertDelims(const MathData & ar) +{ + return MathAtom(new InsetMathDelim(const_cast(ar.buffer()), + from_ascii("lvert"), from_ascii("rvert"), ar, true)); +} + + +bool testOpenAngled(MathAtom const & at) +{ + return testSymbol(at, "langle"); +} + + +bool testCloseAngled(MathAtom const & at) +{ + return testSymbol(at, "rangle"); +} + + +MathAtom replaceAngledDelims(const MathData & ar) +{ + return MathAtom(new InsetMathDelim(const_cast(ar.buffer()), + from_ascii("langle"), from_ascii("rangle"), ar, true)); +} + + +// replace '('...')', '['...']', '|'...'|', and '<'...'>' sequences by a real InsetMathDelim void extractDelims(MathData & ar) { //lyxerr << "\nDelims from: " << ar << endl; replaceNested(ar, testOpenParen, testCloseParen, replaceParenDelims); replaceNested(ar, testOpenBracket, testCloseBracket, replaceBracketDelims); + replaceNested(ar, testOpenVert, testCloseVert, replaceVertDelims); + replaceNested(ar, testOpenAngled, testCloseAngled, replaceAngledDelims); //lyxerr << "\nDelims to: " << ar << endl; } @@ -622,18 +675,6 @@ void extractFunctions(MathData & ar, ExternalMath kind) // search integrals // -bool testSymbol(MathAtom const & at, docstring const & name) -{ - return at->asSymbolInset() && at->asSymbolInset()->name() == name; -} - - -bool testSymbol(MathAtom const & at, char const * const name) -{ - return testSymbol(at, from_ascii(name)); -} - - bool testIntSymbol(MathAtom const & at) { return testSymbol(at, from_ascii("int")); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Improve const correctness.
commit b1a4eb118cd3d271a35b2260cde077e21c62c32c Author: Thibaut Cuvelier Date: Mon Mar 11 01:15:48 2024 +0100 Improve const correctness. --- src/mathed/MathExtern.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index d101904e83..b07c08b56e 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -295,7 +295,7 @@ bool testString(MathAtom const & at, char const * const str) // search end of nested sequence MathData::iterator endNestSearch( MathData::iterator it, - MathData::iterator last, + const MathData::iterator& last, TestItemFunc testOpen, TestItemFunc testClose ) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Memorise whether delims are extracted from MathExtern.
commit 93444892c504fdd7b8fdfbc7f2bf67f9b250eb82 Author: Thibaut Cuvelier Date: Mon Mar 11 01:07:25 2024 +0100 Memorise whether delims are extracted from MathExtern. This patch is part of a series that aims at solving https://www.lyx.org/trac/ticket/12891. It should not change any output. --- src/mathed/InsetMathDelim.cpp | 12 ++-- src/mathed/InsetMathDelim.h | 6 ++ src/mathed/MathExtern.cpp | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index 486ed97580..78d26fceea 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -45,13 +45,21 @@ static docstring convertDelimToLatexName(docstring const & name) InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l, docstring const & r) - : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0) + : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0), is_extracted_(false) {} InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l, docstring const & r, MathData const & ar) - : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0) + : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0), is_extracted_(false) +{ + cell(0) = ar; +} + + +InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l, docstring const & r, + MathData const & ar, bool const is_extracted) + : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0), is_extracted_(is_extracted) { cell(0) = ar; } diff --git a/src/mathed/InsetMathDelim.h b/src/mathed/InsetMathDelim.h index cad8da49de..3d8bd2ce36 100644 --- a/src/mathed/InsetMathDelim.h +++ b/src/mathed/InsetMathDelim.h @@ -27,6 +27,9 @@ public: InsetMathDelim(Buffer * buf, docstring const & left, docstring const & right, MathData const &); /// + InsetMathDelim(Buffer * buf, docstring const & left, docstring const & right, + MathData const &, bool const is_extracted); + /// InsetMathDelim * asDelimInset() override { return this; } /// InsetMathDelim const * asDelimInset() const override { return this; } @@ -73,6 +76,9 @@ private: Inset * clone() const override; /// mutable int dw_; + /// Is it extracted by MathExtern routines? They try to extract as much + /// semantics from a raw LaTeX formula in terms of LyX insets. + bool const is_extracted_; }; } // namespace lyx diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index 22124cc13d..d101904e83 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -500,7 +500,7 @@ bool testCloseParen(MathAtom const & at) MathAtom replaceParenDelims(const MathData & ar) { return MathAtom(new InsetMathDelim(const_cast(ar.buffer()), - from_ascii("("), from_ascii(")"), ar)); + from_ascii("("), from_ascii(")"), ar, true)); } @@ -519,7 +519,7 @@ bool testCloseBracket(MathAtom const & at) MathAtom replaceBracketDelims(const MathData & ar) { return MathAtom(new InsetMathDelim(const_cast(ar.buffer()), - from_ascii("["), from_ascii("]"), ar)); + from_ascii("["), from_ascii("]"), ar, true)); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Reduce code duplication.
commit 1680eaf5f0edeed089e2bdc2b539b80187b88d3c Author: Thibaut Cuvelier Date: Sun Mar 10 16:55:12 2024 +0100 Reduce code duplication. --- src/mathed/MathExtern.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index daf171981f..22124cc13d 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -630,7 +630,7 @@ bool testSymbol(MathAtom const & at, docstring const & name) bool testSymbol(MathAtom const & at, char const * const name) { - return at->asSymbolInset() && at->asSymbolInset()->name() == from_ascii(name); + return testSymbol(at, from_ascii(name)); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] MathML: consider ordinary and alphabetical characters as identifiers instead of operators.
commit 011c3d73c0c3137dcd67bf8bb09644ac064b2342 Author: Thibaut Cuvelier Date: Sat Mar 9 20:59:12 2024 +0100 MathML: consider ordinary and alphabetical characters as identifiers instead of operators. The goal is to consider all Greek letters as identifiers instead of operators. Solves: https://www.lyx.org/trac/ticket/12948. --- .../export/docbook/mathml_greek_operators.lyx | 112 + .../export/docbook/mathml_greek_operators.xml | 20 src/mathed/MathParser.cpp | 4 +- 3 files changed, 135 insertions(+), 1 deletion(-) diff --git a/autotests/export/docbook/mathml_greek_operators.lyx b/autotests/export/docbook/mathml_greek_operators.lyx new file mode 100644 index 00..f7d2ce --- /dev/null +++ b/autotests/export/docbook/mathml_greek_operators.lyx @@ -0,0 +1,112 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass article +\use_default_options true +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Title +MathML: + all Greek letters are symbols, + none of them is an operator +\end_layout + +\begin_layout Standard +Issue: + https://www.lyx.org/trac/ticket/12948 +\end_layout + +\begin_layout Standard +\begin_inset Formula +\[ +1\alpha2\Xi3 +\] + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/autotests/export/docbook/mathml_greek_operators.xml b/autotests/export/docbook/mathml_greek_operators.xml new file mode 100644 index 00..c5fc17c0b8 --- /dev/null +++ b/autotests/export/docbook/mathml_greek_operators.xml @@ -0,0 +1,20 @@ + + +http://docbook.org/ns/docbook; xmlns:xlink="http://www.w3.org/1999/xlink; xmlns:m="http://www.w3.org/1998/Math/MathML; xmlns:xi="http://www.w3.org/2001/XInclude; version="5.2"> +MathML: all Greek letters are symbols, none of them is an operator +Issue: https://www.lyx.org/trac/ticket/12948 + +1\alpha2\Xi3 + + + + 1 + + 2 + + 3 + + + + \ No newline at end of file diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index e94b6cea32..9b43da8cdd 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -2141,8 +2141,10 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags, // FIXME This will likely need some work. char const * latexkeys::MathMLtype() const { - if (extra == "mathord") + // Consider as identifier (mml:mi): ordinary and alphabetical characters. + if (extra == "mathord" || extra == "mathalpha") return "mi"; + // Consider as operators (mml:mo): everything else. return "mo"; } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Simplify a loop with a for-each.
commit 1b11dfeca5c4e11585129221d966e84c5c775402 Author: Thibaut Cuvelier Date: Sat Mar 9 20:46:54 2024 +0100 Simplify a loop with a for-each. These loops were brought by C++11. The next step could be using std::any_of. --- src/mathed/MathSupport.cpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index 57e8c6ee4e..585320f11a 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -1070,10 +1070,10 @@ bool isAlphaSymbol(MathAtom const & at) if (at->asFontInset()) { MathData const & ar = at->asFontInset()->cell(0); - for (size_t i = 0; i < ar.size(); ++i) { - if (!(ar[i]->asCharInset() || - (ar[i]->asSymbolInset() && - ar[i]->asSymbolInset()->isOrdAlpha( + for (const auto & i : ar) { + if (!(i->asCharInset() || + (i->asSymbolInset() && + i->asSymbolInset()->isOrdAlpha( return false; } return true; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
Re: DocBook tests failing AASTeX changes
On Fri, 8 Mar 2024 at 19:01, Scott Kostyshak wrote: > On Fri, Mar 08, 2024 at 06:58:35PM +0100, Thibaut Cuvelier wrote: > > On Fri, 8 Mar 2024 at 18:39, Scott Kostyshak wrote: > > > > > I get 2 out of 3 failing tests with the following: > > > > > > ctest -R "American_Astronomical_Society_.*docbook5" > > > > > > The failing tests: > > > > > > 3606 - > > > > export/examples/Articles/American_Astronomical_Society_%28AASTeX_v._6.3.1%29_docbook5 > > > (Failed) > > > 6401 - > > > > export/templates/Articles/American_Astronomical_Society_%28AASTeX_v._6.3.1%29_docbook5 > > > (Failed) > > > > > > For example, I see in the log the following: > > > > > > -- Calling: /usr/bin/xmllint --loaddtd --noout > > > > "/home/scott/lyxbuilds/master-master/CMakeBuild/autotests/out-home/AbC_ykbINP/templates/Articles/American_Astronomical_Society_%28AASTeX_v._6. > > > 3.1%29.xml" > > > -- Errors from xmllint: > > > > templates/Articles/American_Astronomical_Society_%28AASTeX_v._6.3.1%29.xml:6: > > > parser error : Specification mandates value for attribute Author > > > > > > ^ > > > > templates/Articles/American_Astronomical_Society_%28AASTeX_v._6.3.1%29.xml:8: > > > parser error : expected '>' > > > > > > ^ > > > > > > > > It doesn't sound super hard to fix, I'll try to do it this week-end. > > Thanks! > Scott > Your errors were quite strange, I couldn't reproduce them :/. (Is reconfiguration required also to run the tests?) I fixed a layout for AASTeX, though; the result is still far from perfect, but it's a very good starting point for DocBook processing (i.e. the ePub output will have problems). Like the previous version, the tests are inverted (04beccca4c). -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
[LyX/master] DocBook: add missing mapping for AASTeX 6.3.
commit 04beccca4c7170273748e14827b8af62e5726b25 Author: Thibaut Cuvelier Date: Sat Mar 9 15:09:45 2024 +0100 DocBook: add missing mapping for AASTeX 6.3. The result is far from perfect, see the TODOs. The corresponding tests are still inverted. --- development/autotests/invertedTests | 2 ++ lib/layouts/aastex6.layout | 9 - lib/layouts/aastex62.layout | 12 +++- lib/layouts/aastex63.layout | 16 +--- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/development/autotests/invertedTests b/development/autotests/invertedTests index c88e67cda5..ec366b9745 100644 --- a/development/autotests/invertedTests +++ b/development/autotests/invertedTests @@ -412,6 +412,8 @@ export/doc(|/de|/es|/fr|/ja|/ru)/Additional_docbook5 # - AASTeX. export/export/docbook/bibliography_precooked_aastex_docbook5 export/(examples|templates)/Articles/American_Astronomical_Society_%28AASTeX_v._6.2%29_docbook5 +export/(examples|templates)/Articles/American_Astronomical_Society_%28AASTeX_v._6.3%29_docbook5 +export/(examples|templates)/Articles/American_Astronomical_Society_%28AASTeX_v._6.3.1%29_docbook5 # - Springer. (The svmono_light should still pass.) export/templates/Books/Springer.*/.*_docbook5 !export/export/docbook/svmono_light_docbook5 diff --git a/lib/layouts/aastex6.layout b/lib/layouts/aastex6.layout index c6ab5ea03f..3ae8486cce 100644 --- a/lib/layouts/aastex6.layout +++ b/lib/layouts/aastex6.layout @@ -44,7 +44,14 @@ # # TODO: - support for new commands (see below) # - aastex6.cls loads hyperref (with pre-set options) and url -# -> option clash if "Use Hyerref" is selected in Document>Settings +# -> option clash if "Use Hyperref" is selected in Document>Settings +# - in DocBook, the appendix is not output (not a standard LyX appendix +# separator (needs a layout update) +# - in DocBook, the "Software" part should really be a section on its own, +# but that would require a way to provide the section title within the +# layout (needs a layout update) +# - in DocBook, the table notes are not supported at all (move the remarks +# into the table cells instead of outputting tablenotemark in the cells?) Format 104 diff --git a/lib/layouts/aastex62.layout b/lib/layouts/aastex62.layout index 5080cc06e8..5bfc03111e 100644 --- a/lib/layouts/aastex62.layout +++ b/lib/layouts/aastex62.layout @@ -48,7 +48,14 @@ # # TODO: - support for new commands (see below) # - aastex6.cls loads hyperref (with pre-set options) and url -# -> option clash if "Use Hyerref" is selected in Document>Settings +# -> option clash if "Use Hy^perref" is selected in Document>Settings +# - in DocBook, the appendix is not output (not a standard LyX appendix +# separator (needs a layout update) +# - in DocBook, the "Software" part should really be a section on its own, +# but that would require a way to provide the section title within the +# layout (needs a layout update) +# - in DocBook, the table notes are not supported at all (move the remarks +# into the table cells instead of outputting tablenotemark in the cells?) Format 104 @@ -231,6 +238,9 @@ Style Acknowledgments LabelFont Color textlabel2 EndFont + DocBookTag para + DocBookWrapperTag acknowledgements + DocBookSection true End Counter appendix diff --git a/lib/layouts/aastex63.layout b/lib/layouts/aastex63.layout index e2438986d7..e94d490e91 100644 --- a/lib/layouts/aastex63.layout +++ b/lib/layouts/aastex63.layout @@ -52,9 +52,16 @@ ## # TODO: - support for new commands (see below) # - aastex6.cls loads hyperref (with pre-set options) and url -# -> option clash if "Use Hyerref" is selected in Document>Settings +# -> option clash if "Use Hyperref" is selected in Document>Settings # support for new commands in aastex 6.3 and aastex 6.31 versions # string freeze for lyx-2.4.0, must be done for lyx-2.4.1 +# - in DocBook, the appendix is not output (not a standard LyX appendix +# separator (needs a layout update) +# - in DocBook, the "Software" part should really be a section on its own, +# but that would require a way to provide the section title within the +# layout (needs a layout update) +# - in DocBook, the table notes are not supported at all (move the remarks +# into the table cells instead of outputting tablenotemark in the cells?) Format 104 @@ -232,11 +239,14 @@ Style Acknowledgments Font Shape Up EndFont - LabelType Above - Margin Static + LabelType Above +
[LyX/master] DocBook: amend e3020a6b.
commit 5c5765061fa1ce1b829c1b1dad05d3fc8d879079 Author: Thibaut Cuvelier Date: Fri Mar 1 13:45:28 2024 +0100 DocBook: amend e3020a6b. Book authorship and authorship can be quite distinct. As far as I know, there is no standard way to represent book authorship in DocBook bibliographies. --- autotests/export/docbook/basic.xml | 9 - src/BiblioInfo.cpp | 15 --- src/BiblioInfo.h | 5 - src/insets/InsetBibtex.cpp | 32 +--- 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/autotests/export/docbook/basic.xml b/autotests/export/docbook/basic.xml index cafbe46547..82bec18b72 100644 --- a/autotests/export/docbook/basic.xml +++ b/autotests/export/docbook/basic.xml @@ -424,7 +424,14 @@ I am no more code. - + + + +Michel +Foucault + + + A small paper diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index 0f697ab297..253fb3759c 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -1748,13 +1748,19 @@ string citationStyleToString(const CitationStyle & cs, bool const latex) } -void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf) +void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf, + const std::string type) { // This function closely mimics getAuthorList, but produces DocBook instead of text. // It has been greatly simplified, as the complete list of authors is always produced. No separators are required, // as the output has a database-like shape. // constructName has also been merged within, as it becomes really simple and leads to no copy-paste. + if (! type.empty() && (type != "author" && type != "book")) { + LYXERR0("ERROR! Unexpected author contribution `" << type <<"'."); + return; + } + if (authorsString.empty()) { return; } @@ -1772,7 +1778,10 @@ void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs auto it = authors.cbegin(); auto en = authors.cend(); for (size_t i = 0; it != en; ++it, ++i) { - xs << xml::StartTag("author"); + const std::string tag = (type.empty() || type == "author") ? "author" : "othercredit"; + const std::string attr = (type == "book") ? R"(class="other" otherclass="bookauthor")" : ""; + + xs << xml::StartTag(tag, attr); xs << xml::CR(); xs << xml::StartTag("personname"); xs << xml::CR(); @@ -1812,7 +1821,7 @@ void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs xs << xml::EndTag("personname"); xs << xml::CR(); - xs << xml::EndTag("author"); + xs << xml::EndTag(tag); xs << xml::CR(); // Could add an affiliation after , but not stored in BibTeX. diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h index 7a8ffb9081..aeaf0fcecc 100644 --- a/src/BiblioInfo.h +++ b/src/BiblioInfo.h @@ -37,7 +37,10 @@ CitationStyle citationStyleFromString(std::string const & latex_str, std::string citationStyleToString(CitationStyle const &, bool const latex = false); /// Transforms the information about authors into a (directly written to a XMLStream). -void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf); +/// Type: "author" or empty means author of the entry (article, book, etc.); "book" means author of the book +/// (but not necessarily of this entry in particular). +void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf, +std::string type); /// Class to represent information about a BibTeX or diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index b4bf535014..d452434ab5 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -1402,29 +1402,15 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const // // Example: http://tdg.docbook.org/tdg/5.1/authorgroup.html - if (hasTag("fullnames:author") || hasTag("fullbynames:bookauthor")) { - // If several author tags are present, only output one.
[LyX/master] DocBook: authorsToDocBookAuthorGroup never needs to return anything.
commit 3973bbcf9915ad16cdd7dec3c20bd2f722dfb52e Author: Thibaut Cuvelier Date: Fri Mar 1 13:32:17 2024 +0100 DocBook: authorsToDocBookAuthorGroup never needs to return anything. --- src/BiblioInfo.cpp | 11 +-- src/BiblioInfo.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index a9245c6a77..0f697ab297 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -1748,7 +1748,7 @@ string citationStyleToString(const CitationStyle & cs, bool const latex) } -docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf) +void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf) { // This function closely mimics getAuthorList, but produces DocBook instead of text. // It has been greatly simplified, as the complete list of authors is always produced. No separators are required, @@ -1756,7 +1756,7 @@ docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream // constructName has also been merged within, as it becomes really simple and leads to no copy-paste. if (authorsString.empty()) { - return docstring(); + return; } // Split the input list of authors into individual authors. @@ -1776,9 +1776,10 @@ docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream xs << xml::CR(); xs << xml::StartTag("personname"); xs << xml::CR(); - docstring name = *it; + const docstring name = *it; - // All authors go in a . If more structure is known, use it; otherwise (just "et al."), print it as such. + // All authors go in a . If more structure is known, use it; otherwise (just "et al."), + // print it as such. if (name == "others") { xs << buf.B_(etal); } else { @@ -1818,8 +1819,6 @@ docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream } xs << xml::EndTag("authorgroup"); xs << xml::CR(); - - return docstring(); } } // namespace lyx diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h index f4051bf225..7a8ffb9081 100644 --- a/src/BiblioInfo.h +++ b/src/BiblioInfo.h @@ -37,7 +37,7 @@ CitationStyle citationStyleFromString(std::string const & latex_str, std::string citationStyleToString(CitationStyle const &, bool const latex = false); /// Transforms the information about authors into a (directly written to a XMLStream). -docstring authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf); +void authorsToDocBookAuthorGroup(docstring const & authorsString, XMLStream & xs, Buffer const & buf); /// Class to represent information about a BibTeX or -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] DocBook: support bookauthor in bibliographies.
commit e3020a6b2d240d0e1ae2aec8dfd754f6cd64dee1 Author: Thibaut Cuvelier Date: Fri Mar 1 12:55:40 2024 +0100 DocBook: support bookauthor in bibliographies. --- autotests/export/docbook/basic.bib | 11 +++ autotests/export/docbook/basic.lyx | 2 +- autotests/export/docbook/basic.xml | 31 +-- src/insets/InsetBibtex.cpp | 25 ++--- 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/autotests/export/docbook/basic.bib b/autotests/export/docbook/basic.bib index 88a9fe7b14..b106326c4d 100644 --- a/autotests/export/docbook/basic.bib +++ b/autotests/export/docbook/basic.bib @@ -107,3 +107,14 @@ volume = {MCMXCVII}, month= 7, note = {An optional note} } + +@incollection{Foucault:Kritik-EN92, +author = {Foucault, Michel}, +title = {What is Critique?}, +bookauthor = {Foucault, Michel}, +booktitle = {The Politics of Truth}, +pages = {41-82}, +publisher = {Semiotext(e)}, +address = {Los Angeles}, +year = {1997} +} diff --git a/autotests/export/docbook/basic.lyx b/autotests/export/docbook/basic.lyx index d1078b9721..83b907fb54 100644 --- a/autotests/export/docbook/basic.lyx +++ b/autotests/export/docbook/basic.lyx @@ -876,7 +876,7 @@ Many things, \begin_inset CommandInset citation LatexCommand cite -key "article,book,booklet,conference,inbook,incollection" +key "article,book,booklet,conference,inbook,incollection,Foucault:Kritik-EN92" literal "false" \end_inset diff --git a/autotests/export/docbook/basic.xml b/autotests/export/docbook/basic.xml index 2248a2cbf4..cafbe46547 100644 --- a/autotests/export/docbook/basic.xml +++ b/autotests/export/docbook/basic.xml @@ -264,7 +264,7 @@ I am no more code. I am the sixth section and I really like bibliographies This text has references. First reference: . Second reference: . Both at the same time: , . A book: . -Many things, just testing for completeness: , , , , , . +Many things, just testing for completeness: , , , , , , . I am the seventh section and I deal with indices @@ -358,12 +358,17 @@ I am no more code. The title of the work +4 +3 201-213 inbook The name of the publisher - +The address of the publisher 1993 + + + @@ -372,6 +377,7 @@ I am no more code. +An optional note The title of the work @@ -399,6 +405,27 @@ I am no more code. An optional note + +What is Critique? +41-82 +incollection + +Semiotext(e) +Los Angeles +1997 + +The Politics of Truth + + + + +Michel +Foucault + + + + + A small paper -1 diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 2e6f7f7fb7..b4bf535014 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -1142,6 +1142,7 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const // Store the mapping between BibTeX and DocBook. map toDocBookTag; toDocBookTag["fullnames:author"] = "SPECIFIC"; // No direct translation to DocBook: . + toDocBookTag["fullbynames:bookauthor"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["publisher"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["address"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["editor"] = "SPECIFIC"; // No direct translation to DocBook: . @@ -1401,11 +1402,29 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const // // Example: http://tdg.docbook.org/tdg/5.1/authorgroup.html - if (hasTag("fullnames:author")) { + if (hasTag("fullnames:author") || hasTag("fullbynames:bookauthor")) { + // If several author tags are present, only output one. + const docstring authorName = getTag( + hasTag("fullnames:author") ? "fullnames:author" : "fullbynames:bookauthor"); + // Perform full parsing of the BibTeX string, dealing with the many corner cases that might // be encountered. - authorsToDocBookAuthorGroup(getTag("fullnames:author"), xs, buffer()); - eraseTag("fullnames:author"); + authorsToDocBookAuthorGroup(authorName, xs, buffer()); + + if (hasTag("fullnames:author") && hasTag("fullbynames:bookauthor")) { + xs << XMLStream::ESCAPE_NONE << + from_utf8(
[LyX/master] Amend 8e0bc01d
commit 27c01ee1d37e979f044329bcf07b9e910ed2b7ad Author: Thibaut Cuvelier Date: Tue Feb 27 00:45:10 2024 +0100 Amend 8e0bc01d std::set::find only appeared in C++20. Rather use std::set::find for compatibility. --- src/insets/InsetBibtex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 8a2a697648..2e6f7f7fb7 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -1220,7 +1220,7 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const if (docbookTag == "SPECIFIC") { delayedTags[match[1]] = match[2]; } else { - if (alreadyOutputDocBookTags.contains(docbookTag)) { + if (alreadyOutputDocBookTags.find(docbookTag) != alreadyOutputDocBookTags.end()) { xs << XMLStream::ESCAPE_NONE << from_utf8("
Re: Fwd: DocBook test now failing on master
On Mon, 26 Feb 2024 at 16:00, Scott Kostyshak wrote: > On Mon, Feb 26, 2024 at 03:07:12PM +0100, Thibaut Cuvelier wrote: > > On Mon, 26 Feb 2024 at 10:46, wrote: > > > > > Thank you so much, Thibaut. > > > > > > Could you send the patch to lyx-devel, so Scott can test it? I am too > > > unsure about all things docbook to judge. > > > > > > > I tried sending it to the mailing list, but my emails from my @lyx.org > > alias are still refused :/. > > > > > > > I will submit the bookauthor change this evening when I am back at my > > > home machine. > > > > > > > I didn't really test bookauthor, not knowing exactly what you had in mind > > (the code for authors is more complex that I thought). > > > > @Scott: I have just pushed a fix for the initial issue! I tested it on > the > > basic test case, it seems to work (as tested with my usual DocBook setup, > > which is not identical to LyX tests, but hopefully close enough). > > Thanks for working on a fix. Did you run jing on it? I still get the > following after pulling in your fix: > > -- Calling: /usr/bin/java -jar > "/home/scott/lyxbuilds/master-master/repo/development/tools/jing.jar" " > https://docbook.org/xml/5.2b09/rng/docbook.rng; "/home/ > scott/lyxbuilds/master-master/CMakeBuild/autotests/out-home/AbC_ZafZvY/export/docbook/basic.xml" > -- _err = 1, jingout = > /home/scott/lyxbuilds/master-master/CMakeBuild/autotests/out-home/AbC_ZafZvY/export/docbook/basic.xml:379:1: > error: text not allowed here; expected the element end-tag, element > "abbrev", "abstract", "acronym", "address", "annotation", "artpagenums", > "author", "authorgroup", "authorinitials", > "bibliocoverage", "biblioid", "bibliomisc", "bibliomset", "bibliorelation", > "biblioset", "bibliosource", "citebiblioid", "citerefentry", > "citetitle", "collab", "confgroup", "contractnum", "contractsponsor", > "copyright", "coref", "cover", "date", "edition", "editor", "emphasis", > "extendedlink", "firstterm", "footnote", "footnoteref", "foreignphrase", > "glossterm", "issuenum", "itermset", "keywordset", "legalnotice", > "mediaobject", "org", "orgname", "othercredit", "pagenums", "person", > "personblurb", "personname", "phrase", "printhistory", "productname", > "productnumber", "pubdate", "publisher", "publishername", > "quote", "releaseinfo", "revhistory", "revnumber", "seriesvolnums", > "subjectset", "subscript", "subtitle", "superscript", "title", > "titleabbrev", "volumenum" or "wordasword" or an element from another > namespace > I had trouble replicating this one locally, it should no longer appear as of 2be72a15. -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
[LyX/master] DocBook: in a table, fix a typo in a condition.
commit baccce7d2de92dcf57eb2afa8492e56a4805b1af Author: Thibaut Cuvelier Date: Mon Feb 26 16:09:26 2024 +0100 DocBook: in a table, fix a typo in a condition. Before this patch, all table cells had a semicolon at the beginning of their style: + Table 1 - + Table 2 - + Table 3 - + Row 1 - - + + Col 3, row 1 - + Row 2 - - + + Col 3, row 2 @@ -187,31 +187,31 @@ I am no more code. I am a table caption above the table. - + Table 1 - + Table 2 - + Table 3 - + Row 1 - - + + Col 3, row 1 - + Row 2 - - + + Col 3, row 2 @@ -220,31 +220,31 @@ I am no more code. - + Table that has no caption 1 - + Table that has no caption 2 - + Table that has no caption 3 - + Row 1 - - + + Col 3, row 1 - + Row 2 - - + + Col 3, row 2 diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 9b4f175f74..5242775e7f 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3842,7 +3842,7 @@ docstring Tabular::xmlRow(XMLStream & xs, const row_type row, OutputParams const const std::vector styles = computeCssStylePerCell(row, c, cell); std::string attr_str_prefix = "style='" + style.str(); - if (!styles.empty()) + if (!style.str().empty()) attr_str_prefix += "; "; for (auto it = styles.begin(); it != styles.end(); ++it) { attr_str_prefix += *it; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] DocBook: when a similar tag is present multiple times in the bibliography entry, output it only once.
commit 8e0bc01d50fc7d7af454cb8bed4d098f85b3f73b Author: Thibaut Cuvelier Date: Mon Feb 26 16:04:22 2024 +0100 DocBook: when a similar tag is present multiple times in the bibliography entry, output it only once. Other copies have an error message. --- autotests/export/docbook/basic.xml | 32 +++ src/insets/InsetBibtex.cpp | 80 ++ 2 files changed, 68 insertions(+), 44 deletions(-) diff --git a/autotests/export/docbook/basic.xml b/autotests/export/docbook/basic.xml index 87c951f359..c03a26c12d 100644 --- a/autotests/export/docbook/basic.xml +++ b/autotests/export/docbook/basic.xml @@ -1,5 +1,5 @@ - http://docbook.org/ns/docbook; xmlns:xlink="http://www.w3.org/1999/xlink; xmlns:m="http://www.w3.org/1998/Math/MathML; xmlns:xi="http://www.w3.org/2001/XInclude; version="5.2"> @@ -67,30 +67,8 @@ - - - I - a - m - a - f - o - r - m - u - l - a - w - i - t - h - a - r - e - f - . - - + Iamaformulawitharef + . (1) @@ -285,8 +263,8 @@ I am no more code. I am the sixth section and I really like bibliographies -This text has references. First reference: . Second reference: . Both at the same time: , . A book: . -Many things, just testing for completeness: , , , , , . +This text has references. First reference: . Second reference: . Both at the same time: , . A book: . +Many things, just testing for completeness: , , , , , . I am the seventh section and I deal with indices diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 6d38631f81..8a2a697648 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -1128,7 +1128,6 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const make_pair("url", "uri") }; // Relations between documents. - // TODO: some elements should be mutually exclusive; right now, all of them are output. vector> relations = { // make_pair("journal", "journal"), make_pair("journaltitle", "journal"), @@ -1149,7 +1148,6 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const toDocBookTag["fullbynames:editor"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["institution"] = "SPECIFIC"; // No direct translation to DocBook: . - // TODO: some elements should be mutually exclusive; right now, all of them are output. toDocBookTag["title"] = "title"; toDocBookTag["fulltitle"] = "title"; toDocBookTag["quotetitle"] = "title"; @@ -1162,7 +1160,6 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const toDocBookTag["year"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["month"] = "SPECIFIC"; // No direct translation to DocBook: . - // TODO: some elements should be mutually exclusive; right now, all of them are output. toDocBookTag["journal"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["journaltitle"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["fulljournaltitle"] = "SPECIFIC"; // No direct translation to DocBook: . @@ -1210,22 +1207,35 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const map delayedTags; // Read all tags from HTML and convert those that have a 1:1 matching. + // Avoid outputting the same tag twice in DocBook: several bibliography tags might map to the same DocBook + // element, avoid outputting the same DocBook tag twice to keep a valid output. "SPECIFIC" tags are handled in + // a more specific way later on (among the delayed tags). + set alreadyOutputDocBookTags; while (tagIt != tagEnd) { string tag = tagIt->str(); // regex_match cannot work with temporary strings. ++tagIt; if (regex_match(tag, match, tagRegex)) { - if (toDocBookTag[match[1]] == "SPECIFIC") { + const string docbookTag = toDocBookTag[match[1]]; + if (docbookTag == "SPECIFIC") { delayedTags[match[1]] = match[2]; } else { - xs << xml::StartTag(toDocBookTag[match[1]]); -
[LyX/master] DocBook: in bibliographies, fix support for editors.
commit 2be72a1534af143bda34b382189198667c10136b Author: Thibaut Cuvelier Date: Mon Feb 26 15:50:12 2024 +0100 DocBook: in bibliographies, fix support for editors. Also, add TODOs for similar problems lurking around. --- autotests/export/docbook/basic.xml | 57 +++--- src/insets/InsetBibtex.cpp | 38 - 2 files changed, 65 insertions(+), 30 deletions(-) diff --git a/autotests/export/docbook/basic.xml b/autotests/export/docbook/basic.xml index b589ee63b9..87c951f359 100644 --- a/autotests/export/docbook/basic.xml +++ b/autotests/export/docbook/basic.xml @@ -1,7 +1,7 @@ -http://docbook.org/ns/docbook; xmlns:xlink="http://www.w3.org/1999/xlink; xmlns:m="http://www.w3.org/1998/Math/MathML; xmlns:xi="http://www.w3.org/2001/XInclude; version="5.2"> +http://docbook.org/ns/docbook; xmlns:xlink="http://www.w3.org/1999/xlink; xmlns:m="http://www.w3.org/1998/Math/MathML; xmlns:xi="http://www.w3.org/2001/XInclude; version="5.2"> I am a title @@ -24,43 +24,39 @@ - - - w - i - t - h - - a - - f - o - r - m - u - l - a - + + w + i + t + h + + a + + f + o + r + m + u + l + a . -Now, we're outside quotes. +Now, were outside quotes. Formula! - - F - o - r - m - u - l - a - ! - + F + o + r + m + u + l + a + ! @@ -420,6 +416,9 @@ I am no more code. + +The editor + An optional note diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index b073f619e6..6d38631f81 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -1128,6 +1128,7 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const make_pair("url", "uri") }; // Relations between documents. + // TODO: some elements should be mutually exclusive; right now, all of them are output. vector> relations = { // make_pair("journal", "journal"), make_pair("journaltitle", "journal"), @@ -1144,9 +1145,11 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const toDocBookTag["fullnames:author"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["publisher"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["address"] = "SPECIFIC"; // No direct translation to DocBook: . - toDocBookTag["editor"] = "editor"; + toDocBookTag["editor"] = "SPECIFIC"; // No direct translation to DocBook: . + toDocBookTag["fullbynames:editor"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["institution"] = "SPECIFIC"; // No direct translation to DocBook: . + // TODO: some elements should be mutually exclusive; right now, all of them are output. toDocBookTag["title"] = "title"; toDocBookTag["fulltitle"] = "title"; toDocBookTag["quotetitle"] = "title"; @@ -1159,6 +1162,7 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const toDocBookTag["year"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["month"] = "SPECIFIC"; // No direct translation to DocBook: . + // TODO: some elements should be mutually exclusive; right now, all of them are output. toDocBookTag["journal"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["journaltitle"] = "SPECIFIC"; // No direct translation to DocBook: . toDocBookTag["fulljournaltitle"] = "SPECIFIC"; // No direct translation to DocBook: . @@ -1359,6 +1363,38 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const eraseTag("fullnames:author"); } + // + // Example: http://tdg.docbook.org/tdg/5.1/editor.html + if (hasTag("editor") || hasTag("fullbynames:editor")) { + // If several editor tags are present, only output one. + const docstring editorName = getTag(hasTag("editor") ? "editor" : "fullbynames:editor"); + + // Arbitrarily decide that the editor is always a person. There is no reliable information in the input + // to make the distinction between a person () and an organisation (). + xs << xml::StartTag("editor"
[LyX/master] Use C++11 string literals to make code easier to read.
commit 6b1441036f35767c0b60af510222ba792b17b829 Author: Thibaut Cuvelier Date: Mon Feb 26 15:24:36 2024 +0100 Use C++11 string literals to make code easier to read. --- src/insets/InsetIndex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index 68669b0b7e..64bb398099 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -505,9 +505,9 @@ void InsetIndex::docbook(XMLStream & xs, OutputParams const & runparams) const // Generate the attributes. docstring id = xml::cleanID(newIndexTerms); if (hasStartRange) { - attrs = indexType + " class=\"startofrange\" xml:id=\"" + id + "\""; + attrs = indexType + R"( class="startofrange" xml:id=")" + id + "\""; } else { - attrs = " class=\"endofrange\" startref=\"" + id + "\""; + attrs = R"( class="endofrange" startref=")" + id + "\""; } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] DocBook: restore index ranges.
commit 3fdf3aafe8a2da25c10152c97e6e7824ace42e96 Author: Thibaut Cuvelier Date: Mon Feb 26 15:15:32 2024 +0100 DocBook: restore index ranges. --- src/insets/InsetIndex.cpp | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index 54058b8ea7..68669b0b7e 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -386,7 +386,10 @@ void InsetIndex::docbook(XMLStream & xs, OutputParams const & runparams) const } // Handle ranges. Happily, in the raw LaTeX mode, (| and |) can only be at the end of the string! - const bool hasInsetRange = params_.range != InsetIndexParams::PageRange::None; + // Handle both modern ranges (params_.range) and legacy ones (with a suffix |( or |) as in pure LaTeX). + const bool hasInsetRange = params_.range != InsetIndexParams::PageRange::None || + latexString.find(from_ascii("|(")) != lyx::docstring::npos || + latexString.find(from_ascii("|)")) != lyx::docstring::npos; const bool hasStartRange = params_.range == InsetIndexParams::PageRange::Start || latexString.find(from_ascii("|(")) != lyx::docstring::npos; const bool hasEndRange = params_.range == InsetIndexParams::PageRange::End || -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] DocBook: simplify building an error message.
commit 5dd36404f2234395aa709f3723607a485e464dbb Author: Thibaut Cuvelier Date: Mon Feb 26 15:09:10 2024 +0100 DocBook: simplify building an error message. --- src/insets/InsetIndex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index c7e88f0cd2..54058b8ea7 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -450,7 +450,7 @@ void InsetIndex::docbook(XMLStream & xs, OutputParams const & runparams) const // TODO: Could handle formatting as significance="preferred"? if (!command.empty()) { docstring error = from_utf8("Unsupported feature: an index entry contains a | with an unsupported command, ") - + command + from_utf8(". ") + from_utf8("Complete entry: \"") + latexString + from_utf8("\""); + + command + from_utf8(". Complete entry: \"") + latexString + from_utf8("\""); LYXERR0(error); xs << XMLStream::ESCAPE_NONE << (from_utf8("\n")); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] DocBook: update bibliography handling for 337f9534260.
commit c71f7039148ba112ed3d0e56b19bce063a04323a Author: Thibaut Cuvelier Date: Mon Feb 26 14:36:01 2024 +0100 DocBook: update bibliography handling for 337f9534260. --- autotests/export/docbook/basic.lyx | 129 - src/insets/InsetBibtex.cpp | 8 +++ 2 files changed, 105 insertions(+), 32 deletions(-) diff --git a/autotests/export/docbook/basic.lyx b/autotests/export/docbook/basic.lyx index 3c4a5b6fb0..d1078b9721 100644 --- a/autotests/export/docbook/basic.lyx +++ b/autotests/export/docbook/basic.lyx @@ -1,5 +1,5 @@ #LyX 2.4 created this file. For more info see https://www.lyx.org/ -\lyxformat 599 +\lyxformat 620 \begin_document \begin_header \save_transient_properties true @@ -57,6 +57,7 @@ \suppress_date false \justification true \use_refstyle 1 +\use_formatted_ref 0 \use_minted 0 \use_lineno 0 \index Index @@ -87,6 +88,7 @@ \html_css_as_file 0 \html_be_strict false \docbook_table_output 0 +\docbook_mathml_prefix 1 \end_header \begin_body @@ -147,7 +149,8 @@ I am a quote \end_layout \begin_layout Standard -Now, we're outside quotes. +Now, + we're outside quotes. \end_layout \begin_layout Standard @@ -177,6 +180,7 @@ reference "sec:Sec-2kqgsdiflhqsdlifgjuzer=povtuizmvnuer=t vmsrmfli uh =a'\"rtpf plural "false" caps "false" noprefix "false" +nolink "false" \end_inset @@ -184,8 +188,9 @@ noprefix "false" \end_layout \begin_layout Standard -Also, a formula with an user-defined macro that outputs well in LaTeX but - cannot in MathML: +Also, + a formula with an user-defined macro that outputs well in LaTeX but cannot in MathML: + \begin_inset Formula $\testmacro$ \end_inset @@ -268,6 +273,7 @@ reference "sec:Sec-1" plural "false" caps "false" noprefix "false" +nolink "false" \end_inset @@ -284,7 +290,8 @@ First item. \begin_inset Newline newline \end_inset -Second line of the first item, after a line break. +Second line of the first item, + after a line break. \end_layout @@ -365,7 +372,8 @@ I repeat that in a footnote. \end_layout \begin_layout Standard -On the other hand, +On the other hand, + \begin_inset Foot status open @@ -392,7 +400,9 @@ I am the fifth section and I deal with floats \end_layout \begin_layout Standard -Now, three tables: +Now, + three tables: + \end_layout \begin_layout Standard @@ -463,7 +473,8 @@ Row 1 \begin_inset Text \begin_layout Plain Layout -Col 3, row 1 +Col 3, + row 1 \end_layout \end_inset @@ -492,7 +503,8 @@ Row 2 \begin_inset Text \begin_layout Plain Layout -Col 3, row 2 +Col 3, + row 2 \end_layout \end_inset @@ -602,7 +614,8 @@ Row 1 \begin_inset Text \begin_layout Plain Layout -Col 3, row 1 +Col 3, + row 1 \end_layout \end_inset @@ -631,7 +644,8 @@ Row 2 \begin_inset Text \begin_layout Plain Layout -Col 3, row 2 +Col 3, + row 2 \end_layout \end_inset @@ -717,7 +731,8 @@ Row 1 \begin_inset Text \begin_layout Plain Layout -Col 3, row 1 +Col 3, + row 1 \end_layout \end_inset @@ -746,7 +761,8 @@ Row 2 \begin_inset Text \begin_layout Plain Layout -Col 3, row 2 +Col 3, + row 2 \end_layout \end_inset @@ -765,7 +781,9 @@ Col 3, row 2 \end_layout \begin_layout Standard -Then, one figure: +Then, + one figure: + \end_layout \begin_layout Standard @@ -809,7 +827,8 @@ I am the sixth section and I really like bibliographies \begin_layout Standard This text has references. - First reference: + First reference: + \begin_inset CommandInset citation LatexCommand cite key "big" @@ -818,7 +837,8 @@ literal "false" \end_inset . - Second reference: + Second reference: + \begin_inset CommandInset citation LatexCommand cite key "small" @@ -827,7 +847,8 @@ literal "false" \end_inset . - Both at the same time: + Both at the same time: + \begin_inset CommandInset citation LatexCommand cite key "big,small" @@ -836,7 +857,8 @@ literal "false" \end_inset . - A book: + A book: + \begin_inset CommandInset citation LatexCommand cite key "Gro60" @@ -849,7 +871,9 @@ literal "false" \end_layout \begin_layout Standard -Many things, just testing for completeness: +Many things, + just testing for completeness: + \begin_inset CommandInset citation LatexCommand cite key "article,book,booklet,conference,inbook,incollection" @@ -866,8 +890,12 @@ I am the seventh section and I deal with indices \end_layout \begin_layout Standard -First, a term to index: +First, + a term to index: + \begin_inset Index idx +range none +pageformat default status open \begin_layout Plain Layout @@ -877,8 +905,11 @@ Term to index \end_inset . - Then a term to add to the second index: + Then a term to add to the second index: + \begin_inset Index oth +range none +pageformat defa
[LyX/master] Update comment: a function was renamed.
commit e311606a30d0cbc3603a0187f68dd6a44fd402cd Author: Thibaut Cuvelier Date: Mon Feb 26 02:17:48 2024 +0100 Update comment: a function was renamed. --- src/insets/InsetBibitem.cpp | 2 +- src/output_docbook.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetBibitem.cpp b/src/insets/InsetBibitem.cpp index 82d8185200..6336da32d4 100644 --- a/src/insets/InsetBibitem.cpp +++ b/src/insets/InsetBibitem.cpp @@ -344,7 +344,7 @@ void InsetBibitem::updateBuffer(ParIterator const & it, UpdateType utype, bool c void InsetBibitem::docbook(XMLStream &, OutputParams const &) const { - // Nothing to do: everything is implemented in makeParagraphBibliography. + // Nothing to do: everything is implemented in makeBibliography. } diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp index 983d4e7bef..204fc430f7 100644 --- a/src/output_docbook.cpp +++ b/src/output_docbook.cpp @@ -382,7 +382,7 @@ void makeParagraph( TABULAR_CODE, FLOAT_CODE, BIBTEX_CODE, // Bibliographies cannot be in paragraphs. Bibitems should still be handled as paragraphs, - // though (see makeParagraphBibliography). + // though (see makeBibliography). ERT_CODE, // ERTs are in comments, not paragraphs. LISTINGS_CODE, BOX_CODE, -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[TYPES/announce] SYCO 12 - Call for Papers
[ The Types Forum (announcements only), http://lists.seas.upenn.edu/mailman/listinfo/types-announce ] - CALL FOR SUBMISSIONS TWELFTH SYMPOSIUM ON COMPOSITIONAL STRUCTURES (SYCO 12) Birmingham, UK 15-16 April, 2024 Submission deadline: Monday 11 March 2024 https://urldefense.com/v3/__https://www.cl.cam.ac.uk/events/syco/12/__;!!IBzWLUs!TEo1Wi92ZtWY15jBeTsrGo-myNOUy3CjDTwztqLUE5Mer5aizCtxNzak0BBhZlQTQ9_27OQjVninOgj_MujjsSJIm6GhKx0$ - The Symposium on Compositional Structures (SYCO) is an interdisciplinary series of meetings aiming to support the growing community of researchers interested in the phenomenon of compositionality, from both applied and abstract perspectives, and in particular where category theory serves as a unifying common language. Previous SYCO events have been held in Palaiseau, Birmingham, Strathclyde, Oxford, Chapman, Leicester, Tallinn, and Como. We welcome submissions from researchers across computer science, mathematics, physics, philosophy, and beyond, with the aim of fostering friendly discussion, disseminating new ideas, and spreading knowledge between fields. Submission is encouraged for both mature research and work in progress, and by both established academics and junior researchers, including students. Submissions is easy, with no formatting or page restrictions. The meeting does not have proceedings, so work can be submitted even if it has been submitted or published elsewhere. You could submit work-in-progress, or a recently completed paper, or even a PhD or Masters thesis. While no list of topics could be exhaustive, SYCO welcomes submissions with a compositional focus related to any of the following areas, in particular from the perspective of category theory: - logical methods in computer science, including classical and quantum programming, type theory, concurrency, natural language processing and machine learning; - graphical calculi, including string diagrams, Petri nets and reaction networks; - languages and frameworks, including process algebras, proof nets, type theory and game semantics; - abstract algebra and pure category theory, including monoidal category theory, higher category theory, operads, polygraphs, and relationships to homotopy theory; - quantum algebra, including quantum computation and representation theory; - tools and techniques, including rewriting, formal proofs and proof assistants, and game theory; - industrial applications, including case studies and real-world problem descriptions. IMPORTANT DATES === All deadlines are 23:59 Anywhere on Earth. Submission deadline: Monday 11 March, 2024 Author notification: Monday 18 March, 2024 Symposium dates: Monday 15 and Tuesday 16 April 2024 SUBMISSION INSTRUCTIONS === Submissions are by OpenReview, via the SYCO 12 submission page: https://urldefense.com/v3/__https://openreview.net/group?id=cl.cam.ac.uk*SYCO*2024*Symposium__;Ly8v!!IBzWLUs!TEo1Wi92ZtWY15jBeTsrGo-myNOUy3CjDTwztqLUE5Mer5aizCtxNzak0BBhZlQTQ9_27OQjVninOgj_MujjsSJIe__19Lw$ (be aware that you will need to create an account on OpenReview, which is automatic if you are using an academic e-mail address, but might take up to 2 weeks with a non-academic e-mail address) Submission is easy, with no format requirements or page restrictions. The meeting does not have proceedings, so work can be submitted even if it has been submitted or published elsewhere. Think creatively: you could submit a recent paper, or notes on work in progress, or even a recent Masters or PhD thesis. In the event that more good-quality submissions are received than can be accommodated in the timetable, the programme committee may choose to *defer* some submissions to a future meeting, rather than reject them. Deferred submissions can be re-submitted to any future SYCO meeting, where they will not need peer review, and where they will be prioritised for inclusion in the programme. Meetings will be held sufficiently frequently to avoid a backlog of deferred papers. If you have a submission which was deferred from a previous SYCO meeting, it will not automatically be considered for SYCO 12; you still need to submit it again through OpenReview. When submitting, append the words "DEFERRED FROM SYCO X" to the title of your paper, replacing "X" with the appropriate meeting number. There is no need to attach any documents. PROGRAMME COMMITTEE === The PC chair is Thibaut Benjamin, University of Cambridge. The Programme Committee will be announced soon. STEERING COMMITTEE == Ross Duncan, University of Strathclyde Chris Heunen, University of Edinburgh Dominic Horsman, University of Grenoble Aleks Kissinger, University of Oxford Samuel Mimram, Ecole Polytechnique Simona Paoli, University of Aberdeen Mehrnoosh Sadrzadeh, University College London
Re: LYX 2.4 RC1 — Unable to export a Lyx archive (zip)
On Tue, 30 Jan 2024 at 19:27, Enrico Forestieri wrote: > On Sun, Jan 28, 2024 at 12:59:12AM +0100, Enrico Forestieri wrote: > > > >On Sat, Jan 27, 2024 at 10:09:05PM +, José Matos wrote: > >> > >>On Sat, 2024-01-27 at 20:49 +0100, didiergab...@free.fr wrote: > >>>20:37:37.977: Exportation en cours... > >>>20:37:37.993: (buffer-export lyxzip) > >>>20:37:38.150: python -tt "C:/Users/Didier/AppData/Local/Programs/LyX > >>>2.4/Resources/scripts/lyxpak.py" "K:/CPGE/PTSI/DS/DS-2023- > >>>2024/DS3/"/"MWE-PDF preview.lyx" > >>>20:37:38.375: Traceback (most recent call last): > >>>20:37:38.376: File "C:\Users\Didier\AppData\Local\Programs\LyX > >>>2.4\Resources\scripts\lyxpak.py", line 396, in > >>>20:37:38.377: if not argv[0].startswith("-"): > >>>20:37:38.378:^^^ > >>>20:37:38.378: TypeError: startswith first arg must be bytes or a > >>>tuple of bytes, not str > >>>support\Systemcall.cpp (306): Systemcall: 'python -tt > >>>"C:/Users/Didier/AppData/Local/Programs/LyX > >>>2.4/Resources/scripts/lyxpak.py" "K:/CPGE/PTSI/DS/DS-2023- > >>>2024/DS3/"/"MWE-PDF preview.lyx"' finished with exit code 1 > >>>Error: Conversion du fichier impossible > >> > >>The problem here is that argv members are of type bytes instead of > >>being str (string). > >> > >>This comes from the fact that the lyxpak.py script has special code to > >>deal with Python 2 on Windows. > >> > >>@Enrico could it be that most of the specific windows code is not need > >>any more with Python 3? > > > >I don't know (I don't use the native windows version). However, > >skipping that code when using Python3 the script fails as follows: > > > >python -tt "C:/Program Files/LyX/Resources/scripts/lyxpak.py" > "C:/work/"/"a.lyx" > >Traceback (most recent call last): > > File "C:\Program Files\LyX\Resources\scripts\lyxpak.py", line 401, in > > >main(sys.argv) > > File "C:\Program Files\LyX\Resources\scripts\lyxpak.py", line 302, in > main > >input = gzopen(lyxfile) > >^^^ > > File "C:\Program Files\LyX\Resources\scripts\lyxpak.py", line 77, in > gzopen > >input = open(file.decode('utf-8'), 'rb') > > ^^^ > >AttributeError: 'str' object has no attribute 'decode'. Did you mean: > 'encode'? > > > > > >I don't think it was ever tested on Windows with Python3. > > For making it work with Python 3 on Windows I had to patch both our > lyxpak.py script and getopt.py from Python. > > Attached you will find the patch to be applied to lyxpak.py, the patch I > had to apply to getopt.py and the patched version (lyxwin_getopt.py) > that should be distributed with LyX. > > In this way lyxpak.py works for me with both Python 2 and 3, in both > Windows and Linux. > > Please test, especially on Windows. > It's going to be a bit hard to test the patch for getopt.py, as the default LyX installer ships the Python libraries in a .zip file ("C:\Program Files\LyX 2.4\Python\python311.zip") containing only .pyc files (like getopt.pyc). Nevertheless, copying your module lyxwin_getopt and patching lyxpak.py solves the problem for me! (Windows 11 x64 23H2.) -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Graphics Conversion
fpages]... yes 21:14:05.440: +checking for package pgf [pgf]... yes 21:14:05.444: +checking for package pict2e [pict2e]... yes 21:14:05.447: +checking for package prettyref [prettyref]... yes 21:14:05.449: +checking for package preview [preview]... yes 21:14:05.453: +checking for package refstyle [refstyle]... yes 21:14:05.457: +checking for package rotating [rotating]... yes 21:14:05.460: +checking for package rotfloat [rotfloat]... yes 21:14:05.463: +checking for package sciposter [sciposter]... no 21:14:05.466: +checking for package sectionbox [sectionbox]... yes 21:14:05.470: +checking for package serbianc [serbianc.ldf]... yes 21:14:05.473: +checking for package setspace [setspace]... yes 21:14:05.476: +checking for package slashed [slashed]... yes 21:14:05.479: +checking for package soul [soul]... yes 21:14:05.482: +checking for package splitidx [splitidx]... yes 21:14:05.485: +checking for package stackrel [stackrel]... yes 21:14:05.488: +checking for package stmaryrd [stmaryrd]... yes 21:14:05.491: +checking for package subfig [subfig]... yes 21:14:05.494: +checking for package subscript [subscript]... yes 21:14:05.497: +checking for package Sweave [Sweave]... no 21:14:05.499: +checking for package tablefootnote [tablefootnote]... yes 21:14:05.503: +checking for package tabularx [tabularx]... yes 21:14:05.505: +checking for package tcolorbox [tcolorbox]... yes 21:14:05.508: +checking for package textcomp [textcomp]... yes 21:14:05.511: +checking for package thswitch [thswitch]... no 21:14:05.513: +checking for package tikz [tikz]... yes 21:14:05.516: +checking for package turkmen [turkmen.ldf]... yes 21:14:05.553: +checking for package ucs [ucs]... yes 21:14:05.556: +checking for package ulem [ulem]... yes 21:14:05.558: +checking for package undertilde [undertilde]... yes 21:14:05.561: +checking for package unicode-math [unicode-math]... yes 21:14:05.564: +checking for package units [units]... yes 21:14:05.565: +checking for package url [url]... yes 21:14:05.567: +checking for package varioref [varioref]... yes 21:14:05.570: +checking for package varwidth [varwidth]... yes 21:14:05.573: +checking for package wallpaper [wallpaper]... yes 21:14:05.576: +checking for package wrapfig [wrapfig]... yes 21:14:05.579: +checking for package xargs [xargs]... yes 21:14:05.582: +checking for package xcolor [xcolor]... yes 21:14:05.586: +checking for package xetex-def [xetex.def]... yes 21:14:05.588: +checking for package xkeyval [xkeyval]... yes 21:14:05.590: +checking for package xltabular [xltabular]... yes 21:14:05.593: +checking for package xskak [xskak]... yes 21:14:05.597: +checking for package arydshln [arydshln]... yes 21:14:05.601: +checking for package braket [braket]... yes 21:14:05.603: +checking for package cancel [cancel]... yes 21:14:05.604: +checking for package caption [caption]... yes 21:14:05.607: +checking for package colortbl [colortbl]... yes 21:14:05.610: +checking for package diagbox [diagbox]... yes 21:14:05.610: +checking for package etoolbox [etoolbox]... yes 21:14:05.613: +checking for package eurosym [eurosym]... yes 21:14:05.617: +checking for package fp [fp]... yes 21:14:05.620: +checking for package makecmds [makecmds]... yes 21:14:05.622: +checking for package marginnote [marginnote]... yes 21:14:05.626: +checking for package picinpar [picinpar]... yes 21:14:05.628: +checking for package pict2e [pict2e]... yes 21:14:05.630: +checking for package sidecap [sidecap]... yes 21:14:05.633: +checking for package upgreek [upgreek]... yes 21:14:05.636: +checking for package psnfss [times.sty]... yes 21:14:05.640: +checking for package avant [avant]... yes 21:14:05.643: +checking for package bookman [bookman]... yes 21:14:05.646: +checking for package chancery [chancery]... yes 21:14:05.650: +checking for package charter [charter]... yes 21:14:05.653: +checking for package cochineal [cochineal]... yes 21:14:05.656: +checking for package courier [courier]... yes 21:14:05.660: +checking for package crimson [crimson]... yes 21:14:05.663: +checking for package CrimsonPro [CrimsonPro]... yes 21:14:05.666: +checking for package helvet [helvet]... yes 21:14:05.669: +checking for package mathpazo [mathpazo]... yes 21:14:05.672: +checking for package mathpple [mathpple]... yes 21:14:05.675: +checking for package mathptm [mathptm]... yes 21:14:05.678: +checking for package mathptmx [mathptmx]... yes 21:14:05.681: +checking for package newcent [newcent]... yes 21:14:05.684: +checking for package pifont [pifont]... yes 21:14:05.687: +checking for package utopia [utopia]... yes 21:14:05.690: +checking for package ae [ae]... yes 21:14:05.693: +checking for package bera [bera]... yes 21:14:05.696: +checking for package biolinum [biolinum]... yes 21:14:05.699: +checking for package biolinum-type1 [biolinum-type1]... no 21:14:05.701: +checking for package cantarell [cantarell]... yes 21:14:05.704: +checking for package ccfonts [ccfonts]... yes 21:14:05.707: +checking for package Chivo [Chivo]... yes
Re: RC1: Unable to read files with accents in names on Windows
On Mon, 22 Jan 2024 at 23:53, Thibaut Cuvelier wrote: > On Mon, 22 Jan 2024 at 23:00, Richard Kimberly Heck > wrote: > >> On 1/22/24 16:53, didiergab...@free.fr wrote: >> >> I also realize that I can no longer load images whose names contain accents. >> In any case, that’s what’s happening with the file I just sent you. If I >> rename the file: >> SchemaCinematique.pdf to SchemaCinématique.pdf >> then I can read “Error converting to a readable format.” >> >> That's a serious bug. Can anyone on Windows check this? >> > I can reproduce with PDF files whose names have accents, but not PNG (with > the same file name apart from the extension). If I export the file to LyX > 2.3 and load it with LyX 2.3.7, the PDF file doesn't have any issue (with > MikTeX, up to date). > > I'm attaching the logs (View > Messages Pane, with all logs enabled) and > the corresponding test files (LyX 2.3 and 2.4). > Another data point: in the temporary folder LyX uses for this document (lyx_tmpdir.bsUGvNMjILjF), I have six files, all of them empty (size: zero byte). PS C:\Users\Thibaut\AppData\Local\Temp\lyx_tmpdir.bsUGvNMjILjF> ls -R Directory: C:\Users\Thibaut\AppData\Local\Temp\lyx_tmpdir.bsUGvNMjILjF Mode LastWriteTime Length Name - -- d- 22-Jan-24 23:47 lyx_tmpbuf0 -a 22-Jan-24 23:43 0 CacheItem.EtXrBH -a 22-Jan-24 23:44 0 CacheItem.nbPvek -a 22-Jan-24 23:42 0 CacheItem.OYeYzR -a 22-Jan-24 23:42 0 gconvertAvdsxC.pdf -a 22-Jan-24 23:43 0 gconvertFgslXV.pdf -a 22-Jan-24 23:44 0 gconvertIdshbV.pdf Directory: C:\Users\Thibaut\AppData\Local\Temp\lyx_tmpdir.bsUGvNMjILjF\lyx_tmpbuf0 Mode LastWriteTime Length Name - -- -a 22-Jan-24 23:47 2598 test.23.lyx -a 22-Jan-24 23:47 2938 test.lyx -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: adding new subtargets
[trimming CC-list and changing subject to match content] > Le 8 déc. 2023 à 23:48, Elliott Mitchell a écrit : > > On Fri, Dec 08, 2023 at 06:53:31PM +0100, Thibaut wrote: >> >>> Le 8 déc. 2023 à 16:39, Elliott Mitchell a écrit : >>> […] >>> Will mean rather >>> substantial changes to the build system though. I tend to favor this >>> as the 2 level limitation is already placing restrictions on the scaling >>> of the build count. >> >> It appears most people do not understand that {sub}+targets use the exact >> same amount of build resources *each* as a whole target. There is no >> benefit, from the PoV of the (phase1) builders, to having more subtargets vs >> more targets: either way, growing either number indefinitely is simply not >> sustainable. Please don’t do that. >> > > So, you would prefer to have all of a small cupcake, to a slice of a > much larger cake? > > You would prefer to be the big fish in the small pond to the small fish > in the much larger lake? ? > This is not an invalid choice, but usually projects prefer to grow than > shrink. Also, while having more levels should allow better organization > and then more growth; making growth possible does not force growth to > occur. Famous last words. I don’t think the project is in a situation to throw limitless resources at its build workload, but I’m happy to be proven wrong. Fact: unlimited/unabated growth in a finite environment seldom gives lasting results. > What I've observed from rather a lot of wildly different builds in the > past month differs. Most of any OpenWRT build is unshared, but some > portions are reused and substantially greater portions could be reused. Provided that you can guarantee no bits leak across builds and 100% reproducibility, sure. > Notably the compiler was reused. Not on phase1. Toolchain is rebuilt for every (sub)target. (I won’t discuss phase2 here which has its own problems, like rebuilding the entire repo for every package bump). > If steps were taken to allow reusing > unpacked kernel source, the kernel would only need to be unpacked once > (some of the patches I've sent aim in this direction). > > One thing I've noticed is the single-thread portions are a *major* > holdback at this point. The single-thread unpacking of various tarballs > completely overwhelmed the portions of builds which used multiple > processors. > > Right now my storage is sick and providing poor write performance (wow, > that battery-backed cache was *impressive*!), yet all OpenWRT builds > averaged less than a single processor in use. That is rather concerning. No need to be concerned, this does not occur on autobuilder hardware. tl;dr: new (sub)targets each imply a complete « make world » cycle from a clean git checkout on phase1: it’s a substantial load, especially when only a handful of devices are concerned (hence for instance keeping qoriq source-only). Accommodating new devices should therefore leverage as much as possible *existing* (sub)targets (or consider staying source-only). Alternatively, you’re welcome to rewrite the build system to make it more scalable. T. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [PATCH] ipq95xx: Add support for IPQ9574 RDP433
> Le 8 déc. 2023 à 16:39, Elliott Mitchell a écrit : > > On Fri, Dec 08, 2023 at 11:14:38AM +0100, Robert Marko wrote: >> On Fri, 8 Dec 2023 at 11:13, Piotr Dymacz wrote: >>> >>> On 8.12.2023 11:02, Robert Marko wrote: On Fri, 8 Dec 2023 at 11:01, Piotr Dymacz wrote: > > Would it make sense to rename qualcommax to qualcomm and make ipq95xx > just another subtarget of it (I'm aware of A53 vs. A73)? That depends on how much is shared between the AX SoC-s and the BE ones(IPQ95xx and IPQ53xx). >>> >>> I would say enough to keep them together. >>> But, I would prefer that or qualcommbe target where new BE SoC-s will be subtargets. >>> >>> I'm personally more a fan of limiting number of top targets and deal >>> with differences under subtargets. >> >> Same here, better than to add more targets especially since a lot is shared. > > This leads to needing more levels of organization. Instead of simply > TARGET/SUBTARGET, you end up needing TARGET/SUBTARGET/SUBSUBTARGET. If > this is going to be done, then the implementation should allow for an > arbitrary number of levels. > > A makefile fragment I created for testing: > > foo := foo0 > SUBfoo := foo1 > SUBSUBfoo := foo2 > > define recur > $(info current is $(1), value is $($(1 > ignore := $(if $(filter $(flavor SUB$(1)),undefined),,$(call recur,SUB$(1))) > endef > > ignore := $(call recur,foo) > > all: test.make > @true > > So an arbitrary number of levels seems doable. No. > Will mean rather > substantial changes to the build system though. I tend to favor this > as the 2 level limitation is already placing restrictions on the scaling > of the build count. It appears most people do not understand that {sub}+targets use the exact same amount of build resources *each* as a whole target. There is no benefit, from the PoV of the (phase1) builders, to having more subtargets vs more targets: either way, growing either number indefinitely is simply not sustainable. Please don’t do that. My 2c. T. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: Unbalanced prioritization in the images buildbot? (main branch deprioritized too much)
> Le 14 nov. 2023 à 18:06, Petr Štetiar a écrit : > > Thibaut [2023-11-14 14:25:50]: > >> I’m sorry, I must have missed the part where we advertised that master >> snapshots are a maintained 'release' suitable for use in a >> security-conscious context :) > > There is no difference actually, it applies to all branches/releases, so it > really > doesn't matter if you use main snapshot or 23.05.1 release. > > Once the commit lands in the corresponding branch (main, openwrt-23.05 or > openwrt-22.03) then the packages are going to be built on buildbot and become > available for `opkg upgrade`, so you don't need to wait for a tagged release > to get certain fixes possible by a package upgrade. > > In other words, https://downloads.openwrt.org/releases/23.05.0/ that > `packages` folder is a symlink to packages-23.05, populated by 23.05 snapshot > builds. I understand this rationale for *releases* branch. Not for master. Hence prioritizing the releases branches, which, as we’ve seen just today, has merits. But I rest my case and I have provided a fix already. Cheers, T ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: Unbalanced prioritization in the images buildbot? (main branch deprioritized too much)
Hi, > Le 14 nov. 2023 à 13:25, Petr Štetiar a écrit : > > Thibaut [2023-11-14 10:24:28]: > > Hi, > >> I don’t follow, what do security fixes have to do with snapshot builds? > > OpenWrt builds and deliver package fixes continuosly from the snapshot builds. > >> I don’t expect users (that includes myself) to keep constantly looking at >> the git history to find if/when a CVE has been addressed in the snapshot >> builds. > > You're not expected to do this, we send out security advisories if its > important, where you can usually find recommended mitigations, like for > example: > > https://forum.openwrt.org/c/announcements/14 > https://lists.openwrt.org/pipermail/openwrt-announce/2022-October/33.html > > most of the fixes can be handled with `opkg update; opkg upgrade` I’m sorry, I must have missed the part where we advertised that master snapshots are a maintained 'release' suitable for use in a security-conscious context :) Anyway, I have added an additional commit to my PR that removes branch priority: while it won’t solve the intrinsic resource waste that our buildbot system currently is, it should assuage the concerns raised in this thread. Cheers, T ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: Unbalanced prioritization in the images buildbot? (main branch deprioritized too much)
> Le 14 nov. 2023 à 09:59, Petr Štetiar a écrit : > > Thibaut [2023-11-13 22:20:28]: > > Hi, > >> GitPoller accepts a single poll interval. What you’re suggesting would >> require separating each branch, i.e. returning to the previous situation. > > IIUC then you can have multiple GitPoller instances, so wouldn't something > along this lines work? > > diff --git a/phase1/master.cfg b/phase1/master.cfg > index 6f6c650cf54c..6cbd0c8d9609 100644 > --- a/phase1/master.cfg > +++ b/phase1/master.cfg > @@ -341,15 +341,16 @@ populateTargets() ># about source code changes. > >c["change_source"] = [] > -c["change_source"].append( > -GitPoller( > -repo_url, > -workdir=work_dir + "/work.git", > -branches=branchNames, > -pollAtLaunch=True, > -pollinterval=300, > +for branch in branchNames: > +c["change_source"].append( > +GitPoller( > +repo_url, > +branch=branch, > +workdir=work_dir + "/work.git", > +pollAtLaunch=True, > +pollinterval=pollinterval_for_branch(branch), > +) >) > -) > I’m pretty sure this would explode should two or more gitpoller instances happen to update at the same time. It also defeats the branch priority purpose and solves nothing: say you have a 24h interval on some high priority branch. It only takes two separate commits at 24h interval to that branch to still starve master. >> Also note that even with a 24h poll interval you could still starve the >> master builds. > > Sure, but meanwhile it would still allow to build quite a bunch of the master > targets, so improving current situation. There’s a much easier way to do this: we just stop prioritizing (release) branches. Treat all builders [there’s one builder per branch per target] equally and rank them by time last run (regardless of branch) and voila, problem solved, no branch *and* no target can be starved. Of course we would still keep tag builds at maximum priority in that scenario. This should be a 2-3-line change, let me know if I should submit this. Of course for low traffic branches, the first new commit will get priority over everything else (if the branch hasn’t been built in a long time), but that I believe is quite « logical » and acceptable. >> or we switch to a periodic build schedule > > What about handling of security fixes in this once a week periodic build > proposal? I don’t follow, what do security fixes have to do with snapshot builds? Surely this is not suggesting that we address security issues via the snapshot builds, especially when, as I pointed out earlier, there is no guarantee that any given commit will be built unequivocally on *all* targets? My understanding is that security fixes are handled via service releases; I don’t expect users (that includes myself) to keep constantly looking at the git history to find if/when a CVE has been addressed in the snapshot builds. > Going forward with this approach, we would still probably need some custom > scheduler which would be able to skim through the commit content and trigger > build when certain patterns are found, like a word 'security' or CVE number? See above, I’m afraid this doesn’t make sense to me. >> This would have the added benefit of ensuring *consistency* >> across targets, i.e. ensuring that whichever commit is built is built on >> *all* targets. > > I'm probably missing something, but what is this consistency good for? Even testing field. > I would actually prefer to select say top X targets (ideally have them in > testbeds for automatic runtime testing) and increase build priorities for > those in phase1/phase2 builds, making sure, that we provide builds to actual > users/testers first and build the rest afterwards. > > Those targets would be clearly marked as such in the source tree, for example: > > FEATURES+=ci-tier1 I didn’t know we were going to second-class some targets now? Cheers T ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: Unbalanced prioritization in the images buildbot? (main branch deprioritized too much)
> Le 13 nov. 2023 à 21:32, Petr Štetiar a écrit : > > Thibaut [2023-11-13 17:26:44]: > > Hi, > >> In any case, another way to tackle this problem would be to switch from >> continuous builds that starve the build resources to periodic builds that >> don’t (e.g. once a week), > > other options: > > * add more build workers :-) > * use different GitPoller polling interval settings > (master=5 minutes, 23.05=12 hours, 22.03=24 hours) GitPoller accepts a single poll interval. What you’re suggesting would require separating each branch, i.e. returning to the previous situation. It would also entirely defeat the purpose of prioritizing branches at the Scheduler level. Also note that even with a 24h poll interval you could still starve the master builds. Which is why I think either we accept the current situation as being « as designed », or we switch to a periodic build schedule (which imho makes a lot more sense considering that build resources aren’t infinitely expandable). This would have the added benefit of ensuring *consistency* across targets, i.e. ensuring that whichever commit is built is built on *all* targets. Currently master will typically build and produce images for different commits across targets when there is a lot of commit activity. Cheers ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: Unbalanced prioritization in the images buildbot? (main branch deprioritized too much)
Hi, > Le 13 nov. 2023 à 16:55, Hannu Nyman a écrit : > > Looks like the release branches might have a too strong priority in the > combined image buildbot, so that release branches get always built before the > development main/master. > > Recently there has been a steady flow of mostly small/unessential > fixes/improvements for 22.03 and 23.05, so buildbot has been focused on > building 22.03-SNAPSHOT and 23.05-SNAPSHOT (and the ongoing 23.05.1 build), > and the main branch builds do lag really badly. > > There was a bug in netifd WLAN device / hotplug handling that Felix fixed > already 3 days ago, but we are still offering faulty downloads for half of > the targets in main, as buildbot is prioritising 22.03 and 23.05 due to new > commits in them. Oldest (and faulty) main build downloads are currently from > Wed 8th = 5 days ago. That affects the imagebuilder/auc/attendedsysupgrade > users, too. > > The combined queue for images looks nice in principle, but can apparently > lead into discrimination of main/master, if there are steadily new commits to > the dormant stable branches. I think it’s working exactly as designed. The release branches are prioritized over main by virtue of being *release* branches. AIUI the purpose of autobuilder on the main branch is a convenience facility mainly used for confirming that new commits build correctly(*), not (IMHO) a way to « offer » images [for end users]. Users running bleeding edge are likely to build their own images anyway. Furthermore the turn around time for any one commit to be fully built on any one branch is about a couple days on the current infrastructure, so « 3 days » is actually a very short timeframe in that context. > There should maybe be some sanity check that each target gets built at least > after X days since the last build, even if there are newer commits in the > prioritized release branches. The "time since last build" should have a > growing weight. I disagree. Having up to date release branches is more important than having up-to-date main snapshot, so that the release branches are always confirmed to be in a releasable state should the need arise. In any case, another way to tackle this problem would be to switch from continuous builds that starve the build resources to periodic builds that don’t (e.g. once a week), in which case it becomes possible to predictably and consistently build all branches. (*) considering the amount of CI now going on, there would be less need to run the builders continuously and the periodic proposal above could make more sense. My 2c. T ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [PATCH] kernel: provide better control & help for SLUB configuration
Hi, > Le 7 nov. 2023 à 23:25, Rafał Miłecki a écrit : > > From: Rafał Miłecki > > Allow selecting KERNEL_SLUB_DEBUG and KERNEL_SLUB_DEBUG_ON manually and > provide detailed help for both. > > Signed-off-by: Rafał Miłecki > --- > config/Config-kernel.in | 15 +-- > 1 file changed, 13 insertions(+), 2 deletions(-) > > diff --git a/config/Config-kernel.in b/config/Config-kernel.in > index a1209d82f3..4529c81fc7 100644 > --- a/config/Config-kernel.in > +++ b/config/Config-kernel.in > @@ -682,10 +682,21 @@ config KERNEL_PRINTK_TIME > default y > > config KERNEL_SLUB_DEBUG > - bool > + bool "Enable SLUB debugging support" > + help > + This enables various debugging features: > + - Accepts "slub_debug" kernel parameter > + - Provides caches debugging options (e.g. tracing, validating) > + - Adds /sys/kernel/slab/ attrs for reading amounts of *objects* > + - Enables /proc/slabinfo support > + - Prints into when running out of memory Prints /info/ ? Also following your previous patch, shouldn’t the help text mention that enabling this option results in significant increase in code size? Cheers, T ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Fwd: New Defects reported by Coverity Scan for LyX
-- Forwarded message - From: Thibaut Cuvelier Date: Thu, 26 Oct 2023, 03:35 Subject: Fwd: New Defects reported by Coverity Scan for LyX To: LyX Developers Dear list, I am attaching a patch that fixes two Coverity warnings. Could anyone commit this to the Git repo (given I currently have no access to it)? As it was generated with git format-patch, it should be easy to do while keeping the commit message that explains the rationale behind the fix. Thanks in advance! Thibaut -- Forwarded message - From: Date: Thu, 19 Oct 2023 at 22:54 Subject: New Defects reported by Coverity Scan for LyX To: Hi, Please find the latest report on new defect(s) introduced to LyX found with Coverity Scan. 2 new defect(s) introduced to LyX found with Coverity Scan. New defect(s) Reported-by: Coverity Scan Showing 2 of 2 defect(s) ** CID 403673: Incorrect expression (IDENTICAL_BRANCHES) /home/lasgoutt/src/lyx/coverity/lyx/src/tex2lyx/text.cpp: 4351 in lyx::parse_text(lyx::Parser &, std::basic_ostream>&, unsigned int, bool, lyx::Context &, const std::__cxx11::basic_string, std::allocator> &, const std::__cxx11::basic_string, std::allocator> &)() *** CID 403673: Incorrect expression (IDENTICAL_BRANCHES) /home/lasgoutt/src/lyx/coverity/lyx/src/tex2lyx/text.cpp: 4351 in lyx::parse_text(lyx::Parser &, std::basic_ostream>&, unsigned int, bool, lyx::Context &, const std::__cxx11::basic_string, std::allocator> &, const std::__cxx11::basic_string, std::allocator> &)() 4345parse_text_snippet(p, os, FLAG_ITEM, outer, context); 4346bool xcolorulem = LaTeXPackages::isAvailable("ulem") && 4347 LaTeXPackages::isAvailable("xcolor"); 4348// No need to test for luatex, since luatex comes in 4349// two flavours (dvi and pdf), like latex, and those 4350// are detected by pdflatex. >>> CID 403673: Incorrect expression (IDENTICAL_BRANCHES) >>> The same code is executed regardless of whether "lyx::pdflatex || lyx::xetex" is true, because the 'then' and 'else' branches are identical. Should one of the branches be modified, or the entire 'if' statement replaced? 4351if (pdflatex || xetex) { 4352if (xcolorulem) { 4353 preamble.registerAutomaticallyLoadedPackage("ulem"); 4354 preamble.registerAutomaticallyLoadedPackage("xcolor"); 4355} 4356} else { ** CID 403672: Error handling issues (CHECKED_RETURN) /home/lasgoutt/src/lyx/coverity/lyx/src/insets/InsetInfo.cpp: 1587 in lyxxhtmlShortcutInfo(lyx::XMLStream &, const lyx::InsetInfoParams &)() *** CID 403672: Error handling issues (CHECKED_RETURN) /home/lasgoutt/src/lyx/coverity/lyx/src/insets/InsetInfo.cpp: 1587 in lyxxhtmlShortcutInfo(lyx::XMLStream &, const lyx::InsetInfoParams &)() 1581string const lcode = params.lang->code(); 1582docstring trans; 1583for (size_t i = 0; i < sequence.length(); ++i) { 1584char_type const c = sequence[i]; 1585const auto keyMapping = keyToString.find(c); 1586if (keyMapping != keyToString.end()) { >>> CID 403672: Error handling issues (CHECKED_RETURN) >>> Calling "translateString" without checking return value (as is done elsewhere 15 out of 18 times). 1587 translateString(from_ascii(keyMapping->second), trans, lcode); 1588xs << trans; 1589} else { 1590xs << c; 1591} 1592 To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yoTScfh6B8koVa-2BsXrqsH2r7zUmO9t1iEi-2FFYNyEDxxSQ-3D-3DsI5y_EaoV9iDrwluI0GGUrbM7yWAc9ILy2qIm0bzgdOF2o6OvKSta0m1PyhfKtFZpqs5rxkZ0WyT4tDIrKOVdRzCQUcgJBhEZL-2FoBWogZGuZsQC-2Bq0AbrFZDRbh6FzKvH7PuKIgIPnV5R1jUXR4Pa7I5qkEG-2FqT5uQIViXTNlHVpGxd3kG3fmlowNDXT2qSzXiuqPTFSxrInHD6j7Cz-2FWufFoDw-3D-3D To manage Coverity Scan email notifications for "dourou...@gmail.com", click https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxxF-2FO44sWaogU6jGZMVL91U2CAiKpstwf-2F8GS1cLm5bQFa2vNdaMB9I0sFa-2FifkyGPDQ9lPJpxrLzv5JkQQq3cko-2Bs4SC3hxsw-2BPRRBy49SI-3D7CxO_EaoV9iDrwluI0GGUrbM7yWAc
[ansible-project] Voicing my concerns with passlib (security) and its larger adoption by Ansible
Hello, While doing Ansible maintenance work, I discovered that the passlib library used by Ansible (currently only for Mac users) has not seen any release in 3 years. I am a bit concerned about how interesting it would be as an attack target (especially since it encrypts passwords), e.g. Pypi account take-over. I have opened various issues: - https://foss.heptapod.net/python-libs/passlib/-/issues/187 to try to get an update on the passlib maintenance status - https://github.com/ansible/ansible/issues/81949 to raise awareness about that While doing so, I have learned that passlib is actually likely to be used for all Ansible users soon, not just Mac ones, which makes an account take-over an even more interesting goal. The issue has been closed, but I feel this should be taken care of (I have suggested ideas), so I'm voicing my concerns here. An account take-over of passlib (I don't know if it has 2FA enabled, for instance) would have potentially massive impact on Ansible users. If anyone has interesting ideas, let me know! Thibaut -- https://thibautbarrere.com/ https://twitter.com/thibaut_barrere -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d05bfd9f-4d17-4a91-975c-7c212c1c7727n%40googlegroups.com.
Re: Big number of inverted docbook5 tests
On Thu, 12 Oct 2023, 11:11 Kornel Benko, wrote: > > Master trunk as of today: > I count 406 tests for docbook5. 149 of them are inverted. > Thibaut, is there a reason for such a huge ratio? There are two major reasons. - Many tests are for Beamer: someone would need to write the layouts for it, there is little from the other documents that can be used for Beamer. - There are modules that are hard to support (they would need a lot of custom code only for one module). Basically, that means that LaTeX and DocBook are vastly different in terms of concepts and levels of abstraction. I think I "documented" the inversion in the commit messages. Overall, having all tests pass would require tens of hours of work, which I preferred to invest in improving the quantity of the existing implementation. -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: [PATCH] Added some options to configure.py allowing for faster partial-reconfigures.
On Wed, 11 Oct 2023 at 11:03, Pavel Sanda wrote: > On Tue, Oct 10, 2023 at 02:38:01PM +0200, Jürgen Spitzmüller wrote: > >> 4) *lot* of latex packages > > All we query is needed for something for sure. > > Let's stick with point 4. > > By *needed* you mean that we have e.g. some specific feature requiring it > for > proper typesetting (I agree with that) or that we actively use the > information > gathered by configure somewhere in UI (that's what I'm doubting, except of > the > insetinfo case)? > When you open a document that your LaTeX installation cannot compile, LyX warns you (something like "this class is not available" or module). -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: [LyX/master] ctest: invert es/Intro_docbook5
On Sun, 8 Oct 2023 at 21:35, Thibaut Cuvelier wrote: > On Sun, 8 Oct 2023 at 17:05, Scott Kostyshak wrote: > >> On Sun, Oct 08, 2023 at 02:48:45PM +0200, Thibaut Cuvelier wrote: >> > Just a quick amendment to a previous patch (#1 in the series): there >> was a >> > quite big typo there... It should solve the largest issue with the newly >> > failing test, but not all. I'm having a look at this test to improve the >> > situation a bit more. >> > >> > Thibaut Cuvelier >> >> Sounds good. Riki OK to commit these to master? >> > > I've taken some time to solve the issue with that test. I am adding one > more patch to the list to solve it, plus another one to fix a crash I > noticed while debugging this example. > > (FYI, the patch #4 in the sequence is a cleanup I made while having a look > at https://www.lyx.org/trac/ticket/12891.) > I took the time to do the XHTML version too. It's almost the same code, again without touching anything about LaTeX. 0003-DocBook-fix-closing-formatting-after-deleted-text.patch Description: Binary data 0005-DocBook-in-InsetInfo-ensure-that-no-db-date-is-inser.patch Description: Binary data 0007-XHTML-implement-InsetInfo.patch Description: Binary data 0001-DocBook-add-support-for-InsetInfo.patch Description: Binary data 0006-DocBook-fix-a-crash-in-docbookSimpleAllParagraphs.patch Description: Binary data 0002-DocBook-fix-formatting-of-TODOs.patch Description: Binary data -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: [LyX/master] ctest: invert es/Intro_docbook5
On Sun, 8 Oct 2023 at 17:05, Scott Kostyshak wrote: > On Sun, Oct 08, 2023 at 02:48:45PM +0200, Thibaut Cuvelier wrote: > > Just a quick amendment to a previous patch (#1 in the series): there was > a > > quite big typo there... It should solve the largest issue with the newly > > failing test, but not all. I'm having a look at this test to improve the > > situation a bit more. > > > > Thibaut Cuvelier > > Sounds good. Riki OK to commit these to master? > I've taken some time to solve the issue with that test. I am adding one more patch to the list to solve it, plus another one to fix a crash I noticed while debugging this example. (FYI, the patch #4 in the sequence is a cleanup I made while having a look at https://www.lyx.org/trac/ticket/12891.) From 8b5836d493afd689f327384c69f501b04f2c590d Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Sun, 8 Oct 2023 21:06:46 +0200 Subject: [PATCH 5/6] DocBook: in InsetInfo, ensure that no db:date is inserted within a db:date. --- autotests/export/docbook/insetinfo.lyx | 11 +++ autotests/export/docbook/insetinfo.xml | 3 +++ src/Paragraph.cpp | 11 ++- src/insets/InsetInfo.cpp | 27 ++ 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/autotests/export/docbook/insetinfo.lyx b/autotests/export/docbook/insetinfo.lyx index 1ae6c30760..a1b04a54f9 100644 --- a/autotests/export/docbook/insetinfo.lyx +++ b/autotests/export/docbook/insetinfo.lyx @@ -91,6 +91,17 @@ Test: InsetInfo \end_layout +\begin_layout Date + +\lang japanese-cjk +\begin_inset Info +type "moddate" +arg "long" +\end_inset + + +\end_layout + \begin_layout Standard \lang spanish diff --git a/autotests/export/docbook/insetinfo.xml b/autotests/export/docbook/insetinfo.xml index 48ba1d802d..dd0dd6630c 100644 --- a/autotests/export/docbook/insetinfo.xml +++ b/autotests/export/docbook/insetinfo.xml @@ -2,6 +2,9 @@ http://docbook.org/ns/docbook; xmlns:xlink="http://www.w3.org/1999/xlink; xmlns:m="http://www.w3.org/1998/Math/MathML; xmlns:xi="http://www.w3.org/2001/XInclude; version="5.2"> + Test: InsetInfo +2023-10-08 + Véase la User's Guide o Additional Features para más detalles. \ No newline at end of file diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 333aeb8862..5ac03fa474 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -3635,11 +3635,11 @@ std::tuple, vector> computeDocBookFontSwit std::tuple, std::vector, std::vector> Paragraph::simpleDocBookOnePar(Buffer const & buf, - OutputParams const & runparams, - Font const & outerfont, - pos_type initial, - bool is_last_par, - bool ignore_fonts) const + OutputParams const & runparams, + Font const & outerfont, + pos_type initial, + bool is_last_par, + bool ignore_fonts) const { // Return values: segregation of the content of this paragraph. std::vector prependedParagraphs; // Anything that must be output before the main tag of this paragraph. @@ -3669,6 +3669,7 @@ std::tuple, std::vector, std::vector"); xs << qstring_to_ucs4(parseDate(buffer(), params_).toString(Qt::ISODate)); - xml::closeTag(xs, "date", "inline"); + if (!isWithinDate) + xml::closeTag(xs, "date", "inline"); break; } @@ -1752,9 +1763,17 @@ void InsetInfo::docbook(XMLStream & xs, OutputParams const & rp) const } // DocBook has no specific element for time, so use a date. - xml::openTag(xs, "date", "(role=\"" + role + "\"", "inline"); + // See the discussion above (DATE_INFO, MODDATE_INFO, and FIXDATE_INFO) for a discussion about the choices that + // have been made. + const bool isWithinDate = buffer().getParFromID(rp.lastid).top().paragraph().layout().docbooktag() == "date"; + + if (!isWithinDate) + xml::openTag(xs, "date", "role=\"" + role + "\"", "inline"); + else + xs << XMLStream::ESCAPE_NONE << from_ascii(std::string(""); xs << qstring_to_ucs4(parseTime(buffer(), params_).toString(Qt::ISODate)); - xml::closeTag(xs, "date", "inline"); + if (!isWithinDate) + xml::closeTag(xs, "date", "inline"); break; } -- 2.41.0.windows.1 From e0815bfe4f51a573bfb2e90c0fbb70d68c497e32 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier
Re: [LyX/master] ctest: invert es/Intro_docbook5
Just a quick amendment to a previous patch (#1 in the series): there was a quite big typo there... It should solve the largest issue with the newly failing test, but not all. I'm having a look at this test to improve the situation a bit more. Thibaut Cuvelier On Sun, 8 Oct 2023 at 04:23, Scott Kostyshak wrote: > On Sun, Oct 08, 2023 at 01:55:23AM +0200, Thibaut Cuvelier wrote: > > On Wed, 27 Sept 2023 at 19:46, Scott Kostyshak wrote: > > > > > On Wed, Sep 27, 2023 at 06:24:31PM +0200, Scott Kostyshak wrote: > > > > commit bf241165dd9b30b26e45b5fcbab0e2bd0d143b4c > > > > Author: Scott Kostyshak > > > > Date: Wed Sep 27 13:42:40 2023 -0400 > > > > > > > > ctest: invert es/Intro_docbook5 > > > > > > > > This fails after recent changes to the document. > > > > --- > > > > > > Hi Thibaut, > > > > > > The es/Intro_docbook5 test is failing after changes to the document. I > > > know some of these issues are very hard to add support for, so my plan > > > is to just invert them when they happen and CC you so that you can > > > decide whether it's worth spending time on or not. > > > > > > > I'm attaching a patch that fixes the output from InsetInfo to match the > > LaTeX output. This patch might be slightly controversial, since LyX 2.4 > is > > nearing the release; I made sure to touch the DocBook parts of the code > > only to lower the risk of breakage. > > > Also, I'm adding two much smaller patches: one that improves code > > readability, one that fixes a bug about formatting and change tracking. > > Seems fine to me. Riki, is it OK with you if I commit Thibaut's patches to > master? > > > I have manually checked that doc/es/Intro generates valid DocBook 5 > (i.e. I > > believe the test could be uninverted). Let me know if you find more > issues! > > > > Could someone please check this in the Git repository? Thanks! > > The following test now fails: > > > export/examples/Language_Support/Mixing_Japanese_with_other_Languages_%28with_CJKutf8%29_docbook5 > > Scott > -- > lyx-devel mailing list > lyx-devel@lists.lyx.org > http://lists.lyx.org/mailman/listinfo/lyx-devel > 0002-DocBook-fix-formatting-of-TODOs.patch Description: Binary data 0001-DocBook-add-support-for-InsetInfo.patch Description: Binary data 0003-DocBook-fix-closing-formatting-after-deleted-text.patch Description: Binary data -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: [LyX/master] ctest: invert es/Intro_docbook5
On Wed, 27 Sept 2023 at 19:46, Scott Kostyshak wrote: > On Wed, Sep 27, 2023 at 06:24:31PM +0200, Scott Kostyshak wrote: > > commit bf241165dd9b30b26e45b5fcbab0e2bd0d143b4c > > Author: Scott Kostyshak > > Date: Wed Sep 27 13:42:40 2023 -0400 > > > > ctest: invert es/Intro_docbook5 > > > > This fails after recent changes to the document. > > --- > > Hi Thibaut, > > The es/Intro_docbook5 test is failing after changes to the document. I > know some of these issues are very hard to add support for, so my plan > is to just invert them when they happen and CC you so that you can > decide whether it's worth spending time on or not. > I'm attaching a patch that fixes the output from InsetInfo to match the LaTeX output. This patch might be slightly controversial, since LyX 2.4 is nearing the release; I made sure to touch the DocBook parts of the code only to lower the risk of breakage. Also, I'm adding two much smaller patches: one that improves code readability, one that fixes a bug about formatting and change tracking. I have manually checked that doc/es/Intro generates valid DocBook 5 (i.e. I believe the test could be uninverted). Let me know if you find more issues! Could someone please check this in the Git repository? Thanks! From 0cef99615a371fb5b794091553dd29ec91a2de6f Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Sun, 8 Oct 2023 01:20:14 +0200 Subject: [PATCH 1/3] DocBook: add support for InsetInfo. A similar patch would be required for LyXHTML, but it will come later. The main impact is that some text isn't output in XHTML (like DocBook before this patch). The code isn't as clean as it could be. I avoided touching anything not related to DocBook, as the release of 2.4 is nearing, while leaving comments for parts to improve for the next release cycle. Given that the code compiles, there are no risks for TeX or XHTML outputs; for DocBook, less content is skipped, which is a net improvement for users. --- autotests/export/docbook/insetinfo.lyx | 121 ++ autotests/export/docbook/insetinfo.xml | 7 + src/insets/InsetInfo.cpp | 545 + src/insets/InsetInfo.h | 2 + 4 files changed, 675 insertions(+) create mode 100644 autotests/export/docbook/insetinfo.lyx create mode 100644 autotests/export/docbook/insetinfo.xml diff --git a/autotests/export/docbook/insetinfo.lyx b/autotests/export/docbook/insetinfo.lyx new file mode 100644 index 00..1ae6c30760 --- /dev/null +++ b/autotests/export/docbook/insetinfo.lyx @@ -0,0 +1,121 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass article +\use_default_options true +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Title +Test: + InsetInfo +\end_layout + +\begin_layout Standard + +\lang spanish +Véase la +\emph on + +\begin_inset Info +type "l7n" +arg "User's Guide|U" +\end_inset + + +\emph default + o +\emph on + +\begin_inset Info +type "l7n" +a
Re: ctest ca/Intro_docbook5 now failing
On Mon, 18 Sept 2023 at 02:43, Thibaut Cuvelier wrote: > On Thu, 14 Sept 2023 at 02:35, Scott Kostyshak wrote: > >> On Wed, Sep 06, 2023 at 11:52:49PM -0400, Scott Kostyshak wrote: >> > Recently (I think due to the ca/Intro changes) the following test >> started to fail: >> > >> > export/doc/ca/Intro_docbook5 >> > >> > Thibaut, can you take a look? I'm guessing the recent changes to that >> file just triggered a known issue with DocBook export. Can you confirm so >> that we can invert that test? >> > >> >> I just inverted it for now (at eb920502). Take a look whenever you have >> time. >> > > I had a look at that failure. It's a specific feature of that document, > with an emphasis ending at the end of a footnote (with no character > afterwards). Is this expected that someone can enter that? I would naïvely > think that LyX would remove that formatting (just like you cannot have two > spaces or an empty paragraph). LyXHTML ends the emphasis at the end of the > footnote, unlike DocBook. > > I have the idea for a fix; I'm waiting on your input on whether this is a > DocBook bug or unexpected LyX behaviour. > I made up my mind and decided to replicate the same behaviour as LyXHTML output: actually, there was some text, indicating a true bug in the implementation. The attached patch fixes it locally, making it so that the test can be uninverted. (As previously, I cannot push the commit onto the Git repository.) DocBook__fix_a_bug_when_having_a_space_with_font_at_the_end_of_a_paragraph_.patch Description: Binary data -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: ctest ca/Intro_docbook5 now failing
On Thu, 14 Sept 2023 at 02:35, Scott Kostyshak wrote: > On Wed, Sep 06, 2023 at 11:52:49PM -0400, Scott Kostyshak wrote: > > Recently (I think due to the ca/Intro changes) the following test > started to fail: > > > > export/doc/ca/Intro_docbook5 > > > > Thibaut, can you take a look? I'm guessing the recent changes to that > file just triggered a known issue with DocBook export. Can you confirm so > that we can invert that test? > > > > I just inverted it for now (at eb920502). Take a look whenever you have > time. > I had a look at that failure. It's a specific feature of that document, with an emphasis ending at the end of a footnote (with no character afterwards). Is this expected that someone can enter that? I would naïvely think that LyX would remove that formatting (just like you cannot have two spaces or an empty paragraph). LyXHTML ends the emphasis at the end of the footnote, unlike DocBook. I have the idea for a fix; I'm waiting on your input on whether this is a DocBook bug or unexpected LyX behaviour. -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Bug report: SIGSEGV when copying cross-reference from "description" layout on LyX 2.4.0 beta 5
On Fri, 15 Sept 2023 at 11:36, Jürgen Spitzmüller wrote: > Am Freitag, dem 15.09.2023 um 10:45 +0200 schrieb Léo de Souza: > > 1. Create new document: File > New > > 2. Insert label: Insert > Label... > > 3. On a new line, switch layout to "Labeling" or "Description" > > 4. Insert cross-reference: Insert > Cross-Reference... > > 5. Try copying this cross-reference > > > > Expected result (LyX 2.3.6): The cross-reference is copied to the > > clipboard. > > > > Actual result (LyX 2.4.0 beta 5): LyX crashes with the message > > "SIGSEGV signal caught!" > > > Nullpointer issue due to local_font being non-defined in > InsetRef::xhtml(). > > The attached patch fixes this particular case, but there are many > similar uses in insets's xhtml methods which would need to be audited. > > Thibaut, Riki? > Your patch looks fine to me. It looks cumbersome, especially if we need to do that several times; maybe we could have a method at the inset level, say getLocalFontOrDefault(const OutputParams&), to return either OutputParams::local_font if it exists or buffer().params() otherwise? It would make correct code (much) easier to write. (Wasn't this bug caught at some point by a static analyser? It seems to be a too common error in C++ for it to slip through.) -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: [elixir-core:11518] IEx auto-complete on __functions__
> `__schema__` is only a partially-public API. I believe it is indeed the culprit ; it is displayed as public on the website, but "technically" not public. > For it to show up in documentation and iex, a PR would need to be accepted > to Ecto that would add a `@doc` attribute to the generated `def __schema__(…)` code. This is a good suggestion - I'll open an issue over there. Thanks! -- Thibaut Le mercredi 6 septembre 2023 à 22:50:01 UTC+2, halos...@gmail.com a écrit : `__schema__` is only a partially-public API. For it to show up in documentation and iex, a PR would need to be accepted to Ecto that would add a `@doc` attribute to the generated `def __schema__(…)` code. I just did the following test, and iex acts exactly as it should: ``` defmodule TestApp do def __test__, do: :test end ``` In iex, `TestApp.` does not complete. ``` defmodule TestApp do @doc "The secret __test__ function" def __test__, do: :test end ``` In iex, `TestApp.` completes to `TestApp.__test__`. -a On Wed, Sep 6, 2023 at 4:02 PM thibaut...@gmail.com wrote: Hi! Today during a session I was caught a bit off-guard by the fact that completion doesn't tell you about __schema__ on an Ecto module. (although the behaviour is clearly documented in IEx https://github.com/elixir-lang/elixir/blob/1bc8bc5e76e20c6b0180e024e9d280ab5fc0af94/lib/iex/lib/iex.ex#L22-L26 ). I feel this is a bit sad in terms of "discoverability" for newcomers to Ecto in that case, since __schema__ is a public API of Ecto ( https://hexdocs.pm/ecto/Ecto.Schema.html#module-reflection). I wonder if this is an isolated example or if there are more cases that could affect newcomers to a given Elixir library, and how we could make this more approchable for newcomers? Let me know what you think! -- Thibaut -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/3fbfc0f6-a7f0-4635-b4d1-32f1417d350dn%40googlegroups.com <https://groups.google.com/d/msgid/elixir-lang-core/3fbfc0f6-a7f0-4635-b4d1-32f1417d350dn%40googlegroups.com?utm_medium=email_source=footer> . -- Austin Ziegler • halos...@gmail.com • aus...@halostatue.ca http://www.halostatue.ca/ • http://twitter.com/halostatue -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/57301ec0-dbbe-4cf1-b1dc-65459871b566n%40googlegroups.com.
[elixir-core:11513] IEx auto-complete on __functions__
Hi! Today during a session I was caught a bit off-guard by the fact that completion doesn't tell you about __schema__ on an Ecto module. (although the behaviour is clearly documented in IEx https://github.com/elixir-lang/elixir/blob/1bc8bc5e76e20c6b0180e024e9d280ab5fc0af94/lib/iex/lib/iex.ex#L22-L26). I feel this is a bit sad in terms of "discoverability" for newcomers to Ecto in that case, since __schema__ is a public API of Ecto (https://hexdocs.pm/ecto/Ecto.Schema.html#module-reflection). I wonder if this is an isolated example or if there are more cases that could affect newcomers to a given Elixir library, and how we could make this more approchable for newcomers? Let me know what you think! -- Thibaut -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/3fbfc0f6-a7f0-4635-b4d1-32f1417d350dn%40googlegroups.com.
Re: [DocBook] Re: [LyX/master] Use master buffer setting when exporting
On Sat, 19 Aug 2023 at 01:28, Richard Kimberly Heck wrote: > On 8/18/23 18:09, Richard Kimberly Heck wrote: > > commit 784a7210baf6b0c610c04d507e08855bb233565e > > Author: Richard Kimberly Heck > > Date: Fri Aug 18 19:17:05 2023 -0400 > > > > Use master buffer setting when exporting > > Thibaut: This change may also be needed in the DocBook and XHTML export > routines. Basically, we were querying the buffer itself for the setting > of the use_refstyle flag rather than the master buffer. I ran into a > case where this was a problem: One child document did not have that flag > set, so it was issuing \prettyref rather than \fnref, e.g., which led to > inconsistencies. I assume we do need this in the other output routines > and can do that, but wanted to check with you first. > The patch looks fine to me, I don't think it should cause any issues. However, I'm not sure that child documents are properly supported in DocBook (if it is, it's not super-well tested). > --- > > src/insets/InsetRef.cpp |8 > > 1 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp > > index 0938b47..277f8e5 100644 > > --- a/src/insets/InsetRef.cpp > > +++ b/src/insets/InsetRef.cpp > > @@ -260,12 +260,12 @@ void InsetRef::latex(otexstream & os, OutputParams > const & rp) const > > { > > string const & cmd = getCmdName(); > > docstring const & data = getEscapedLabel(rp); > > - bool const hyper_on = buffer().params().pdfoptions().use_hyperref; > > + bool const hyper_on = > buffer().masterParams().pdfoptions().use_hyperref; > > > > if (rp.inulemcmd > 0) > > os << "\\mbox{"; > > > > - if (buffer().params().use_refstyle && cmd == "eqref") { > > + if (buffer().masterParams().use_refstyle && cmd == "eqref") { > > // we advertise this as printing "(n)", so we'll do that, > at least > > // for refstyle, since refstlye's own \eqref prints, by > default, > > // "equation n". if one wants \eqref, one can get it by > using a > > @@ -281,7 +281,7 @@ void InsetRef::latex(otexstream & os, OutputParams > const & rp) const > > docstring prefix; > > bool const use_caps = getParam("caps") == "true"; > > bool const use_plural = getParam("plural") == "true"; > > - bool const use_refstyle = buffer().params().use_refstyle; > > + bool const use_refstyle = > buffer().masterParams().use_refstyle; > > docstring const fcmd = > > getFormattedCmd(data, label, prefix, use_refstyle, > use_caps); > > os << fcmd; > > @@ -576,7 +576,7 @@ void InsetRef::validate(LaTeXFeatures & features) > const > > docstring const data = > getEscapedLabel(features.runparams()); > > docstring label; > > docstring prefix; > > - bool const use_refstyle = buffer().params().use_refstyle; > > + bool const use_refstyle = > buffer().masterParams().use_refstyle; > > bool const use_caps = getParam("caps") == "true"; > > docstring const fcmd = > > getFormattedCmd(data, label, prefix, use_refstyle, > use_caps); > > > -- > > Richard Kimberly (Riki) Heck > Professor of Philosophy > Brown University > > Pronouns: they/them/their > > Website: http://rkheck.frege.org/ > Blog:http://rikiheck.blogspot.com/ > Amazon: http://amazon.com/author/richardgheckjr > Google Scholar: https://scholar.google.com/citations?user=QUKBG6EJ > ORCID: http://orcid.org/-0002-2961-2663 > Research Gate: https://www.researchgate.net/profile/Richard_Heck > > -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Packaging ZFS
> Le 10 août 2023 à 22:25, Philip Prindeville > a écrit : > > > >> On Aug 10, 2023, at 11:49 AM, Torbjörn Jansson wrote: >> >> On 2023-08-06 21:39, Philip Prindeville wrote: >>> I don't know... I have a Xeon D-1548 based 1U Supermicro server with a 4TB >>> NVMe stick that would make a decent file server/NAS... On Aug 6, 2023, at 11:46 AM, Paul D wrote: Pretty sure not. I'm receptive to ZFS and have used it in a few projects. Openwrt tends to focus on (devices with) smaller flash drives. Other FS better suited to such env. No ZFS is in available software packages today, in any case. On 2023-08-06 00:53, Philip Prindeville wrote: > Has anyone tried to package ZFS (more correctly, OpenZFS) for OpenWRT? > Is there any interest in doing so? > > https://github.com/openzfs/zfs > > > >> >> you could always run openwrt as a vm under a hypervisor, for example proxmox. >> then you can keep openwrt without any extra packages like zfs and create >> extra vms as needed, proxmox already supports zfs if im not mistaken. >> >> if your lucky with the iommu groups you might even be able to pass thru one >> or more physical network interfaces to the openwrt vm directly. > > > > I can't assume that the underlying hardware supports virtualization or does > so in a meaningful way. Some of the platforms I'm looking at are resource > lean. I threw out the Xeon-D as an example as my prototyping hardware, but > I'm not going to assume that everyone has comparable hardware. ZFS is anything *but* resource lean, though. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: Beta 3 On FTP Now
On Tue, 4 Jul 2023 at 00:02, Pavel Sanda wrote: > On Mon, Jul 03, 2023 at 10:53:52PM +0200, Pavel Sanda wrote: > > please can you have a look on few 2.4 related bugs: > > https://www.lyx.org/trac/ticket/12786 > > https://www.lyx.org/trac/ticket/12803 > > https://www.lyx.org/trac/ticket/10364 > > And there was also bug report on users list: > "in the last windows version there are no more icons for LyX documents." > That's not something I can reproduce (but it's far from a clean machine, LyX-wise!). Maybe that user first installed LyX 2.4, then removed 2.3, with file associations being removed at the same time as 2.3? That's a problem I've had with other programs. -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: [PATCH] Is there a reason for not using macros with arguments in lib/symbols?
On Sat, 22 Jul 2023 at 00:00, Jean-Marc Lasgouttes wrote: > Le 18/07/2023 à 15:11, Jean-Marc Lasgouttes a écrit : > > Hello, > > > > In the attached patch, I am able to support the mod/bmod/pmod/pod macros > > by just defining them in lib/symbols with an argument. > > > > The result is a more pleasing editing process (IMO) and a simplification > > of the documentation. > > It is in now. > Your change with arguments doesn't cause any real trouble for MathML output, it works as expected. However, it highlighted a problem with InsetMathClass: it would output something like [mathbin [char + mathalpha]] instead of +, due to the use of \mathbin when you define \bmod. I'm fixing that with the attached patch. Could you (or anyone else) please commit the attached patch? I currently don't have access to the Git repo via SSH :/. Thanks! From 4c868a476eca6cad8b7a9db29e560e27f4ceb579 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Thu, 27 Jul 2023 02:43:56 +0200 Subject: [PATCH] MathML: implement InsetMathClass. Before this patch, each character within InsetMathClass was output separately, without understanding their meaning, using the default text output (with [] around each character). This commit changes the behaviour to skip the InsetMathClass during the MathML output. This effectively renders the inset useless for MathML (instead of controlling spacing), as expected, because the MathML processor is supposed to handle the spacing itself. Another implementation would have been to use the lspace and rspace attributes in MathML, but they require to give the exact spacing before and after the operator instead of relying on rules like TeX. For instance, `$a\mathbin{+}b$` resulted in this MathML output before the patch: ``` a [mathbin [char + mathalpha]] b ``` For comparison, this was the output with LyX 2.3.7 ``` http://www.w3.org/1998/Math/MathML;> a [mathbin [char + mathalpha]] b ``` After this patch, it looks like: ``` a + b ``` --- src/mathed/InsetMathClass.cpp | 11 +++ src/mathed/InsetMathClass.h | 2 ++ src/mathed/MathClass.h| 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/mathed/InsetMathClass.cpp b/src/mathed/InsetMathClass.cpp index 0c22d478c7..2bfea82ce0 100644 --- a/src/mathed/InsetMathClass.cpp +++ b/src/mathed/InsetMathClass.cpp @@ -11,6 +11,7 @@ #include #include "InsetMathClass.h" +#include "MathStream.h" #include "support/docstream.h" @@ -56,6 +57,16 @@ void InsetMathClass::write(TeXMathStream & os) const } +void InsetMathClass::mathmlize(MathMLStream & ms) const +{ + // Skip the \mathXXX macro, the MathML processor is supposed to handle + // spacing down the line. + for (size_t i = 0; i < nargs(); ++i) { + ms << cell(i); + } +} + + docstring InsetMathClass::name() const { return class_to_string(math_class_); diff --git a/src/mathed/InsetMathClass.h b/src/mathed/InsetMathClass.h index 89189f2b0d..f4308beb9b 100644 --- a/src/mathed/InsetMathClass.h +++ b/src/mathed/InsetMathClass.h @@ -43,6 +43,8 @@ public: /// void write(TeXMathStream & os) const override; /// + void mathmlize(MathMLStream & ms) const override; + /// void infoize(odocstream & os) const override; /// InsetCode lyxCode() const override { return MATH_CLASS_CODE; } diff --git a/src/mathed/MathClass.h b/src/mathed/MathClass.h index 169bfdb51a..af4f884cca 100644 --- a/src/mathed/MathClass.h +++ b/src/mathed/MathClass.h @@ -40,7 +40,7 @@ class MetricsBase; * + Vcent: a vbox to be centered, produced by \vcenter. * * Over, Under, Acc, Rad and Vcent are not considered in the enum - * below. The relvant elements will be considered as Ord. + * below. The relevant elements will be considered as Ord. */ enum MathClass { MC_ORD, -- 2.41.0.windows.1 -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: [PATCH] Is there a reason for not using macros with arguments in lib/symbols?
On Tue, 18 Jul 2023 at 16:55, Jean-Marc Lasgouttes wrote: > Le 18/07/2023 à 16:47, Thibaut Cuvelier a écrit : > > On Tue, 18 Jul 2023 at 16:04, Jean-Marc Lasgouttes > <mailto:lasgout...@lyx.org>> wrote: > > > > Le 18/07/2023 à 15:54, Thibaut Cuvelier a écrit : > > > Also, we already have macros with parameters: > > > https://github.com/cburschka/lyx/blob/master/lib/symbols#L1223 > > <https://github.com/cburschka/lyx/blob/master/lib/symbols#L1223> > > > <https://github.com/cburschka/lyx/blob/master/lib/symbols#L1223 > > <https://github.com/cburschka/lyx/blob/master/lib/symbols#L1223>> > > > > Indeed. I'm the one who pushed that, but it did not impress me at the > > time ;) And my question stands somehow, since I did not ask at the > time. > > > > I'll push that then. I like the idea of using code as close as > possible > > to the LaTeX we want to emulate. > > > > > > Could you please just add a TODO near the DocBook/XHTML code, so that I > > can think about implementing the parameter mechanism at some point? > > > You mean in lib/symbols? Or in some real code? > Any of them would be fine :)! -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: [PATCH] Is there a reason for not using macros with arguments in lib/symbols?
On Tue, 18 Jul 2023 at 16:04, Jean-Marc Lasgouttes wrote: > Le 18/07/2023 à 15:54, Thibaut Cuvelier a écrit : > > Also, we already have macros with parameters: > > https://github.com/cburschka/lyx/blob/master/lib/symbols#L1223 > > <https://github.com/cburschka/lyx/blob/master/lib/symbols#L1223> > > Indeed. I'm the one who pushed that, but it did not impress me at the > time ;) And my question stands somehow, since I did not ask at the time. > > I'll push that then. I like the idea of using code as close as possible > to the LaTeX we want to emulate. > Could you please just add a TODO near the DocBook/XHTML code, so that I can think about implementing the parameter mechanism at some point? -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: [PATCH] Is there a reason for not using macros with arguments in lib/symbols?
On Tue, 18 Jul 2023 at 15:45, Jean-Marc Lasgouttes wrote: > Le 18/07/2023 à 15:36, Thibaut Cuvelier a écrit : > > For the symbols in your patch, yes, export is currently broken, but it's > > fixable. > > I think it would still be fixable in the future with macros, as I did in > > https://github.com/cburschka/lyx/blob/master/lib/symbols#L1128 > > <https://github.com/cburschka/lyx/blob/master/lib/symbols#L1128>. > > Yes, but macros with parameters? > I did not notice that in your patch (I'm avoiding low-level LaTeX, I find it scary...). It's not currently supported, but we can implement a mechanism like this. #1 and others are not used a lot (and we can implement escaping). Also, we already have macros with parameters: https://github.com/cburschka/lyx/blob/master/lib/symbols#L1223 -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: [PATCH] Is there a reason for not using macros with arguments in lib/symbols?
On Tue, 18 Jul 2023 at 15:11, Jean-Marc Lasgouttes wrote: > Hello, > > In the attached patch, I am able to support the mod/bmod/pmod/pod macros > by just defining them in lib/symbols with an argument. > > The result is a more pleasing editing process (IMO) and a simplification > of the documentation. > > Since this use of \def is not documented, I have to ask: is there a > reason for not doing it? > > One downside may be that exporting to html/docbook does not really work, > but it has always been the case, AFAIK. > For the symbols in your patch, yes, export is currently broken, but it's fixable. I think it would still be fixable in the future with macros, as I did in https://github.com/cburschka/lyx/blob/master/lib/symbols#L1128. My question is: should I create a full-fledged math inset instead? It is > doable too, nd at least I'd get the spacing right depending on the > context (script...). > > JMarc-- > -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Windows Dark Mode and "fusion" style
On Fri, 7 Jul 2023 at 10:13, Yu Jin wrote: > Am Fr., 7. Juli 2023 um 04:37 Uhr schrieb Thibaut Cuvelier: > >> I'm having an issue with your patch: QStyle::name has only been added in >> Qt 6.1 (https://doc.qt.io/qt-6/qstyle.html#name). I believe >> QObject::objectName should do the trick too. >> >> As I understand your problem, in LyX.cpp, LyX::exec first creates a >> GuiApplication (line 358) before initialising LyX (line 366). If I do the >> initialisation in GuiApplication::exec instead, I don't get any crash; >> actually, your patch works :)! >> I have added a similar line in PrefInput::applyRC so that the style >> change applies immediately when clicking Apply in the Preferences window. >> > > I think it is actually better to do that in PrefUserInterface::applyRC for > affiliation. > To be honest, I took a place that might match and where the code worked. I tried to understand the differences between these functions, but I couldn't get it. A bit of documentation would have helped > I'm attaching the corresponding patch. >> > > I didn't understand this part: > @@ -718,13 +718,13 @@ GuiView::GuiView(int id) > connect(zoom_value_, SIGNAL(pressed()), this, > SLOT(showZoomContextMenu())); > // zoom_value_->setPalette(palette); > zoom_value_->setForegroundRole(statusBar()->foregroundRole()); > zoom_value_->setFixedHeight(fm.height()); > #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) > - zoom_value_->setMinimumWidth(fm.horizontalAdvance("444\%")); > + zoom_value_->setMinimumWidth(fm.horizontalAdvance("444%")); > #else > - zoom_value_->setMinimumWidth(fm.width("444\%")); > + zoom_value_->setMinimumWidth(fm.width("444%")); > #endif > zoom_value_->setAlignment(Qt::AlignCenter); > zoom_value_->setText(toqstr(bformat(_("[[ZOOM]]%1$d%"), zoom))); > statusBar()->addPermanentWidget(zoom_value_); > zoom_value_->setEnabled(currentBufferView()); > It's just fixing a few compiler warnings, it doesn't have to be in the same patch. > Side question: why is createApplication declared in Application.h but >> defined in GuiApplication.cpp? >> >> >> On Fri, 7 Jul 2023 at 02:23, Thibaut Cuvelier wrote: >> >>> Can't you use setStyle later on, once LyXRC is read? >>> >> > You could, like in your patch, but this creates another problem (see below) > > >> I suspect it should be enough to apply the style to the whole >>> application, based on the source code ( >>> https://github.com/qt/qtbase/blob/dev/src/widgets/kernel/qapplication.cpp#L971), >>> as I understand that GuiApplication is the root widget for the whole LyX. >>> >>> Also, I believe that LyXRC shouldn't take precedence over CLI arguments >>> (-style windows, for instance); does Qt implement this itself or do we have >>> to check in QCoreApplication::arguments if a style is given? >>> >> > I believe the way would be to set the style *before* the QApplication is > created, then if any style is given in CLI arguments, QApplication uses > that over the one previously set. > > I don't know, to me it seems we *need* to know style setting from lyxrc > before we create the gui app > frontend::GuiApplication * guiApp = new frontend::GuiApplication(argc, > argv); > which is not given. > otherwise we would need to check cli arguments manually for "-style" and I > don't want to do that, if Qt decides to change those in the future we would > have to put more work into it. > What can be done is calling readRcFile("preferences", true) before > CreateApplication, like I have done here in the attached patch, but I don't > know if that is ok or not, it seems to work, but I can't assess it 100%, > any ideas/objections? > Qt hasn't changed its -style parameter at least since Qt 4 (2005), that's quite stable (there is also an environment variable, QT_STYLE_OVERRIDE). I couldn't find any way to tell if the style was set from the command line or not (or to get the default style for the current platform), so we would always need to check manually whether there has been some CLI-set style, whatever path we end up taking. (There is some precedent with locale handling, where Qt is trying hard to impose its locale, it seems.) (More details: the -style parameter is dealt with in QGuiApplicationPrivate, not accessible from LyX and not available anywhere in the API, as far as I can tell.) As Qt can dynamically change the style at runtime, why would you need to know it when instantiating GuiApplication? Anyway, in my patch, the style is set before calling QApplication::exec, before any user interaction can take place
Re: Windows Dark Mode and "fusion" style
I'm having an issue with your patch: QStyle::name has only been added in Qt 6.1 (https://doc.qt.io/qt-6/qstyle.html#name). I believe QObject::objectName should do the trick too. As I understand your problem, in LyX.cpp, LyX::exec first creates a GuiApplication (line 358) before initialising LyX (line 366). If I do the initialisation in GuiApplication::exec instead, I don't get any crash; actually, your patch works :)! I have added a similar line in PrefInput::applyRC so that the style change applies immediately when clicking Apply in the Preferences window. I'm attaching the corresponding patch. Side question: why is createApplication declared in Application.h but defined in GuiApplication.cpp? Thibaut Cuvelier On Fri, 7 Jul 2023 at 02:23, Thibaut Cuvelier wrote: > On Thu, 6 Jul 2023 at 10:34, Yu Jin wrote: > >> Am Do., 6. Juli 2023 um 03:47 Uhr schrieb Thibaut Cuvelier: >> >>> On Wed, 5 Jul 2023 at 22:02, Enrico Forestieri wrote: >>> >>>> On Wed, Jul 05, 2023 at 08:42:21PM +0200, Pavel Sanda wrote: >>>> > >>>> >I think your patch should go for windows port only as it would >>>> probably >>>> >interfere with ppl choosing windows style under linux (yes, apparently >>>> >there are users choosing this as I read users list). >>>> >>>> I don't think this is a good idea because LyX would look different from >>>> any other application. >>>> >>> >>> +1, the Fusion style isn't native at all (the colours are completely >>> off, for instance). Maybe some users will like it, though (like the author >>> of https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5). >>> >>> However, it seems that the classic Windows theme has a dark mode >>> starting with Qt 6.5 (out since April): >>> https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5. The Windows >>> style, both in Qt 5 and Qt 6, is horrible, though... Here is what it looks >>> like (2.4 beta 3 with Qt 6.5.1 as built by Eugene; run with: >>> .\LyX.exe -platform windows:darkmode=2 -style windows >>> ): >>> >>> What's strange is that the situation isn't much better for Qt Quick, >>> with no native Windows dark theme. There are other open-source projects >>> that provide a good Windows theme that also works in dark, such as >>> https://github.com/witalihirsch/QTWin11 for Python only or >>> https://github.com/marunemitsu/QTFluent (very modern style, unlike the >>> default Vista one). I have seen good results with >>> https://github.com/ColinDuquesnoy/QDarkStyleSheet (but not with its >>> light theme!), which is more or less maintained and should work with Qt 6 >>> (not PyQt 6 out of the box, though). Wireshark went that route, but the >>> code didn't get merged ( >>> https://gitlab.com/wireshark/wireshark/-/merge_requests/6382). >>> >>> Overall, it seems that Qt's dark theme for Windows is inexistent; their >>> preferred solution is to avoid implementing a proper theme, so that people >>> have to rely on unmaintained projects or use their own solution. They rely >>> consider it done ( >>> https://bugreports.qt.io/browse/QTBUG-72028#comment-712180)! >>> >>> How complex would it be to have a new LyX setting to choose the Qt >>> theme? I believe it should not be too hard, as you can change the style on >>> QApplication. Or is there something I'm missing? >>> >> >> I tried my luck here (patch attached) but it is not working though. While >> I think I got the UI and LyXRC right, the problem is that at the time of >> creation of QApplication the LyXRC is initialized but not read, so the >> saved style preference is not available. >> >> This stacktrace is from application creation: >> LyX.exe!lyx::createApplication(int & argc, char * * argv) Zeile 224 C++ >> LyX.exe!lyx::LyX::exec(int & argc, char * * argv) Zeile 358 C++ >> LyX.exe!main(int argc, char * * argv) Zeile 55 C++ >> >> This one from LyXRC reading: >> LyX.exe!lyx::LyXRC::read(lyx::Lexer & lexrc, bool check_format) Zeile >> 608 C++ >> LyX.exe!lyx::LyXRC::read(const lyx::support::FileName & filename, bool >> check_format) Zeile 242 C++ >> LyX.exe!lyx::LyX::readRcFile(const std::string & name, bool >> check_format) Zeile 1148 C++ >> LyX.exe!lyx::LyX::init() Zeile 998 C++ >> LyX.exe!lyx::LyX::init(int & argc, char * * argv) Zeile 483 C++ >> LyX.exe!lyx::LyX::exec(int & argc, char * * argv) Zeile 366 C++ >> LyX.exe!main(int argc, char * * argv)
Re: Windows Dark Mode and "fusion" style
On Thu, 6 Jul 2023 at 10:34, Yu Jin wrote: > Am Do., 6. Juli 2023 um 03:47 Uhr schrieb Thibaut Cuvelier: > >> On Wed, 5 Jul 2023 at 22:02, Enrico Forestieri wrote: >> >>> On Wed, Jul 05, 2023 at 08:42:21PM +0200, Pavel Sanda wrote: >>> > >>> >I think your patch should go for windows port only as it would probably >>> >interfere with ppl choosing windows style under linux (yes, apparently >>> >there are users choosing this as I read users list). >>> >>> I don't think this is a good idea because LyX would look different from >>> any other application. >>> >> >> +1, the Fusion style isn't native at all (the colours are completely off, >> for instance). Maybe some users will like it, though (like the author of >> https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5). >> >> However, it seems that the classic Windows theme has a dark mode starting >> with Qt 6.5 (out since April): >> https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5. The Windows >> style, both in Qt 5 and Qt 6, is horrible, though... Here is what it looks >> like (2.4 beta 3 with Qt 6.5.1 as built by Eugene; run with: >> .\LyX.exe -platform windows:darkmode=2 -style windows >> ): >> >> What's strange is that the situation isn't much better for Qt Quick, with >> no native Windows dark theme. There are other open-source projects that >> provide a good Windows theme that also works in dark, such as >> https://github.com/witalihirsch/QTWin11 for Python only or >> https://github.com/marunemitsu/QTFluent (very modern style, unlike the >> default Vista one). I have seen good results with >> https://github.com/ColinDuquesnoy/QDarkStyleSheet (but not with its >> light theme!), which is more or less maintained and should work with Qt 6 >> (not PyQt 6 out of the box, though). Wireshark went that route, but the >> code didn't get merged ( >> https://gitlab.com/wireshark/wireshark/-/merge_requests/6382). >> >> Overall, it seems that Qt's dark theme for Windows is inexistent; their >> preferred solution is to avoid implementing a proper theme, so that people >> have to rely on unmaintained projects or use their own solution. They rely >> consider it done ( >> https://bugreports.qt.io/browse/QTBUG-72028#comment-712180)! >> >> How complex would it be to have a new LyX setting to choose the Qt theme? >> I believe it should not be too hard, as you can change the style on >> QApplication. Or is there something I'm missing? >> > > I tried my luck here (patch attached) but it is not working though. While > I think I got the UI and LyXRC right, the problem is that at the time of > creation of QApplication the LyXRC is initialized but not read, so the > saved style preference is not available. > > This stacktrace is from application creation: > LyX.exe!lyx::createApplication(int & argc, char * * argv) Zeile 224 C++ > LyX.exe!lyx::LyX::exec(int & argc, char * * argv) Zeile 358 C++ > LyX.exe!main(int argc, char * * argv) Zeile 55 C++ > > This one from LyXRC reading: > LyX.exe!lyx::LyXRC::read(lyx::Lexer & lexrc, bool check_format) Zeile > 608 C++ > LyX.exe!lyx::LyXRC::read(const lyx::support::FileName & filename, bool > check_format) Zeile 242 C++ > LyX.exe!lyx::LyX::readRcFile(const std::string & name, bool > check_format) Zeile 1148 C++ > LyX.exe!lyx::LyX::init() Zeile 998 C++ > LyX.exe!lyx::LyX::init(int & argc, char * * argv) Zeile 483 C++ > LyX.exe!lyx::LyX::exec(int & argc, char * * argv) Zeile 366 C++ > LyX.exe!main(int argc, char * * argv) Zeile 55 C++ > > second function from bottom: line 358 vs 366. > > Any ideas what I could do here? > Can't you use setStyle later on, once LyXRC is read? I suspect it should be enough to apply the style to the whole application, based on the source code ( https://github.com/qt/qtbase/blob/dev/src/widgets/kernel/qapplication.cpp#L971), as I understand that GuiApplication is the root widget for the whole LyX. Also, I believe that LyXRC shouldn't take precedence over CLI arguments (-style windows, for instance); does Qt implement this itself or do we have to check in QCoreApplication::arguments if a style is given? -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
[MARMAM] New publication: Survival of an Indian Ocean humpback dolphin Sousa plumbea in the wild despite chronic osteologic pathologies
Dear colleagues, My co-authors and I are pleased to announce the publication of this article: Lingham-Soliar T, Bloodgood J, Rothschild B, Bouveroux T (2023) Survival of an Indian Ocean humpback dolphin Sousa plumbea in the wild despite chronic osteologic pathologies. Diseases of Aquatic Organisms,154: 49-57. The link to the manuscript and abstract can be found below and interested people are invited to send me an email to request PDF copies. https://www.int-res.com/abstracts/dao/v154/p49-57/ Abstract: Skeletal examination of a female adult Indian Ocean humpback dolphin Sousa plumbea from South Africa suggested a chronic disease process. It manifested as erosions and pitting of the atlanto-occipital articulation as well as circumferential hyperostosis and ankylosis of some of the caudal vertebrae, findings rarely recorded together in the same animal. The character of the erosive process and vertebral fusion appeared chronic, and further findings of underdevelopment of the fluke, sternum and left humerus with remodeling of the periarticular region of the left scapula may support initiation of the process early in life. Because such chronic pathology would have affected the individual’s locomotion and foraging abilities, we also postulate how this individual survived until its demise in a human-derived environmental hazard. Ecological and socio-behavioral aspects observed in S. plumbea, including habitat preference for inshore and shallow waters, small social group aggregations and feeding cooperation, may have contributed to its ability to survive. Best regards, Thibaut Bouveroux, PhD Dauphin Island Sea Lab, AL, USA ___ MARMAM mailing list MARMAM@lists.uvic.ca https://lists.uvic.ca/mailman/listinfo/marmam
Re: Packages buildbot is erratic, both master and 23.05 packages fail often
> Le 3 juin 2023 à 10:27, Hannu Nyman a écrit : > > Petr Štetiar kirjoitti 2.6.2023 klo 22.07: >> So having following in buildbot log: >> >> 2023-06-01 23:53:12+ [-] command timed out: 3600 seconds without output >> running [b'make', b'-j7', b'IGNORE_ERRORS=n m y', b'BUILD_LOG=1', >> b'CONFIG_AUTOREMOVE=y', b'CONFIG_SIGNED_PACKAGES='], attempting to kill >> 2023-06-01 23:53:12+ [-] trying to kill process group 1528179 >> >> I've looked at the system logs around that time and found following: >> >> Jun 01 22:23:19 audit[3844576]: AVC apparmor="DENIED" operation="mkdir" >> info="Failed name lookup - name too long" >> error=-36 profile="docker-default" >> >> name="/shared-workdir/build/sdk/build_dir/hostpkg/gettext-0.21.1/gettext-tools/confdir3/confdir3/confdir3/confdir3...[snip >> very long repeating pattern]... >> confdir3/confdir3/confdir3/confdir3/confdir3" pid=3844576 >> comm="conftest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000 >> Jun 01 22:23:45 kernel: conftest[3855174]: segfault at 0 ip >> 7fe9581067e7 sp 7ffd94ca2118 error 4 in >> libc-2.31.so[7fe958085000+159000] >> ... >> >> Since the host is shared with other 3 build workers I can't be sure, that it >> originated from that timeouted build. >> > > Looking at that observation about gettext and recursive "confdir3/", it is > plausible that gettext has problem that manifests in some builds, or trouble > with parallelism on some occasions. > > Gettext was heavily reorganised in May, near the same time as the buildbot > code was revamped. So, this might quite well be related to the gettext > package and not the new buildbot code. At the risk of repeating myself, there is *no* new buildbot code for phase2. They are still running the same old code from March 2022: https://buildbot.staging.openwrt.org/master/packages/#/about https://buildbot.staging.openwrt.org/openwrt-23.05/packages/#/about […] > No gettext completion before the final timeout error. Hunderds of other > packages were compiled in the time when gettext was was being recursively > compiled? I wouldn’t pay too much attention to this build failure until the space problems are resolved. Running out of space can wreck havoc in many different ways and we may simply be looking at side effects (possibly across containers) of that. My 2c. T. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: Packages buildbot is erratic, both master and 23.05 packages fail often
Hi, > Le 2 juin 2023 à 21:07, Petr Štetiar a écrit : > > Thibaut [2023-06-02 11:09:48]: > > Hi, > >> the build is actually hung. dmesg might have more info. > > So having following in buildbot log: > > 2023-06-01 23:53:12+ [-] command timed out: 3600 seconds without output > running [b'make', b'-j7', b'IGNORE_ERRORS=n m y', b'BUILD_LOG=1', > b'CONFIG_AUTOREMOVE=y', b'CONFIG_SIGNED_PACKAGES='], attempting to kill > 2023-06-01 23:53:12+ [-] trying to kill process group 1528179 > > I've looked at the system logs around that time and found following: > > Jun 01 22:23:19 audit[3844576]: AVC apparmor="DENIED" operation="mkdir" > info="Failed name lookup - name too long" > error=-36 profile="docker-default" > > name="/shared-workdir/build/sdk/build_dir/hostpkg/gettext-0.21.1/gettext-tools/confdir3/confdir3/confdir3/confdir3...[snip > very long repeating pattern]... >confdir3/confdir3/confdir3/confdir3/confdir3" pid=3844576 > comm="conftest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000 > Jun 01 22:23:45 kernel: conftest[3855174]: segfault at 0 ip 7fe9581067e7 > sp 7ffd94ca2118 error 4 in libc-2.31.so[7fe958085000+159000] > > Jun 01 22:23:45 kernel: Code: 00 00 00 48 39 d1 0f 82 47 67 06 00 0f 1f 80 00 > 00 00 00 48 89 f8 48 83 fa 10 0f 82 fa 00 00 00 48 83 fa 20 0f 87 3f 01 00 00 > <0f> 10 06 0f 10 4c 16 f0 0f 11 07 0f 11 4c 17 f0 c3 0f 1f 84 00 00 > > Since the host is shared with other 3 build workers I can't be sure, that it > originated from that timeouted build. Whether or not this was the cause of the timeout, it still looks suspicious. Then again, it may also be a side effect of running out of space (possibly a looped symlink?) The timeout logs aren’t available any more but on second thought I wonder if they too could simply be a side effect of OOS. >> I’m happy to share my config if interested, it’s not a very complex setup. > > That would be appreciated, thanks! Will followup in separate channel. Cheers, T ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: Packages buildbot is erratic, both master and 23.05 packages fail often
Hi, > Le 2 juin 2023 à 07:43, Petr Štetiar a écrit : > > Thibaut [2023-06-01 18:21:22]: > > Hi, > >>> There has been many timeouts of "3600 seconds without output" in master, >> >> These look like connectivity issues. > > I'm not sure, as there is a keep alive going on between master/worker so > master would remove the worker quite sooner due to keep alive response > timeout, wouldn't it? Putting asside some buildbot bugs of course. You are correct, I was talking out of my rear end ;) This is not a connectivity issue, the build is actually hung. dmesg might have more info. > Workers osuosl-dock-09,10,11,12 are on one build host and > osuosl-dock-05,06,07,08 are on the second build host, wouldn't they have same > connectivity issues at the same time? Correct. I noticed you adjusted cpu affinity, on NUMA nodes it helps performance. On my buildbot setup I used cgroups and assigned each buildworker to a specific cgroup, which enables me to adjust CPU affinity *and* memory affinity, which you also want. It also enables you to easily set memory limits for each build worker. I’m happy to share my config if interested, it’s not a very complex setup. > I'm not saying it's not possible, there has been similar network issues in the > past, so it might be it. > >>> and quite too many "out of space" errors in the 23.05 packages buildbot. >> >> 23.05 package builders are nearly all out of space, possibly due to >> accumulated cruft in dl dir. > > from the quick look it seems like Rust has increased the disk space > requirements in shared work directory. I’m confused with that sentence: the du step shows 36G used, but df says all 60G are full; which suggests something *outside* of the build directory is eating space? Cheers, Thibaut ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel