Added UNICODE support and '&' replacement
svn: r1866
This commit is contained in:
parent
132e068414
commit
271f82225c
@ -108,10 +108,10 @@ class LaTeXDoc(TextDoc.TextDoc):
|
||||
options = options + ",letterpaper"
|
||||
|
||||
# Use the article template, T1 font encodings, and specify
|
||||
# that we should use Latin1 character encodings.
|
||||
# that we should use Latin1 and unicode character encodings.
|
||||
self.f.write('\\documentclass[%s]{article}\n' % options)
|
||||
self.f.write('\\usepackage[T1]{fontenc}\n')
|
||||
self.f.write('\\usepackage[latin1]{inputenc}\n')
|
||||
self.f.write('\\usepackage[latin1,utf8]{inputenc}\n')
|
||||
# add packages (should be standard on a default installation)
|
||||
# for finer output control. Put comments in file for user to read
|
||||
self.f.write('\\usepackage{graphicx} % Extended graphics support\n')
|
||||
@ -232,7 +232,7 @@ class LaTeXDoc(TextDoc.TextDoc):
|
||||
|
||||
def start_paragraph(self,style_name,leader=None):
|
||||
"""Paragraphs handling - A Gramps paragraph is any
|
||||
single body of text, from a single word, to several sentences.
|
||||
single body of text from a single word to several sentences.
|
||||
We assume a linebreak at the end of each paragraph."""
|
||||
|
||||
style = self.style_list[style_name]
|
||||
@ -387,6 +387,7 @@ class LaTeXDoc(TextDoc.TextDoc):
|
||||
if text == '\n':
|
||||
text = '\\newline\n'
|
||||
text = string.replace(text,'#','\#')
|
||||
text = string.replace(text,'&','\&')
|
||||
text = text.replace('<super>','\\textsuperscript{')
|
||||
text = text.replace('</super>','}')
|
||||
self.f.write(text)
|
||||
@ -405,3 +406,12 @@ Plugins.register_text_doc(
|
||||
style=0,
|
||||
ext=".tex"
|
||||
)
|
||||
|
||||
Plugins.register_book_doc(
|
||||
name=_("LaTeX"),
|
||||
classref=LaTeXDoc,
|
||||
table=1,
|
||||
paper=1,
|
||||
style=0,
|
||||
ext=".tex"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user