+bool Paragraph::Private::latexSpecialT1(char_type const c, odocstream & os,
+ pos_type & i, unsigned int & column)
+{
+ switch (c) {
+ case '>':
+ case '<':
+ os.put(c);
+ // In T1 encoding, these characters exist
+ // but we should avoid ligatures
+ if (i + 1 >= int(text_.size()) || text_[i + 1] != c)
+ return true;
+ os << "\\,{}";
+ column += 3;
+ // Alternative code:
+ //os << "\\textcompwordmark{}";
+ //column += 19;
+ return true;
+ case '|':
+ os.put(c);
+ return true;
+ default:
+ return false;
+ }
+}
+
+
+bool Paragraph::Private::latexSpecialTypewriter(char_type const c, odocstream & os,
+ pos_type & i, unsigned int & column)
+{
+ switch (c) {
+ case '-':
+ if (i + 1 < int(text_.size()) && text_[i + 1] == '-') {
+ // "--" in Typewriter mode -> "-{}-"
+ os << "-{}";
+ column += 2;
+ } else
+ os << '-';
+ return true;
+
+ // I assume this is hack treating typewriter as verbatim
+ // FIXME UNICODE: This can fail if c cannot be encoded
+ // in the current encoding.
+
+ case '\0':
+ return true;
+
+ // Those characters are not directly supported.
+ case '\\':
+ case '\"':
+ case '$': case '&':
+ case '%': case '#': case '{':
+ case '}': case '_':
+ case '~':
+ case '^':
+ case '*': case '[':
+ case ' ':
+ return false;
+
+ default:
+ // With Typewriter font, these characters exist.
+ os.put(c);
+ return true;
+ }
+}
+
+
+bool Paragraph::Private::latexSpecialPhrase(odocstream & os, pos_type & i,
+ unsigned int & column, OutputParams & runparams)
+{
+ // FIXME: if we have "LaTeX" with a font
+ // change in the middle (before the 'T', then
+ // the "TeX" part is still special cased.
+ // Really we should only operate this on
+ // "words" for some definition of word
+
+ for (size_t pnr = 0; pnr < phrases_nr; ++pnr) {
+ if (!isTextAt(special_phrases[pnr].phrase, i))
+ continue;
+ if (runparams.moving_arg)
+ os << "\\protect";
+ os << special_phrases[pnr].macro;
+ i += special_phrases[pnr].phrase.length() - 1;
+ column += special_phrases[pnr].macro.length() - 1;
+ return true;
+ }
+ return false;
+}
+
+