47
46
/** {@inheritDoc} */
47
protected boolean isXmlSink()
48
53
protected String getTitleBlock( String title )
50
return "\\ptitle{" + title + "}";
55
return "\\title{" + LatexSink.escaped( title ) + "}" + EOL;
53
58
/** {@inheritDoc} */
54
59
protected String getAuthorBlock( String author )
56
return "\\pauthor{" + author + "}";
61
return "\\author{" + LatexSink.escaped( author ) + "}" + EOL;
59
64
/** {@inheritDoc} */
60
65
protected String getDateBlock( String date )
62
return "\\pdate{" + date + "}";
67
return "\\date{" + LatexSink.escaped( date ) + "}" + EOL;
65
70
/** {@inheritDoc} */
66
71
protected String getHeadBlock()
68
return LatexSink.defaultSinkCommands()
69
+ "\\documentclass[a4paper]{article}"
70
+ LatexSink.defaultPreamble()
71
+ "\\begin{document}";
73
return ((LatexSink) getSink()).defaultSinkCommands()
74
+ "\\documentclass[a4paper]{article}" + EOL + EOL
75
+ ((LatexSink) getSink()).defaultPreamble()
76
+ "\\begin{document}" + EOL + EOL;
74
79
/** {@inheritDoc} */
75
80
protected String getBodyBlock()
77
return "\\end{document}";
82
return "\\end{document}" + EOL;
80
85
/** {@inheritDoc} */
81
86
protected String getSectionTitleBlock( String title )
83
// TODO: closing bracket?
87
91
/** {@inheritDoc} */
88
92
protected String getSection1Block( String title )
90
return "\\psectioni{" + title + "}";
94
return EOL + "\\section{" + title + "}" + EOL;
93
97
/** {@inheritDoc} */
94
98
protected String getSection2Block( String title )
96
return "\\psectionii{" + title + "}";
100
return EOL + "\\subsection{" + title + "}" + EOL;
99
103
/** {@inheritDoc} */
100
104
protected String getSection3Block( String title )
102
return "\\psectioniii{" + title + "}";
106
return EOL + "\\subsubsection{" + title + "}" + EOL;
105
109
/** {@inheritDoc} */
106
110
protected String getSection4Block( String title )
108
return "\\psectioniv{" + title + "}";
112
return EOL + "\\paragraph{" + title + "}" + EOL;
111
115
/** {@inheritDoc} */
112
116
protected String getSection5Block( String title )
114
return "\\psectionv{" + title + "}";
118
return EOL + "\\subparagraph{" + title + "}" + EOL;
117
121
/** {@inheritDoc} */
118
122
protected String getListBlock( String item )
120
return "\\begin{plist}\\item{} " + item + "\\end{plist}";
124
return EOL + "\\begin{itemize}" + EOL + "\\item " + LatexSink.escaped( item ) + EOL + "\\end{itemize}" + EOL;
123
127
/** {@inheritDoc} */
124
128
protected String getNumberedListBlock( String item )
126
return "\\begin{pnumberedlist}\\renewcommand{\\theenumi}{\\roman{enumi}}\\item{} " + item + "\\end{pnumberedlist}";
130
return EOL + "\\begin{enumerate}" + EOL + "\\renewcommand{\\theenumi}{\\roman{enumi}}" + EOL + "\\item "
131
+ LatexSink.escaped( item ) + EOL + "\\end{enumerate}" + EOL;
129
134
/** {@inheritDoc} */
130
135
protected String getDefinitionListBlock( String definum, String definition )
132
return "\\begin{pdefinitionlist}\\item[\\mbox{" + definum + "}] " + definition + "\\end{pdefinitionlist}";
137
return EOL + "\\begin{description}" + EOL + "\\item[\\mbox{" + definum + "}] " + definition + EOL + "\\end{description}" + EOL;
135
140
/** {@inheritDoc} */
136
141
protected String getFigureBlock( String source, String caption )
138
return "\\begin{pfigure}\\pfiguregraphics{" + source + "}\\pfigurecaption{" + caption + "}\\end{pfigure}";
143
return EOL + "\\begin{figure}[htb]" + EOL + "\\begin{center}" + EOL + "\\includegraphics{" + source + "}" + EOL
144
+ "\\end{center}" + EOL + "\\caption{Figure\\_caption}" + EOL + "\\end{figure}" + EOL;
141
147
/** {@inheritDoc} */
142
148
protected String getTableBlock( String cell, String caption )
144
// TODO: something's wrong
145
return "\\begin{ptable}\\begin{ptablerows}{c}\\begin{pcell}{c}cell\\end{pcell}\\\\\\end{ptablerows}\\ptablecaption{" + caption + "}\\end{ptable}";
150
return EOL + "\\begin{table}[htp]" + EOL + "\\begin{center}" + EOL + "\\begin{tabular}{c}" + EOL
151
+ "\\begin{tabular}[t]{c}cell\\end{tabular}\\\\" + EOL + "\\end{tabular}" + EOL
152
+ "\\end{center}" + EOL + "\\caption{Table\\_caption}" + EOL + "\\end{table}" + EOL;
148
155
/** {@inheritDoc} */
149
156
protected String getParagraphBlock( String text )
158
return EOL + EOL + text + EOL;
154
161
/** {@inheritDoc} */
155
162
protected String getVerbatimBlock( String text )
157
return "\\begin{pverbatimbox}\\begin{verbatim}" + text + "\\end{verbatim}\\end{pverbatimbox}";
164
return EOL + "\\begin{small}" + EOL + "\\begin{Verbatim}[frame=single]" + EOL + text + EOL
165
+ "\\end{Verbatim}" + EOL + "\\end{small}" + EOL;
160
168
/** {@inheritDoc} */
161
169
protected String getHorizontalRuleBlock()
163
return "\\phorizontalrule";
171
return EOL + "\\begin{center}\\rule[0.5ex]{\\linewidth}{1pt}\\end{center}" + EOL;
166
174
/** {@inheritDoc} */
167
175
protected String getPageBreakBlock()
177
return EOL + "\\newpage" + EOL;
172
180
/** {@inheritDoc} */
173
181
protected String getAnchorBlock( String anchor )
175
return "\\panchor{" + anchor + "}";
183
return "\\hypertarget{" + anchor + "}{" + anchor + "}";
178
186
/** {@inheritDoc} */
179
187
protected String getLinkBlock( String link, String text )
181
return "\\plink{" + text + "}";
189
return "\\hyperlink{" + link + "}{" + text + "}";
184
192
/** {@inheritDoc} */
185
193
protected String getItalicBlock( String text )
187
return "\\pitalic{" + text + "}";
195
return "\\textit{" + text + "}";
190
198
/** {@inheritDoc} */
191
199
protected String getBoldBlock( String text )
193
return "\\pbold{" + text + "}";
201
return "\\textbf{" + text + "}";
196
204
/** {@inheritDoc} */
197
205
protected String getMonospacedBlock( String text )
199
return "\\pmonospaced{" + text + "}";
207
return "\\texttt{\\small " + text + "}";
202
210
/** {@inheritDoc} */
203
211
protected String getLineBreakBlock()
213
return "\\newline" + EOL;
208
216
/** {@inheritDoc} */