From 753d309d6b51ef2f3dc13f93dbc8942ce80df57a Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sat, 4 Dec 2010 22:04:54 +0100 Subject: Alternate style text support added. --- src/elements.h | 4 +++- src/generators/latex/text_g.cpp | 4 +++- src/parser/text_p.cpp | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/elements.h b/src/elements.h index 1c2f451..5f1bc5c 100644 --- a/src/elements.h +++ b/src/elements.h @@ -29,7 +29,9 @@ typedef boost::variant, std::wstring> text_t; enum stattribute_t { EMPH, SEMPH, - VSEMPH + VSEMPH, + ALT, + SALT }; struct stext_t { diff --git a/src/generators/latex/text_g.cpp b/src/generators/latex/text_g.cpp index aeaffc0..0cc64cb 100644 --- a/src/generators/latex/text_g.cpp +++ b/src/generators/latex/text_g.cpp @@ -23,7 +23,9 @@ latex::text_g::text_g() : text_g::base_type(text_) { stext_ = &uint_(EMPH) << L"\\emph{" << +text_ << '}' | &uint_(SEMPH) << L"\\textit{\\emph{" << +text_ << L"}}" - | &uint_(VSEMPH) << L"\\texttt{\\textit{\\emph{" << +text_ << L"}}}"; + | &uint_(VSEMPH) << L"\\texttt{\\textit{\\emph{" << +text_ << L"}}}" + | &uint_(ALT) << L"\\texttt{" << +text_ << '}' + | &uint_(SALT) << L"\\texttt{\\textbf{" << +text_ << L"}}"; ptext_ = +char_; } diff --git a/src/parser/text_p.cpp b/src/parser/text_p.cpp index 4d44e66..3546f5b 100644 --- a/src/parser/text_p.cpp +++ b/src/parser/text_p.cpp @@ -23,9 +23,11 @@ text_p::text_p() : text_p::base_type(text_) { stext_ = lit("***") >> attr(VSEMPH) >> +text_ >> "***" | lit("**") >> attr(SEMPH) >> +text_ >> "**" - | lit('*') >> attr(EMPH) >> +text_ >> '*'; + | lit('*') >> attr(EMPH) >> +text_ >> '*' + | lit("''") >> attr(SALT) >> +text_ >> "''" + | lit('\'') >> attr(ALT) >> +text_ >> '\''; ptext_ = +(echar_ | rchar_); echar_ = lit('\\') >> char_; - rchar_ = char_ - char_(L"*"); + rchar_ = char_ - char_(L"*'"); } -- cgit v1.2.3-70-g09d2