Bug 96208 - Extend formula editor to use TeX annotation at least on import
Summary: Extend formula editor to use TeX annotation at least on import
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 119449 (view as bug list)
Depends on:
Blocks: Formula-Editor
  Show dependency treegraph
 
Reported: 2015-12-02 15:43 UTC by jakj
Modified: 2020-07-16 14:49 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
mml Dateien mit und ohne Annotation und odf Datei mit egänderter Content.xml Datei vor und nach dem Speichern (7.28 KB, application/zip)
2015-12-02 15:43 UTC, jakj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jakj 2015-12-02 15:43:10 UTC
Created attachment 120962 [details]
mml Dateien mit und ohne Annotation und odf Datei mit egänderter Content.xml Datei vor und nach dem Speichern

Testverlauf:
Der folgende TeX-Code wird mit MathJax 
 
 \lim\limits_{n \to \infty}\frac{1}{n} = 1
 
zunächst zum folgenden MathML-Code OHNE Annotation umgewandelt:

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <munder>
    <mo form="prefix">lim</mo>
    <mrow class="MJX-TeXAtom-ORD">
      <mi>n</mi>
      <mo stretchy="false">&#x2192;<!-- → --></mo>
      <mi mathvariant="normal">&#x221E;<!-- ∞ --></mi>
    </mrow>
  </munder>
  <mfrac>
    <mn>1</mn>
    <mi>n</mi>
  </mfrac>
  <mo>=</mo>
  <mn>1</mn>
</math>

Egal ob man diese Variante oder die um die Annotationszeile ergänzte Variante:

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <semantics>
    <mrow>
      <munder>
        <mo form="prefix">lim</mo>
        <mrow class="MJX-TeXAtom-ORD">
          <mi>n</mi>
          <mo stretchy="false">&#x2192;<!-- → --></mo>
          <mi mathvariant="normal">&#x221E;<!-- ∞ --></mi>
        </mrow>
      </munder>
      <mfrac>
        <mn>1</mn>
        <mi>n</mi>
      </mfrac>
      <mo>=</mo>
      <mn>1</mn>
    </mrow>
    <annotation encoding="application/x-tex">\lim\limits_{n \to \infty}\frac{1}{n} = 1</annotation>
  </semantics>
</math>

in die Content.xml Datei einer OpenDocument Formel Datei (Endung.odf) einfügt, oder aber ob man diese Formel jeweils in eine .mml Datei einfügt (mit führendem <?xml version="1.0" encoding="UTF-8" ?>), so wird in allen vier Fällen der MathML-Code jeweils identisch fälschlicherweise importiert als

{lcsub {italic "n"  rightarrow  italic "∞"} italic "1" over italic "n" =italic "1"}

Nach einem erneuten Abspeichern ändert sich der Inhalt der Content.xml Datei dann entsprechend ebenfalls fehlerhaft zu:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
    <semantics>
        <mrow>
            <mi mathvariant="italic">lcsub</mi>
        <mrow>
            <mstyle mathvariant="italic">
                <mtext>n</mtext>
            </mstyle>
            <mo stretchy="false">→</mo>
            <mstyle mathvariant="italic">
                <mtext>∞</mtext>
            </mstyle>
        </mrow>
        <mrow>
            <mfrac>
                <mstyle mathvariant="italic">
                    <mtext>1</mtext>
                </mstyle>
                <mstyle mathvariant="italic">
                    <mtext>n</mtext>
                </mstyle>
            </mfrac>
            <mo stretchy="false">=</mo>
            <mstyle mathvariant="italic">
                <mtext>1</mtext>
            </mstyle>
        </mrow>
        </mrow>
        <annotation encoding="StarMath 5.0">{lcsub {italic &quot;n&quot;  rightarrow  italic &quot;∞&quot;} italic &quot;1&quot; over italic &quot;n&quot; =italic &quot;1&quot;}</annotation>
    </semantics>
</math>

Daher die Frage: Ist es möglich, den LibreOffice-Math MathML Importfilter auf alle z.B. im online-Formeleditor http://quizdidaktik.de/formeleditor/ enthaltenen Formelauszeichnungselemente zu erweitern ODER alternativ auch eine direkte LaTeX-Annotationszeile zu unterstützen, bei deren Vorhandensein dann umgekehrt der MathML-Abschnitt ergänzt wird?
Comment 1 Buovjaga 2015-12-04 20:00:09 UTC
In English, bitte.

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information in English.
Comment 2 Regina Henschel 2015-12-05 21:44:31 UTC
The report is about several topics.

One topic is about the faulty import as "italic". That bug has been reported in https://bugs.documentfoundation.org/show_bug.cgi?id=75171 and is fixed in Lo 5.1.
jakj@kronberg-gymnasium.de: Please try the LO5.1 beta, available from http://dev-builds.libreoffice.org/pre-releases/

Next topic is about extend StarMath with more symbols.
jakj@kronberg-gymnasium.de: You can add arbitrary symbols to the catalog. Inside StarMath they are used by means of the "%" sign. On export the original Unicode character is used. To get a special character without the need of the % sign, write a bug report for this character. Please add, why this character is so important, that the way by "%" is not enough.

Next topic is about using LaTeX in LibreOffice. The ODF file format has specified, that MathML is used for typesetting formulas. And MathML allows to have several annotations at the same time. So from the view of file format it would be possible. But currently there is no one working on such UI.

jakj@kronberg-gymnasium.de: For your personal needs an extension might help. I have seen http://extensions.libreoffice.org/extension-center/texmaths-1 or http://roland65.free.fr/texmaths/, but I have not tested it.

jakj@kronberg-gymnasium.de: When you try LibreOffice 5.1, you will notice a new feature in the formula editor Tools menu. It is now possible to import MathML via clipboard. So you can copy the MathML source from http://quizdidaktik.de/formeleditor/ or from MathJax or from Composer (part of browser Seamonkey) and import it. It will be changed to StarMath on import.

If this bug is kept, then I suggest to use it for the feature request to make the StarMath UI capable to use LaTeX. I have not found such request for LibreOffice in Bugzilla. For OpenOffice it is https://bz.apache.org/ooo/show_bug.cgi?id=2864
Comment 3 Miklos Vajna 2016-05-06 16:42:59 UTC
Can you please also translate the summary of this bug? Thanks!
Comment 4 V Stuart Foote 2018-08-26 14:24:55 UTC
*** Bug 119449 has been marked as a duplicate of this bug. ***
Comment 5 mirko.pieropan 2019-09-08 09:15:25 UTC
Hello, I'm interested in this LaTeX input enhancement too. What is the situation at present?
I'd like to add a couple of comments/suggestions. It'd be nice if formulas were inserted at the current position of the cursor, rather than at the center of the page (in LO Impress) and if the box containing the formula was able to adaptively change its size according to the content, as after a few characters it's impossible to see what is inside the box, and trying to enlarge the box manually does not work.