Notes and Endnotes look better now, but there are more to done.
svn: r14144
This commit is contained in:
parent
07decce138
commit
a001b744b4
@ -68,8 +68,8 @@ _LATEX_TEMPLATE = '''\\usepackage[T1]{fontenc}
|
|||||||
% (If you do not have ucs.sty, you may obtain it from
|
% (If you do not have ucs.sty, you may obtain it from
|
||||||
% http://www.tug.org/tex-archive/macros/latex/contrib/supported/unicode/)
|
% http://www.tug.org/tex-archive/macros/latex/contrib/supported/unicode/)
|
||||||
%
|
%
|
||||||
%\\usepackage[latin1]{inputenc}
|
\\usepackage[latin1]{inputenc}
|
||||||
\\usepackage[latin1,utf8]{inputenc}
|
%\\usepackage[latin1,utf8]{inputenc}
|
||||||
\\usepackage{graphicx} % Extended graphics support
|
\\usepackage{graphicx} % Extended graphics support
|
||||||
\\usepackage{longtable} % For multi-page tables
|
\\usepackage{longtable} % For multi-page tables
|
||||||
\\usepackage{calc} % For margin indents
|
\\usepackage{calc} % For margin indents
|
||||||
@ -78,8 +78,8 @@ _LATEX_TEMPLATE = '''\\usepackage[T1]{fontenc}
|
|||||||
% narrow. This can be corrected by uncommenting the following
|
% narrow. This can be corrected by uncommenting the following
|
||||||
% two lines and adjusting the width appropriately. The example
|
% two lines and adjusting the width appropriately. The example
|
||||||
% removes 0.5in from each margin. (Adds 1 inch to the text)
|
% removes 0.5in from each margin. (Adds 1 inch to the text)
|
||||||
\\addtolength{\\oddsidemargin}{-0.5in}
|
%\\addtolength{\\oddsidemargin}{-0.5in}
|
||||||
\\addtolength{\\textwidth}{1.0in}
|
%\\addtolength{\\textwidth}{1.0in}
|
||||||
%
|
%
|
||||||
% Create a margin-adjusting command that allows LaTeX
|
% Create a margin-adjusting command that allows LaTeX
|
||||||
% to behave like the other gramps-supported output formats
|
% to behave like the other gramps-supported output formats
|
||||||
@ -613,7 +613,7 @@ class LaTeXDoc(BaseDoc, TextDoc):
|
|||||||
text = str(styledtext)
|
text = str(styledtext)
|
||||||
|
|
||||||
s_tags = styledtext.get_tags()
|
s_tags = styledtext.get_tags()
|
||||||
if format == 1:
|
if format:
|
||||||
#preformatted, use different escape function
|
#preformatted, use different escape function
|
||||||
self._backend.setescape(True)
|
self._backend.setescape(True)
|
||||||
|
|
||||||
@ -625,15 +625,18 @@ class LaTeXDoc(BaseDoc, TextDoc):
|
|||||||
# A quick solution: create a minipage for the note and add that always
|
# A quick solution: create a minipage for the note and add that always
|
||||||
# hoping that the user will have left sufficient room for the page
|
# hoping that the user will have left sufficient room for the page
|
||||||
self._backend.write("\\begin{minipage}{{0.8\\linewidth}}\n")
|
self._backend.write("\\begin{minipage}{{0.8\\linewidth}}\n")
|
||||||
|
if format:
|
||||||
self.start_paragraph(style_name)
|
self.start_paragraph(style_name)
|
||||||
self._backend.write(markuptext)
|
self._backend.write(markuptext)
|
||||||
self.end_paragraph()
|
self.end_paragraph()
|
||||||
#end the minipage, add trick to have a white line at bottom of note,
|
|
||||||
# we assume here a note should be distinct from its surrounding.
|
|
||||||
self._backend.write("\n\\vspace*{0.5cm} \n\end{minipage}\n\n")
|
|
||||||
if format == 1:
|
|
||||||
#preformatted finished, go back to normal escape function
|
#preformatted finished, go back to normal escape function
|
||||||
self._backend.setescape(False)
|
self._backend.setescape(False)
|
||||||
|
else:
|
||||||
|
for line in markuptext.split('\n\n'):
|
||||||
|
self.start_paragraph(style_name)
|
||||||
|
self._backend.write(line)
|
||||||
|
self.end_paragraph()
|
||||||
|
self._backend.write("\n\\vspace*{0.5cm} \n\end{minipage}\n\n")
|
||||||
|
|
||||||
def write_endnotes_ref(self, text, style_name):
|
def write_endnotes_ref(self, text, style_name):
|
||||||
"""
|
"""
|
||||||
@ -642,8 +645,6 @@ class LaTeXDoc(BaseDoc, TextDoc):
|
|||||||
self._backend.write("\\begin{minipage}{{0.8\\linewidth}}\n")
|
self._backend.write("\\begin{minipage}{{0.8\\linewidth}}\n")
|
||||||
for line in text.split('\n'):
|
for line in text.split('\n'):
|
||||||
self.start_paragraph(style_name)
|
self.start_paragraph(style_name)
|
||||||
# self._backend.write('\\begin{verbatim}')
|
|
||||||
self.write_text(line)
|
self.write_text(line)
|
||||||
# self._backend.write('\\end{verbatim}')
|
|
||||||
self.end_paragraph()
|
self.end_paragraph()
|
||||||
self._backend.write("\n\\vspace*{0.5cm} \n\end{minipage}\n\n")
|
self._backend.write("\n\\vspace*{0.5cm} \n\end{minipage}\n\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user