diff --git a/NEWS b/NEWS index 6b939fe78..d83235908 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,10 @@ New in spot 1.99.2a (not yet released) - ltlgrind --help output had some options documented twice, or in the wrong place. - The man page for ltlcross had obsolete examples. + - When outputting atomic propositions in double quotes, the + escaping routine used by the two styles of LaTeX output was + slightly off. For instance ^ was incorrectly escaped, and the + double quotes where not always properly rendered. New in spot 1.99.2 (2015-07-18) diff --git a/src/ltlvisit/print.cc b/src/ltlvisit/print.cc index 1e05131f3..2cf30ba53 100644 --- a/src/ltlvisit/print.cc +++ b/src/ltlvisit/print.cc @@ -416,8 +416,8 @@ namespace spot { // Spin 6 supports atomic propositions such as (a == 0) // as long as they are enclosed in parentheses. - if (kw_ == sclatex_kw || kw_ == sclatex_kw) - escape_latex(os_ << "``\\mathit{", str) << "\\textrm{''}}"; + if (kw_ == sclatex_kw || kw_ == latex_kw) + escape_latex(os_ << "``\\mathit{", str) << "}\\textrm{''}"; else if (kw_ != spin_kw) os_ << '"' << str << '"'; else if (!full_parent_) diff --git a/src/misc/escape.cc b/src/misc/escape.cc index 3131f5621..526578d17 100644 --- a/src/misc/escape.cc +++ b/src/misc/escape.cc @@ -54,13 +54,13 @@ namespace spot switch (i) { case '~': - os << "\\textasciitilde"; + os << "\\text{\\textasciitilde}"; break; case '^': - os << "\\textasciicircum"; + os << "\\text{\\textasciicircum}"; break; case '\\': - os << "\\textbackslash"; + os << "\\text{\\textbackslash}"; break; case '&': case '%': diff --git a/src/tests/latex.test b/src/tests/latex.test index a3084d2a1..266177668 100755 --- a/src/tests/latex.test +++ b/src/tests/latex.test @@ -29,7 +29,7 @@ set -e (kpsewhich txfonts.sty) || exit 77 (kpsewhich amsmath.sty) || exit 77 -cat >input <input <<\EOF XGFa <-> FGX(!b & !c) | (b ^ a) a U b W c R (d & e) M f {a;b[=2];((c:d*) && f*);e[*2..]}<>-> {((a | [*0])*;b[+]) & (c1[->2])}[]-> h @@ -37,6 +37,7 @@ a U b W c R (d & e) M f !{a;b*;c}! -> d {a*;(b;c)[:*3..4];(c;d)[:+];d}! G(uglyname->Fuglierlongname42) +"#foo/$bar$" U "baz~yes^no" EOF ( diff --git a/wrap/python/tests/formulas.ipynb b/wrap/python/tests/formulas.ipynb index 439874591..dab70972b 100644 --- a/wrap/python/tests/formulas.ipynb +++ b/wrap/python/tests/formulas.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:c5ce337080296dc7af1d530e86502099bdfb3f039b96f749f38390b8d5ade44b" + "signature": "sha256:d2086d4faaecc1d0e5a0e29b958657ed86b034326b89a5513d3df6f35301a3e7" }, "nbformat": 3, "nbformat_minor": 0, @@ -304,7 +304,7 @@ "outputs": [ { "latex": [ - "$``\\mathit{a > b\\textrm{''}} \\land ``\\mathit{proc[2]@init\\textrm{''}} \\land \\mathsf{G} \\mathsf{F} \\mathit{\\_foo\\_}$" + "$``\\mathit{a > b}\\textrm{''} \\land ``\\mathit{proc[2]@init}\\textrm{''} \\land \\mathsf{G} \\mathsf{F} \\mathit{\\_foo\\_}$" ], "metadata": {}, "output_type": "pyout", @@ -493,7 +493,7 @@ "" ], "text": [ - "" + "" ] } ],