function mgtmlatex::_preTag, type, newline=newline, tag=tag
compile_opt strictarr
case type of
'' : return, ''
'code': return, '\tt{'
'bold' : return, '\textbf{'
'image': begin
location = tag->getAttribute('location')
src = tag->getAttribute('source')
return, '\hspace{0.5em}' + string([13B, 10B, 13B, 10B]) + '\includegraphics[scale=0.6]{' + location + src + '}'
end
'embed': begin
location = tag->getAttribute('location')
src = tag->getAttribute('source')
dotpos = strpos(src, '.', /reverse_search)
ext = strmid(src, dotpos + 1L)
if (strlowcase(ext) eq 'svg') then src = strmid(src, 0, dotpos) + '.pdf'
return, '\hspace{0.5em}' + string([13B, 10B, 13B, 10B]) + '\includegraphics[scale=0.6]{' + location + src + '}'
end
'link': return, ''
'listing': return, '\begin{verbatim}'
'paragraph': return, ''
'newline' : begin
newline = 1
return, ''
end
else : return, ''
endcase
end
function mgtmlatex::_postTag, type, newline=newline, tag=tag
compile_opt strictarr
case type of
'' : return, ''
'bold' : return, '}'
'code': return, '}'
'image': return, string([13B, 10B, 13B, 10B]) + '\hspace{0.5em}'
'embed': return, string([13B, 10B, 13B, 10B]) + '\hspace{0.5em}'
'link': begin
href = tag->getAttribute('reference')
return, ' (\tt{' + href + '})'
end
'listing': return, '\end{verbatim}'
'paragraph': begin
newline = 1
return, ''
end
'newline' : return, ''
else : return, ''
endcase
end
pro mgtmlatex__define
compile_opt strictarr
define = { mgtmlatex, inherits mgtmlanguage }
end