1 29 30 package com.caucho.xtpdoc; 31 32 import javax.xml.stream.XMLStreamException; 33 import javax.xml.stream.XMLStreamWriter; 34 import java.io.IOException ; 35 import java.io.PrintWriter ; 36 37 public class Text implements ContentItem { 38 private String _text; 39 40 public Text(String text) 41 { 42 _text = text; 43 } 44 45 public void writeHtml(XMLStreamWriter out) 46 throws XMLStreamException 47 { 48 out.writeCharacters(_text); 49 } 50 51 public void writeLaTeX(PrintWriter out) 52 throws IOException 53 { 54 out.print(LaTeXUtil.escapeForLaTeX(_text)); 55 } 56 57 public void writeLaTeXEnclosed(PrintWriter out) 58 throws IOException 59 { 60 writeLaTeX(out); 61 } 62 63 public void writeLaTeXTop(PrintWriter out) 64 throws IOException 65 { 66 writeLaTeX(out); 67 } 68 } 69 | Popular Tags |