Minsky
latexMarkup.h
Go to the documentation of this file.
1 /*
2  @copyright Steve Keen 2013
3  @author Russell Standish
4  This file is part of Minsky.
5 
6  Minsky is free software: you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Minsky is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Minsky. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef LATEXMARKUP_H
21 #define LATEXMARKUP_H
22 #include <string>
23 
24 namespace minsky
25 {
26  std::string latexToPangoNonItalicised(const char*);
27  inline std::string latexToPangoNonItalicised(const std::string& x)
28  {return latexToPangoNonItalicised(x.c_str());}
29 
30  inline std::string latexToPango(const char* s)
31  {return "<i>"+latexToPangoNonItalicised(s)+"</i>";}
34  inline std::string latexToPango(const std::string& x)
35  {return latexToPango(x.c_str());}
36 
37  // replace pango special chars with coded equivalents
38  std::string defang(char c);
39  inline std::string defang(const std::string& s) {
40  std::string r;
41  for (auto& c: s) r+=defang(c);
42  return r;
43  }
44 
45 }
46 
47 #endif
string defang(char c)
Definition: latexMarkup.cc:842
std::string latexToPango(const char *s)
Definition: latexMarkup.h:30
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky&#39;s state cha...
Definition: constMap.h:22
string latexToPangoNonItalicised(const char *input)
Definition: latexMarkup.cc:855