mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 18:43:37 +00:00
Compare commits
6 Commits
770362da97
...
75f467fa13
Author | SHA1 | Date | |
---|---|---|---|
|
75f467fa13 | ||
|
790c153737 | ||
|
ca5d5a0b1a | ||
|
a06528ee2a | ||
|
cb88a362ea | ||
|
135889c634 |
@ -425,6 +425,10 @@ def main(argv):
|
|||||||
if pdf_output:
|
if pdf_output:
|
||||||
lilypond_book += " --pdf"
|
lilypond_book += " --pdf"
|
||||||
lilypond_book += " --latex-program=%s" % latex.split()[0]
|
lilypond_book += " --latex-program=%s" % latex.split()[0]
|
||||||
|
if pdf_output:
|
||||||
|
lilypond_book += " --lily-output-dir=ly-pdf"
|
||||||
|
else:
|
||||||
|
lilypond_book += " --lily-output-dir=ly-eps"
|
||||||
|
|
||||||
# Make a copy of the latex file
|
# Make a copy of the latex file
|
||||||
lytex_file = latex_file_re.sub(".lytex", latex_file)
|
lytex_file = latex_file_re.sub(".lytex", latex_file)
|
||||||
|
@ -236,14 +236,20 @@ void InsetMathChar::mathmlize(MathMLStream & ms) const
|
|||||||
{
|
{
|
||||||
std::string entity;
|
std::string entity;
|
||||||
switch (char_) {
|
switch (char_) {
|
||||||
case '<': entity = "<"; break;
|
case '<': entity = "<"; break;
|
||||||
case '>': entity = ">"; break;
|
case '>': entity = ">"; break;
|
||||||
case '&': entity = "&"; break;
|
case '&': entity = "&"; break;
|
||||||
case ' ': {
|
case '-':
|
||||||
ms << from_ascii(" ");
|
if (ms.version() == MathMLStream::mathmlCore) {
|
||||||
return;
|
// − U+2212 MINUS SIGN
|
||||||
|
entity = "−";
|
||||||
}
|
}
|
||||||
default: break;
|
break;
|
||||||
|
case ' ': {
|
||||||
|
ms << from_ascii(" ");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ms.inText()) {
|
if (ms.inText()) {
|
||||||
|
@ -2417,7 +2417,7 @@ void InsetMathHull::docbook(XMLStream & xs, OutputParams const & runparams) cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
odocstringstream osmath;
|
odocstringstream osmath;
|
||||||
MathMLStream ms(osmath, mathmlNamespacePrefix);
|
MathMLStream ms(osmath, mathmlNamespacePrefix, MathMLStream::mathml3);
|
||||||
|
|
||||||
// Output the MathML subtree.
|
// Output the MathML subtree.
|
||||||
// TeX transcription. Avoid MTag/ETag so that there are no extraneous spaces.
|
// TeX transcription. Avoid MTag/ETag so that there are no extraneous spaces.
|
||||||
@ -2440,7 +2440,7 @@ void InsetMathHull::docbook(XMLStream & xs, OutputParams const & runparams) cons
|
|||||||
// First, generate the MathML expression. If there is an error in the generation, this block is not fully
|
// First, generate the MathML expression. If there is an error in the generation, this block is not fully
|
||||||
// executed, and the formula is not output to the DocBook stream.
|
// executed, and the formula is not output to the DocBook stream.
|
||||||
odocstringstream ostmp;
|
odocstringstream ostmp;
|
||||||
MathMLStream mstmp(ostmp, ms.xmlns());
|
MathMLStream mstmp(ostmp, ms.xmlns(), ms.version());
|
||||||
mathmlize(mstmp);
|
mathmlize(mstmp);
|
||||||
|
|
||||||
// Choose the display style for the formula, to be output as an attribute near the formula root.
|
// Choose the display style for the formula, to be output as an attribute near the formula root.
|
||||||
@ -2651,7 +2651,7 @@ docstring InsetMathHull::xhtml(XMLStream & xs, OutputParams const & op) const
|
|||||||
// FIXME Eventually we would like to do this inset by inset.
|
// FIXME Eventually we would like to do this inset by inset.
|
||||||
if (mathtype == BufferParams::MathML) {
|
if (mathtype == BufferParams::MathML) {
|
||||||
odocstringstream os;
|
odocstringstream os;
|
||||||
MathMLStream ms(os);
|
MathMLStream ms(os, "", MathMLStream::mathmlCore);
|
||||||
try {
|
try {
|
||||||
mathmlize(ms);
|
mathmlize(ms);
|
||||||
success = true;
|
success = true;
|
||||||
|
@ -288,8 +288,8 @@ TeXMathStream & operator<<(TeXMathStream & ws, unsigned int i)
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
MathMLStream::MathMLStream(odocstream & os, std::string const & xmlns)
|
MathMLStream::MathMLStream(odocstream & os, std::string const & xmlns, MathMLVersion version)
|
||||||
: os_(os), xmlns_(xmlns)
|
: os_(os), xmlns_(xmlns), version_(version)
|
||||||
{
|
{
|
||||||
if (inText())
|
if (inText())
|
||||||
font_math_style_ = TEXT_STYLE;
|
font_math_style_ = TEXT_STYLE;
|
||||||
|
@ -376,8 +376,15 @@ class MathExportException : public std::exception {};
|
|||||||
|
|
||||||
class MathMLStream {
|
class MathMLStream {
|
||||||
public:
|
public:
|
||||||
/// Builds a stream proxy for os; the MathML namespace is given by xmlns (supposed to be already defined elsewhere in the document).
|
///
|
||||||
explicit MathMLStream(odocstream & os, std::string const & xmlns = "");
|
enum MathMLVersion {
|
||||||
|
mathml3,
|
||||||
|
mathmlCore
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Builds a stream proxy for os; the MathML namespace is given by xmlns
|
||||||
|
/// (supposed to be already defined elsewhere in the document).
|
||||||
|
explicit MathMLStream(odocstream & os, std::string const & xmlns = "", MathMLVersion version = mathml3);
|
||||||
///
|
///
|
||||||
void cr();
|
void cr();
|
||||||
/// Indentation when nesting tags
|
/// Indentation when nesting tags
|
||||||
@ -392,6 +399,8 @@ public:
|
|||||||
bool inText() const { return text_level_ != nlevel; }
|
bool inText() const { return text_level_ != nlevel; }
|
||||||
///
|
///
|
||||||
std::string xmlns() const { return xmlns_; }
|
std::string xmlns() const { return xmlns_; }
|
||||||
|
///
|
||||||
|
MathMLVersion version() const { return version_; }
|
||||||
/// Returns the tag name prefixed by the name space if needed.
|
/// Returns the tag name prefixed by the name space if needed.
|
||||||
std::string namespacedTag(std::string const & tag) const {
|
std::string namespacedTag(std::string const & tag) const {
|
||||||
return (xmlns().empty() ? "" : xmlns() + ":") + tag;
|
return (xmlns().empty() ? "" : xmlns() + ":") + tag;
|
||||||
@ -403,7 +412,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
/// Check whether it makes sense to start a <mtext>
|
/// Check whether it makes sense to start a <mtext>
|
||||||
void beforeText();
|
void beforeText();
|
||||||
///Check whether there is a <mtext> to close here
|
/// Check whether there is a <mtext> to close here
|
||||||
void beforeTag();
|
void beforeTag();
|
||||||
///
|
///
|
||||||
odocstream & os_;
|
odocstream & os_;
|
||||||
@ -420,6 +429,8 @@ private:
|
|||||||
odocstringstream deferred_;
|
odocstringstream deferred_;
|
||||||
///
|
///
|
||||||
std::string xmlns_;
|
std::string xmlns_;
|
||||||
|
///
|
||||||
|
MathMLVersion version_;
|
||||||
/// The only important part of a FontInfo object.
|
/// The only important part of a FontInfo object.
|
||||||
MathStyle font_math_style_;
|
MathStyle font_math_style_;
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user