Skip to content

Commit 650801f

Browse files
author
Matthias Rabe
committed
book: include sources
Signed-off-by: Matthias Rabe <[email protected]>
1 parent f9f39f3 commit 650801f

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

reports/book.inc.rb

+24-8
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,22 @@ def report_person_print_profile(ged, indi, own_fams)
143143
$params[:ofile].print "\\vspace{0mm} \\centering \\incImage{width=10em}{#{conv_img4latex(mugshot)}}\n"
144144
$params[:ofile].print "\\end{minipage} \\hfill\n"
145145

146-
def t1(a, b, c, d= nil, e= nil, f= nil, g= nil)
146+
def t1(a, b, c, d= nil, e= nil, f= nil, g= nil, src_ids= [])
147147
s= []
148148
s += ["\\mbox{", b, h(c), "}"] if c.to_s != ""
149149
s += ["\\mbox{", d, h(e), "}"] if e.to_s != ""
150150
s += ["\\mbox{", f, h(g), "}"] if g.to_s != ""
151-
return(s.size > 0 ? "\\mbox{#{a}}: & #{s.join(' ')} \\\\\n" : "")
151+
152+
sources= report_person_sources_to_footnote(src_ids)
153+
return(s.size > 0 ? "\\mbox{#{a}}: & #{s.join(' ')} #{sources} \\\\\n" : "")
152154
end
153155

154156
$params[:ofile].print "\\begin{minipage}[t]{\\textwidth-10em} \\vspace{0mm}\n"
155157
$params[:ofile].print "\\begin{tabular}{p{4em} p{\\textwidth-15em}}\n"
156-
$params[:ofile].print t1("Geboren", "am", indi.birth, "in", indi.birth_place)
157-
$params[:ofile].print t1("Getauft", "am", indi.leaf, "in", indi.leaf_place)
158-
$params[:ofile].print t1("Gestorben", "am", indi.died, "in", indi.died_place)
158+
$params[:ofile].print t1("Kekule", "", "1")
159+
$params[:ofile].print t1("Geboren", "am", indi.birth, "in", indi.birth_place, nil, nil, indi.birth_sources(ged))
160+
$params[:ofile].print t1("Getauft", "am", indi.leaf, "in", indi.leaf_place, nil, nil, indi.leaf_sources(ged))
161+
$params[:ofile].print t1("Gestorben", "am", indi.died, "in", indi.died_place, nil, nil, indi.died_sources(ged))
159162
# TODO EVENT, GRAD, RELI, EVEN, GRAD, EDUC, RESI, CHAN(?), BLES ## USE FOR NOTES, too
160163

161164
own_fams.each {|own_fam|
@@ -305,8 +308,10 @@ def t2(f)
305308

306309
def report_person_print_notes(ged, indi)
307310
items= []
308-
[["Geburtsnotiz", "BIRT_NOTE"], ["Taufnotiz", "CHR_NOTE"], ["Sterbenotiz", "DEAT_NOTE"],
309-
["Andere", "NOTE"]].each {|x| key, val= x
311+
[ ["Geburtsnotiz", "BIRT_NOTE", "BIRT_SOUR"],
312+
["Taufnotiz", "CHR_NOTE", "CHR_SOUR" ],
313+
["Sterbenotiz", "DEAT_NOTE", "DEAT_SOUR"],
314+
["Andere", "NOTE", "?????????"]].each {|x| key, val, src= x
310315
indi.get_details(val).each {|note_id| text= note_id= note_id[:value]
311316
if note_id[0].chr == '@'
312317
note= ged.find_by_node_gid(note_id)
@@ -319,7 +324,9 @@ def report_person_print_notes(ged, indi)
319324
text= text.gsub("**********", "********** ") # hack to avaid LaTeX warning
320325
end
321326

322-
items << "\\item[#{key}] #{replace_newline(h(text))}"
327+
sources= report_person_sources_to_footnote(indi.get_sources(ged, src))
328+
329+
items << "\\item[#{key}] #{replace_newline(h(text))}" + sources
323330
}
324331
}
325332

@@ -335,6 +342,15 @@ def report_person_print_notes(ged, indi)
335342
return(true)
336343
end
337344

345+
def report_person_sources_to_footnote(srcs)
346+
sources= ""
347+
srcs.each {|src| next if src.nil?
348+
footnote = src.footnote
349+
sources += " \\footnote{#{h(footnote)}}" if footnote != ""
350+
}
351+
return sources
352+
end
353+
338354
def report_print_galerie(ged, section)
339355
items= {};
340356
section.objs.each {|o|

0 commit comments

Comments
 (0)