- break;
-
- case ' ':
- // Blanks are printed before font switching.
- // Sure? I am not! (try nice-latex)
- // I am sure it's correct. LyX might be smarter
- // in the future, but for now, nothing wrong is
- // written. (Asger)
- break;
-
- default:
- /* idea for labels --- begin*/
- // Check for "LyX"
- if (c == 'L'
- && i <= owner_->size() - 3
- && font.family() != LyXFont::TYPEWRITER_FAMILY
- && owner_->getChar(i + 1) == 'y'
- && owner_->getChar(i + 2) == 'X') {
- os << "\\LyX{}";
- i += 2;
- column += 5;
- }
- // Check for "TeX"
- else if (c == 'T'
- && i <= owner_->size() - 3
- && font.family() != LyXFont::TYPEWRITER_FAMILY
- && owner_->getChar(i + 1) == 'e'
- && owner_->getChar(i + 2) == 'X') {
- os << "\\TeX{}";
- i += 2;
- column += 5;
- }
- // Check for "LaTeX2e"
- else if (c == 'L'
- && i <= owner_->size() - 7
- && font.family() != LyXFont::TYPEWRITER_FAMILY
- && owner_->getChar(i + 1) == 'a'
- && owner_->getChar(i + 2) == 'T'
- && owner_->getChar(i + 3) == 'e'
- && owner_->getChar(i + 4) == 'X'
- && owner_->getChar(i + 5) == '2'
- && owner_->getChar(i + 6) == 'e') {
- os << "\\LaTeXe{}";
- i += 6;
- column += 8;
- }
- // Check for "LaTeX"
- else if (c == 'L'
- && i <= owner_->size() - 5
- && font.family() != LyXFont::TYPEWRITER_FAMILY
- && owner_->getChar(i + 1) == 'a'
- && owner_->getChar(i + 2) == 'T'
- && owner_->getChar(i + 3) == 'e'
- && owner_->getChar(i + 4) == 'X') {
- os << "\\LaTeX{}";
- i += 4;
- column += 7;
- /* idea for labels --- end*/
- } else if (c != '\0') {
+ } else {
+ os << '-';
+ }
+ break;
+
+ case '\"':
+ os << "\\char`\\\"{}";
+ column += 9;
+ break;
+
+ case '£':
+ if (bparams.inputenc == "default") {
+ os << "\\pounds{}";
+ column += 8;
+ } else {
+ os << c;
+ }
+ break;
+
+ case '$': case '&':
+ case '%': case '#': case '{':
+ case '}': case '_':
+ os << '\\' << c;
+ column += 1;
+ break;
+
+ case '~':
+ os << "\\textasciitilde{}";
+ column += 16;
+ break;
+
+ case '^':
+ os << "\\textasciicircum{}";
+ column += 17;
+ break;
+
+ case '*': case '[': case ']':
+ // avoid being mistaken for optional arguments
+ os << '{' << c << '}';
+ column += 2;
+ break;
+
+ case ' ':
+ // Blanks are printed before font switching.
+ // Sure? I am not! (try nice-latex)
+ // I am sure it's correct. LyX might be smarter
+ // in the future, but for now, nothing wrong is
+ // written. (Asger)
+ break;
+
+ default:
+
+ // I assume this is hack treating typewriter as verbatim
+ if (font.family() == LyXFont::TYPEWRITER_FAMILY) {
+ if (c != '\0') {