Skip to content

Commit

Permalink
Fix copy as MathML for boxes.
Browse files Browse the repository at this point in the history
There is no MathML tag <box/>, use
<menclose notation="box"> ... </menclose>
instead.

For named boxes (don't know if there is a
proper MathML notation) add at least a
comment. (also for the "Copy as LaTeX" case).
  • Loading branch information
daute committed Oct 27, 2024
1 parent 1047072 commit 400db76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/cells/BoxCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ wxString BoxCell::ToTeX() const {
}

wxString BoxCell::ToMathML() const {
return wxS("<apply><box/><ci>") + m_innerCell->ListToMathML() +
wxS("</ci></apply>");
return wxS("<menclose notation=\"box\">") + m_innerCell->ListToMathML() +
wxS("</menclose>");
}

wxString BoxCell::ToOMML() const {
Expand Down
8 changes: 3 additions & 5 deletions src/cells/NamedBoxCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,12 @@ wxString NamedBoxCell::ToTeX() const {
if (IsBrokenIntoLines())
return wxEmptyString;
else
return wxS("\\fbox{") + m_innerCell->ListToTeX() + wxS("}");
return wxS("\\fbox{") + m_innerCell->ListToTeX() + wxS("} % Named Box, Name: ") + m_boxname->ListToTeX() + wxS("\n");
}

wxString NamedBoxCell::ToMathML() const {
return wxS("<apply><box/><ci>") + m_innerCell->ListToMathML() +
wxS("</ci><ci>") +
m_boxname->ListToMathML() +
wxS("</apply>");
return wxS("<menclose notation=\"box\">") + m_innerCell->ListToMathML() +
wxS("</menclose><!-- Named Box, Name: " + m_boxname->ListToMathML() + " -->\n");
}

wxString NamedBoxCell::ToOMML() const {
Expand Down

0 comments on commit 400db76

Please sign in to comment.