-bool Paragraph::Private::latexSpecialTypewriter(char_type const c, otexstream & os,
- pos_type i, unsigned int & column)
-{
- switch (c) {
- case '-':
- // within \ttfamily, "--" is merged to "-" (no endash)
- // so we avoid this rather irritating ligature
- if (i + 1 < int(text_.size()) && text_[i + 1] == '-') {
- os << "-{}";
- column += 2;
- } else
- os << '-';
- return true;
-
- // everything else has to be checked separately
- // (depending on the encoding)
- default:
- return false;
- }
-}
-
-
-/// \param end_pos
-/// If [start_pos, end_pos) does not include entirely the special phrase, then
-/// do not apply the macro transformation.
-bool Paragraph::Private::latexSpecialPhrase(otexstream & os, pos_type & i, pos_type end_pos,
- unsigned int & column, OutputParams const & 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)
- || (end_pos != -1 && i + int(special_phrases[pnr].phrase.size()) > end_pos))
- 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;
-}
-
-