tostring: add LaTeX output

* src/ltlvisit/tostring.cc, src/ltlvisit/tostring.hh
(to_latex_string): New function.
* src/bin/common_output.cc, src/bin/common_output.hh:
Add a --latex option.
* doc/tl/spotltl.sty: New file.
* doc/tl/Makefile.am: Distribute it.
* src/ltltest/latex.test: New test.
* src/ltltest/Makefile.am: Add it.
* NEWS: Mention it.
This commit is contained in:
Alexandre Duret-Lutz 2013-08-28 18:52:59 +02:00
parent 90c106f8a8
commit 9cfe1a3496
9 changed files with 301 additions and 33 deletions

View file

@ -28,7 +28,7 @@ LATEXMK = BIBINPUTS='$(srcdir)' latexmk -pdf -ps- -dvi- -pvc- \
-e '$$pdflatex="pdflatex %O \"\\def\\SpotVersion{$(VERSION)}\\input{%S}\""'
dist_pdf_DATA = $(srcdir)/tl.pdf
EXTRA_DIST = tl.tex tl.bib
EXTRA_DIST = tl.tex tl.bib spotltl.sty
# latexmk produces its output in the current directory, and may not
# update its timestamp when no rebuild was necessary. This can cause

49
doc/tl/spotltl.sty Normal file
View file

@ -0,0 +1,49 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{spotltl}[2013/08/28 Temporal Logic Operators for LTL and PSL]
% NOTE: if you use amsmath.sty, make sure you include it before spotltl.sty
% otherwise it will try to redefine some symbols from txfonts.
\RequirePackage{txfonts}
\newcommand{\ttrue}{\top}
\newcommand{\ffalse}{\bot}
\newcommand{\eword}{\varepsilon} % empty word, denoted by [*0] in PSL
% These three are not declared as operator
\newcommand{\F}{\mathsf{F}} % eventually
\newcommand{\G}{\mathsf{G}} % always
\newcommand{\X}{\mathsf{X}} % next
% The \mathbin tell TeX to adjust spacing for binary operators
\newcommand{\M}{\mathbin{\mathsf{M}}} % strong release
\newcommand{\R}{\mathbin{\mathsf{R}}} % release
\newcommand{\U}{\mathbin{\mathsf{U}}} % until
\newcommand{\W}{\mathbin{\mathsf{W}}} % weak until
% additional logical operators to complete \land, \lor, and \lnot.
\newcommand{\limplies}{\rightarrow}
\newcommand{\liff}{\leftrightarrow}
\newcommand{\lxor}{\oplus}
% Star-like PSL operators
\newcommand{\SereStar}[1]{^{\star#1}}
\newcommand{\SereEqual}[1]{^{=#1}}
\newcommand{\SereGoto}[1]{^{\to#1}}
\newcommand{\SerePlus}{^+}
\newcommand{\SereFusion}{\mathbin{\mathsf{:}}}
\newcommand{\SereConcat}{\mathbin{\mathsf{;}}}
\newcommand{\SereOr}{\cup}
\newcommand{\SereAnd}{\cap}
\newcommand{\SereAndNLM}{\mathbin{\mathsf{\&}}}
% Triggers and Seq operators, with their variant. The *M variants of
% these ope are internal "Marked" operators for Spot that should
% normally not be output unless the formula is used to label a state
% in an automaton (but we do not use LaTeX there).
\newcommand{\seq}{\Diamondright}
%\newcommand{\seqM}{\seq}
\newcommand{\seqX}{\DiamondRight}
%\newcommand{\seqXM}{\seqX}
\newcommand{\triggers}{\boxright}
\newcommand{\triggersX}{\boxRight}