-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodt-example.export
More file actions
191 lines (157 loc) · 9.7 KB
/
odt-example.export
File metadata and controls
191 lines (157 loc) · 9.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# ==========================================================================
# ____ _ _ _____ __ ______
# | __ )(_) |_|_ _|__\ \/ / ___|___ _ ____ __
# | _ \| | '_ \| |/ _ \ / | / _ \| '_ \ \ / /
# | |_) | | |_) | | __// \ |__| (_) | | | \ V /
# |____/|_|_.__/|_|\___/_/\_\____\___/|_| |_|\_/
#
# --- BibTeX Converter ---
# https://www.nntb.no/~dreibh/bibtexconv/
# ==========================================================================
#
# BibTeXConv OpenDocument Text (ODT) Export Example
# Copyright (C) 2010-2026 by Thomas Dreibholz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact: thomas.dreibholz@gmail.com
# Select entries:
# The first argument is the original BibTeX reference,
# The second argument is a new anchor for printing.
# cite LCN2005 TD01
# cite LCA2003 TD02
# cite IJHIT2008 TD03
# cite Dre2006 TD04
citeAll
sort year/D month/D day/D title/A
# ###########################################################################
# #### Export to OpenDocument Text (ODT) ####
# ###########################################################################
# ====== Set header and trailer of each publication entry ===================
# ----- Encode strings in XML style, e.g. <, >, &, etc.----------------------
xmlStyle
# ----- Non-breakable space character (2 bytes!) used by ODT ----------------
nbsp \xc2\xa0
# ------ Write the ODT header in contents.xml -------------------------------
echo <?xml version="1.0" encoding="UTF-8"?>\n
echo <office:document-content xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0">\n
echo \n
echo <office:automatic-styles>\n
echo <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">\n
echo <style:paragraph-properties fo:text-align="justify" style:justify-single-word="false"/>\n
echo </style:style>\n
echo <style:style style:name="T1" style:family="text">\n
echo <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>\n
echo </style:style>\n
echo <style:style style:name="T2" style:family="text">\n
echo <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>\n
echo </style:style>\n
echo <style:style style:name="T3" style:family="text">
echo <style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
echo </style:style>
echo </office:automatic-styles>\n
echo \n
echo <office:body>\n
echo <office:text>\n
echo \n
echo <text:h text:style-name="Heading_20_1" text:outline-level="1">References</text:h>\n
echo \n
# ====== This is the printing template ======================================
templatenew
# ***** Subsection: YEAR ****************************************************
template+ [%{begin-subdivision-year}<text:h text:style-name="Heading_20_2" text:outline-level="2">%{year}</text:h>]
# ***** Subsubsection: MONTH ************************************************
template+ [%{begin-subdivision-month}<text:h text:style-name="Heading_20_3" text:outline-level="3">%{month-name}</text:h>]
# ****** Begin of Entry *****************************************************
template+ <text:p text:style-name="P1">
# ***** Authors *************************************************************
template+ <text:span text:style-name="T1">
# Set mark with label:
template+ \[<text:bookmark-start text:name="%{label}"/>%{anchor}<text:bookmark-end text:name="%{label}"/>\][ ]
# Begin of author loop:
template+ %{begin-author-loop}
# Separator, for first/last/middle author:
template+ [%{is-first-author?}|%{is-not-first-author?}; | and ]%{author-family-name}[, %{author-give-name}]
# End of author loop:
template+ %{end-author-loop}
template+ :[ ]
template+ </text:span>
# ***** Title ***************************************************************
template+ “[<text:a xlink:type="simple" xlink:href="%{url}">%{title}</text:a>|%{title}]”
# ****** Document details ***************************************************
# The document details appear in braces ( ... ), if they are available.
# Add opening parenthesis "(", if "url" or "language" are set:
template+ [%{url}%{is-not?}%{url-type}%{is-not?HTML} \(|%{language}%{is-not?} \(]
# ------ Download -----------------------------------------------------------
template+ [
# Only show file type and length for non-HTML types:
template+ [%{url-type}%{is-not?HTML}
template+ <text:a xlink:type="simple" xlink:href="%{url}">[%{url-type}|Online]</text:a>
template+ [, %{url-size-kib}~KiB]
template+ ]
# Use plural or singular for number of pages: "n pages", or just "1 page":
template+ [(%{numpages}%{is-not?1}), %{numpages}~pages|, %{numpages}~page]
template+ ]
# ------ Language -----------------------------------------------------------
template+ [%{url}%{is-not?}[%{language}%{is-not?}, ]]
template+ [
template+ [%{content-language}|%{language}]%{is?norsk}🇳🇴|
template+ [%{content-language}|%{language}]%{is?german}🇩🇪|
template+ [%{content-language}|%{language}]%{is?ngerman}🇩🇪|
template+ [%{content-language}|%{language}]%{is?chinese}🇨🇳|
template+ [%{content-language}|%{language}]%{is?french}🇫🇷|
template+ [%{content-language}|%{language}]%{is?english}🇬🇧|
template+ in %{content-language}|
template+ in %{language}
template+ ]
# Add closing parenthesis ")", if "url" or "language" are set:
template+ [%{url}%{is-not?}%{url-type}%{is-not?HTML}\)|%{language}%{is-not?}\)]
# ***** Bibliographic data of publication ***********************************
template+ [, %{how-published}]
template+ [, in <text:span text:style-name="T3">%{journal}</text:span>]
template+ [, in <text:span text:style-name="T3">%{booktitle}</text:span>]
template+ [
template+ , %{type}[~%{number}][, %{series}][, vol.~%{volume}][, pp.~%{pages}]|
template+ [, %{series}][, vol.~%{volume}][, no.~%{number}][, pp.~%{pages}]
template+ ]
template+ [, %{publisher}]
template+ [, %{school}]
template+ [, %{institution}]
template+ [, URN~<text:a xlink:type="simple" xlink:href="https://nbn-resolving.org/%{urn}">%{urn}</text:a>]
template+ [, DOI~<text:a xlink:type="simple" xlink:href="https://dx.doi.org/%{doi}">%{doi}</text:a>]
template+ [, %{isbn}]
template+ [, %{issn}]
template+ [, %{address}]
template+ [, %{note}]
template+ [, [%{month-name}~%{day}, |%{month-name}~]%{year}]
template+ .
# ****** Awards *************************************************************
template+ [ <text:span text:style-name="T1">%{custom-1}.</text:span>]
# ***** URL including hyperlink *********************************************
template+ [
# Newline:
template+ </text:p><text:p text:style-name="P1">
template+ <text:span text:style-name="T2">
template+ 🔗<text:a xlink:type="simple" xlink:href="%{url}">%{url}</text:a>.
template+ </text:span>
template+ ]
# ****** End of Entry *******************************************************
template+ </text:p>
# New line:
template+ <text:p text:style-name="P1" />
# ====== Finally, export all selected publications ==========================
export
# ====== Generate tail for ODT contents.xml =================================
echo </office:text>
echo </office:body>
echo </office:document-content>