772 |
self.body.append(':]') |
self.body.append(':]') |
773 |
|
|
774 |
def visit_figure(self, node): |
def visit_figure(self, node): |
775 |
self.body.append('\\begin{figure') |
environment = "figure" |
776 |
for child in node.children: |
for child in node.children: |
777 |
if child.attributes.has_key('alternative'): |
if child.attributes.has_key('environment'): |
778 |
self.body.append(child.attributes['alternative']) |
environment = child.attributes['environment'] |
779 |
self.body.append('}\n') |
self.body.append('\\begin{'+environment+'}\n') |
780 |
|
|
781 |
def depart_figure(self, node): |
def depart_figure(self, node): |
782 |
self.body.append('\n\\end{figure') |
environment = "figure" |
783 |
for child in node.children: |
for child in node.children: |
784 |
if child.attributes.has_key('alternative'): |
if child.attributes.has_key('environment'): |
785 |
self.body.append(child.attributes['alternative']) |
environment = child.attributes['environment'] |
786 |
self.body.append('}\n') |
self.body.append('\n\\end{'+environment+'}\n') |
787 |
|
|
788 |
def visit_footer(self, node): |
def visit_footer(self, node): |
789 |
self.context.append(len(self.body)) |
self.context.append(len(self.body)) |
860 |
|
|
861 |
def visit_image(self, node): |
def visit_image(self, node): |
862 |
atts = node.attributes.copy() |
atts = node.attributes.copy() |
863 |
href = atts['uri'] |
if not atts.has_key('environment') or \ |
864 |
self.body.append('\\centering\n') |
(atts.has_key('environment') and \ |
865 |
self.body.append('\\includegraphics') |
not atts['environment'] == 'table' and \ |
866 |
if atts.has_key('width'): self.body.append('[width=%s]' % atts['width']) |
not atts['uri'] == 'table'): |
867 |
else: self.body.append('[width=\\columnwidth]') |
href = atts['uri'] |
868 |
self.body.append('{%s}\n' % href) |
self.body.append('\\centering\n') |
869 |
|
self.body.append('\\includegraphics') |
870 |
|
if atts.has_key('width'): self.body.append('[width=%s]' % atts['width']) |
871 |
|
else: self.body.append('[width=\\columnwidth]') |
872 |
|
self.body.append('{%s}\n' % href) |
873 |
##self.body.append('\\end{center}\n') |
##self.body.append('\\end{center}\n') |
874 |
|
|
875 |
def depart_image(self, node): |
def depart_image(self, node): |