00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef LATEXGENERATOR_H
00029 #define LATEXGENERATOR_H
00030
00031 #include <string>
00032 #include <iostream>
00033 #include <sstream>
00034
00035 #include "codegenerator.h"
00036 #include "version.h"
00037 #include "charcodes.h"
00038
00039
00040 namespace highlight
00041 {
00042
00053 class LatexGenerator : public highlight::CodeGenerator
00054 {
00055 public:
00056 LatexGenerator();
00057 ~LatexGenerator();
00058
00062 void setLATEXReplaceQuotes ( bool b ) { replaceQuotes = b;}
00063
00067 void setLATEXNoShorthands ( bool b ) { disableBabelShortHand = b; }
00068
00072 void setLATEXPrettySymbols ( bool b ) { prettySymbols = b; }
00073
00074 private:
00075
00078 string getHeader();
00079
00081 string getFooter();
00082
00084 void printBody();
00085
00087 void initOutputTags();
00088
00089 string styleDefinitionCache;
00090 string longLineTag;
00091
00093 virtual string maskCharacter ( unsigned char );
00094
00096 string getAttributes ( const string & elemName,
00097 const ElementStyle & elem );
00098
00100 bool replaceQuotes;
00101
00103 bool disableBabelShortHand;
00104
00106 bool prettySymbols;
00107
00108 string getNewLine();
00109
00110 string getStyleDefinition();
00111
00112 string getKeywordOpenTag ( unsigned int styleID );
00113 string getKeywordCloseTag ( unsigned int styleID );
00114 };
00115
00116 }
00117
00118 #endif