Debian Codegraph @

texmf-dist/doc/latex/biblatex-software/showcase-crossref.tex

raw
1 \documentclass[11pt]{article}
2 \usepackage{a4wide}
3 \usepackage{hyperref}
4 \usepackage[
5 style=numeric,
6 datamodel=software,
7 abbreviate=false,
8 natbib=true,
9 sorting=ydnt,
10 backend=biber,
11 bibencoding=utf8,
12 giveninits=true,
13 url=false,
14 doi=false,
15 maxcitenames=10,
16 maxbibnames=100]{biblatex}
17
18 % Load the software biblatex style
19 \makeatletter
20 \def\input@path{{.}}
21 \makeatother
22 \usepackage{software-biblatex}
23
24 % Set software specific bibliography options
25 \ExecuteBibliographyOptions{
26 halid=true,
27 swhid=true,
28 shortswhid=true,
29 swlabels=true,
30 vcs=true,
31 license=false,
32 addendum=false,
33 crossrefexpansion=conditional}
34
35 \addbibresource{showcase-crossref.bib}
36
37 \title{Crossref Functionality Showcase}
38 \author{Software Bibliography Style}
39 \date{\today}
40
41 \begin{document}
42
43 \maketitle
44
45 \begin{abstract}
46 This document demonstrates all features of the crossref implementation for software bibliography entries. It shows how inheritance chains work, how fields are compared, and how concise crossref formatting is applied. Each section includes examples with citations and the resulting bibliography entries.
47 \end{abstract}
48
49 \tableofcontents
50 \newpage
51
52 \section{Introduction}
53
54 The crossref functionality allows software bibliography entries to reference parent entries, creating inheritance chains where child entries inherit fields from their parents. This enables concise bibliography formatting by showing only the differences between child and parent entries.
55
56 \subsection{Key Concepts}
57
58 \begin{itemize}
59 \item \textbf{Inheritance}: Child entries automatically inherit fields from parent entries via the \texttt{crossref} field
60 \item \textbf{Field Comparison}: The system compares child fields with parent fields to determine what to display
61 \item \textbf{Concise Format}: Only differing fields are shown, with a citation reference to the parent
62 \item \textbf{Version/SWHID Requirement}: For Software → Version relationships to make sense, each \texttt{@softwareversion} entry MUST have either:
63 \begin{itemize}
64 \item An explicit \texttt{version} field, OR
65 \item A \texttt{swhid} id
66 \end{itemize}
67 Entries without either will not use the ``version X of [parent]'' format.
68 \item \textbf{Relationship Types}: Different entry types use different relationship text:
69 \begin{itemize}
70 \item Versions: ``version X of [citation]''
71 \item Modules: ``part of [citation]''
72 \item Fragments: ``from [citation]''
73 \end{itemize}
74 \item \textbf{Duplicate Detection}: When all key fields are equal, a warning is issued and the full entry is shown
75 \end{itemize}
76
77 \subsection{Inheritance Chains}
78
79 The following inheritance chains are supported:
80 \begin{itemize}
81 \item \textbf{2-level}: Software → Version
82 \item \textbf{3-level}: Software → Version → Module
83 \item \textbf{3-level}: Software → Version → Fragment
84 \item \textbf{4-level}: Software → Version → Module → Fragment
85 \end{itemize}
86
87 \newpage
88
89 \section{Basic Software → Version Examples}
90
91 This section demonstrates basic crossref scenarios between software and softwareversion entries, using the real-world Scilab example.
92
93 \subsection{Base Software Entry}
94
95 Scilab is a software for numerical computation. Here is the base software entry \cite{delebecque:hal-02090402}.
96
97 \subsection{Version with Different Date}
98
99 When only the date differs (but the version field is present), the output shows the version, date, and citation. The version field is required for proper Software → Version inheritance.
100
101 Example: \cite{delebecque:hal-02090402v1}
102
103 The output format is: \textit{Version 1.1, Jan. 1994 of [parent citation]}. The version entry shows the version number and date difference (1994 vs 1994-01) while inheriting author, title, and institution. It also includes SWHID and file information.
104
105 \subsection{Version with Different Version Number}
106
107 When only the version number differs, the output shows the version and date with a reference to the parent. Note that the \texttt{@softwareversion} entry must have an explicit \texttt{version} field or \texttt{swhid} id for this format to be used.
108
109 Example: \cite{delebecque:hal-02090402v2}
110
111 The output format is: \textit{Version 2.0, 1995 of [parent citation]}.
112
113 \subsection{Version with Different Title}
114
115 When the title differs, it is shown along with the citation.
116
117 Example: \cite{delebecque:hal-02090402v3}
118
119 The output shows the overridden title ``Scilab Extended'' along with the version and citation reference.
120
121 \subsection{Version with All Fields Equal (Warning Case)}
122
123 When a version entry has all fields identical to its parent, the system emits a warning and shows the full entry. This indicates a potential duplicate that should be reviewed.
124
125 Example: \cite{showcase-version-duplicate}
126
127 \textbf{Note}: Check the compilation log for a warning message about duplicate entries. This synthetic example is kept for pedagogical demonstration of duplicate detection.
128
129 \newpage
130
131 \section{Module Inheritance Examples}
132
133 Modules are components of software that can have their own versions or inherit versions from their parent. This section uses the real-world CGAL (Computational Geometry Algorithms Library) example throughout.
134
135 \subsection{Base Setup}
136
137 We start with the CGAL base software entry \cite{cgal} and its version \cite{cgal:5-0-2}.
138
139 \subsection{Module Inheriting Version}
140
141 When a module does not have an explicit version field, it inherits the version from its parent but does not display it. Only the author, subtitle, and ``part of'' relationship are shown.
142
143 Example: \cite{cgal:lp-gi-20a}
144
145 The output format is: \textit{M. Karavelas, ``2D Voronoi Diagram Adaptor'', part of [parent citation]} (no version shown, inherits from parent). The module also shows its license and URL, properly referencing the parent version.
146
147 \subsection{Module with Own Version}
148
149 When a module has its own explicit version that differs from the parent, both the version and the ``part of'' relationship are shown, along with the author.
150
151 Example: \cite{cgal:module-with-version}
152
153 The output format is: \textit{S. Pion, ``3D Convex Hull'', version 4.0 part of [parent citation]}.
154
155 \subsection{Module with Different Author}
156
157 Modules can have different authors while still referencing the parent.
158
159 Example: \cite{cgal:module-diff-author}
160
161 The output shows the different author (A. Fabri) along with the subtitle and ``part of'' relationship.
162
163 \newpage
164
165 \section{Fragment Inheritance Examples}
166
167 Code fragments represent specific code sections extracted from larger software components. This section uses the real-world Parmap library example throughout.
168
169 \subsection{Base Setup}
170
171 We start with the Parmap base software entry \cite{parmap} and its version \cite{parmap-1.1.1}.
172
173 \subsection{Fragment from Version}
174
175 A fragment can reference a version directly. The output shows the subtitle, date, and a reference to the parent version.
176
177 Example: \cite{simplemapper}
178
179 The output format is: \textit{``Core mapping routine'', 2020 from [parent citation]} (includes SWHID information with path and line numbers).
180
181 \subsection{Fragment from Module}
182
183 Fragments can also reference modules, creating a 4-level chain: Software → Version → Module → Fragment.
184
185 Example: \cite{parmap-fragment-from-module}
186
187 This demonstrates a complete 4-level inheritance chain where the fragment references a module, which in turn references a version, which references the base software entry.
188
189 \newpage
190
191 \section{Multi-level Inheritance}
192
193 This section demonstrates deep inheritance chains with multiple levels, using real-world examples.
194
195 \subsection{3-Level Chain: Software → Version → Module}
196
197 A complete 3-level chain showing how modules inherit from versions. This example uses the real-world CGAL library.
198
199 \begin{itemize}
200 \item Base software: \cite{cgal}
201 \item Version: \cite{cgal:5-0-2}
202 \item Module: \cite{cgal:lp-gi-20a}
203 \end{itemize}
204
205 The module properly references its parent version in the bibliography, showing only the fields that differ from the parent (author, subtitle, license, URL).
206
207 \subsection{4-Level Chain: Software → Version → Module → Fragment}
208
209 The deepest supported chain demonstrates complete inheritance. This example uses the real-world Parmap library.
210
211 \begin{itemize}
212 \item Base software: \cite{parmap}
213 \item Version: \cite{parmap-1.1.1}
214 \item Module: \cite{parmap-module-core}
215 \item Fragment: \cite{parmap-fragment-from-module}
216 \end{itemize}
217
218 Each level correctly references its parent, showing the complete inheritance chain. The fragment shows its subtitle and SWHID information, referencing the module which references the version which references the base software.
219
220 \subsection{Deep Chain with Module Version}
221
222 A module can have its own version in a deep chain. This example uses CGAL with a module variant that has an explicit version.
223
224 \begin{itemize}
225 \item Base: \cite{cgal}
226 \item Version: \cite{cgal:5-0-2}
227 \item Module with version: \cite{cgal:module-with-version}
228 \item Fragment: (fragment from module with version can be created if needed)
229 \end{itemize}
230
231 The module with its own version (4.0) is shown along with the ``part of'' relationship to the parent version.
232
233 \subsection{4-Level Chain: CGAL Voronoi Module → Fragment}
234
235 A complete 4-level chain using the CGAL Voronoi Diagram Adaptor module, showing a fragment extracted from the module.
236
237 \begin{itemize}
238 \item Base software: \cite{cgal}
239 \item Version: \cite{cgal:5-0-2}
240 \item Module: \cite{cgal:lp-gi-20a}
241 \item Fragment: \cite{cgal:voronoi-fragment}
242 \end{itemize}
243
244 This demonstrates a fragment (``Print Endpoint'') extracted from the CGAL Voronoi Diagram Adaptor module, creating a complete 4-level inheritance chain. The fragment shows its subtitle and SWHID information with path and line numbers, referencing the module.
245
246
247 \newpage
248
249 \section{Edge Cases and Special Scenarios}
250
251 This section demonstrates how the system handles special cases. These examples use synthetic entries specifically designed to test boundary conditions that may not exist in real-world data.
252
253 \subsection{Editor Field Comparison}
254
255 Entries with editor fields are compared correctly.
256
257 \begin{itemize}
258 \item Base with editor: \cite{showcase-with-editor}
259 \item Version with same editor: \cite{showcase-editor-same}
260 \item Version with different editor: \cite{showcase-editor-diff}
261 \end{itemize}
262
263 \subsection{Date Precision Differences}
264
265 The system handles different date precisions (year, year-month, full date).
266
267 \begin{itemize}
268 \item Base (year only): \cite{showcase-date-base}
269 \item Version (year-month): \cite{showcase-date-year-month}
270 \item Version (full date): \cite{showcase-date-full}
271 \end{itemize}
272
273 \subsection{Multiple Authors}
274
275 Entries with multiple authors are handled correctly.
276
277 \begin{itemize}
278 \item Base with 3 authors: \cite{showcase-multi-author}
279 \item Version with 4 authors: \cite{showcase-multi-author-version}
280 \end{itemize}
281
282 \newpage
283
284 \section{Complete Bibliography}
285
286 The following bibliography shows all entries with their crossref relationships and concise formatting.
287
288 \printbibliography[title={Complete Showcase Bibliography}]
289
290 \section{Summary}
291
292 This showcase demonstrates:
293
294 \begin{itemize}
295 \item Basic crossref functionality between software and versions (using Scilab)
296 \item Module inheritance with and without explicit versions (using CGAL)
297 \item Fragment inheritance from versions and modules (using Parmap)
298 \item Multi-level inheritance chains (3 and 4 levels) using real-world examples
299 \item Edge cases including editor fields, date precision, and multiple authors
300 \item Duplicate entry detection and warnings
301 \end{itemize}
302
303 All examples show how the crossref system creates concise bibliography entries by showing only the differences between child and parent entries, making bibliographies more readable and avoiding redundant information.
304
305 \end{document}
306