API Reference¶
Auto-generated API documentation from source code docstrings.
Core¶
SmithDocument¶
papersmith.core.document.SmithDocument
¶
High-level document creation and manipulation API.
Example
doc = SmithDocument(preset="academic") doc.add_heading("Introduction", level=1) doc.add_text("The time complexity is $O(n \log n)$.") doc.add_equation(r"T(n) = 2T(n/2) + n") doc.save("output.docx")
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preset
|
str | dict[str, Any]
|
Style preset name or dict. Defaults to "academic". |
'academic'
|
Source code in src/papersmith/core/document.py
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 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | |
citations
property
¶
Access the citation manager for this document.
Creates one on first access.
metadata
property
¶
Access the document metadata manager.
preset
property
¶
Get the current style preset.
__repr__()
¶
add_bibliography()
¶
Add the bibliography section using all cited sources.
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_bullet_list(items)
¶
Add a bullet list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
items
|
list[str]
|
List item texts. |
required |
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_chart(chart_type, data, title=None, xlabel=None, ylabel=None, width=12.0, caption=None)
¶
Add an embedded chart to the document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart_type
|
str
|
Type of chart (bar, line, pie, scatter). |
required |
data
|
dict[str, Any]
|
Chart data as dict (keys=labels, values=numbers). |
required |
title
|
str | None
|
Chart title. |
None
|
xlabel
|
str | None
|
X-axis label. |
None
|
ylabel
|
str | None
|
Y-axis label. |
None
|
width
|
float
|
Image width in centimeters. |
12.0
|
caption
|
str | None
|
Optional caption text below the chart. |
None
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_code(code, language=None)
¶
Add a formatted code block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
str
|
Code text. |
required |
language
|
str | None
|
Optional language name. |
None
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_cover_page(title, author=None, institution=None, date=None, subtitle=None)
¶
Add a styled cover page.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Document title. |
required |
author
|
str | None
|
Author name. |
None
|
institution
|
str | None
|
Institution or organization. |
None
|
date
|
str | None
|
Date string (defaults to current date). |
None
|
subtitle
|
str | None
|
Optional subtitle. |
None
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_equation(latex)
¶
Add a display-mode LaTeX equation.
The equation is rendered as native OMML, which is editable in Microsoft Word.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
latex
|
str
|
LaTeX math expression (without $ delimiters). |
required |
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_heading(text, level=1)
¶
Add a heading to the document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Heading text. |
required |
level
|
int
|
Heading level (1-6). |
1
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_image(image, width=None, caption=None)
¶
Add an image to the document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
str | bytes | BytesIO
|
File path, bytes, or BytesIO of the image. |
required |
width
|
float | None
|
Image width in centimeters. |
None
|
caption
|
str | None
|
Optional caption text. |
None
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_numbered_list(items)
¶
Add a numbered list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
items
|
list[str]
|
List item texts. |
required |
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_page_break()
¶
add_page_numbers(position='footer-center', format_str='Page {page}')
¶
Add automatic page numbers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
str
|
Position string (e.g., "footer-center", "header-right"). |
'footer-center'
|
format_str
|
str
|
Format with {page} placeholder. |
'Page {page}'
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_separator()
¶
add_table(headers, rows, style=None)
¶
Add a table to the document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
headers
|
list[str]
|
Column header texts. |
required |
rows
|
list[list[str]]
|
Row data (list of lists). |
required |
style
|
str | None
|
Optional Word table style name. |
None
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_text(text, bold=False, italic=False, underline=False)
¶
Add a paragraph of text.
Supports inline LaTeX: wrap math in $...$ for inline equations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Paragraph text. |
required |
bold
|
bool
|
Bold formatting. |
False
|
italic
|
bool
|
Italic formatting. |
False
|
underline
|
bool
|
Underline formatting. |
False
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
add_toc(title='Table of Contents', max_level=3)
¶
Add a Table of Contents.
The TOC is populated when opened in Word (Update Field).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Title text above the TOC. |
'Table of Contents'
|
max_level
|
int
|
Maximum heading level to include. |
3
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
delete_section(heading)
¶
Delete a section (heading + content) from the document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
heading
|
str
|
The heading text of the section to delete. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the section was found and deleted, False otherwise. |
Source code in src/papersmith/core/document.py
export_pdf(path)
¶
Export the document as PDF.
Requires docx2pdf (which needs Office or LibreOffice).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Output PDF file path. |
required |
Raises:
| Type | Description |
|---|---|
ImportError
|
If docx2pdf is not installed. |
Source code in src/papersmith/core/document.py
find_replace(old, new, count=0)
¶
Find and replace text in the document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
old
|
str
|
Text to find. |
required |
new
|
str
|
Replacement text. |
required |
count
|
int
|
Max replacements (0 = all). |
0
|
Returns:
| Type | Description |
|---|---|
int
|
Number of replacements made. |
Source code in src/papersmith/core/document.py
get_full_text()
¶
Get the full plain text of the document.
Returns:
| Type | Description |
|---|---|
str
|
All paragraph text joined by newlines. |
get_outline()
¶
Get the document heading hierarchy.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List of dicts with 'level' and 'text' keys. |
Source code in src/papersmith/core/document.py
get_section_text(heading)
¶
Get the text content under a specific heading.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
heading
|
str
|
The heading text to find. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Concatenated text under the heading, or None if not found. |
Source code in src/papersmith/core/document.py
open(path)
classmethod
¶
Open an existing Word document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to the .docx file. |
required |
Returns:
| Type | Description |
|---|---|
SmithDocument
|
A SmithDocument wrapping the opened document. |
Source code in src/papersmith/core/document.py
replace_section(heading, new_content)
¶
Replace the content under a heading (keeping the heading).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
heading
|
str
|
The heading text of the section. |
required |
new_content
|
str
|
New text content to replace with. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the section was found and replaced, False otherwise. |
Source code in src/papersmith/core/document.py
save(path)
¶
Save the document as a .docx file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Output file path. |
required |
set_footer(text)
¶
Set the document footer text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Footer text. |
required |
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
set_header(text, first_page=None)
¶
Set the document header text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Header text for all pages. |
required |
first_page
|
str | None
|
Different text for first page (empty string = no header). |
None
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
set_metadata(author=None, title=None, subject=None, scrub=False)
¶
Set document metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
author
|
str | None
|
Author name. |
None
|
title
|
str | None
|
Document title. |
None
|
subject
|
str | None
|
Document subject. |
None
|
scrub
|
bool
|
If True, scrub all metadata for realistic values. |
False
|
Returns:
| Type | Description |
|---|---|
SmithDocument
|
Self for method chaining. |
Source code in src/papersmith/core/document.py
to_bytes()
¶
Export the document as bytes (no file I/O).
Returns:
| Type | Description |
|---|---|
bytes
|
The document as bytes. |
to_stream()
¶
Export the document as a BytesIO stream.
Returns:
| Type | Description |
|---|---|
BytesIO
|
BytesIO stream of the document. |
StylePreset¶
papersmith.core.styles.StylePreset
dataclass
¶
Complete style configuration for a document.
Source code in src/papersmith/core/styles.py
to_dict()
¶
Convert preset to a dictionary.
Source code in src/papersmith/core/styles.py
Margins¶
papersmith.core.styles.Margins
dataclass
¶
Citations¶
CitationManager¶
papersmith.citations.manager.CitationManager
¶
Manages citation sources and formatting for a document.
Supports multiple citation styles (APA, IEEE, Harvard, MLA, Chicago) and provides methods to add sources, resolve inline citations, and generate bibliography sections.
Example
manager = CitationManager() manager.style = "ieee" manager.add_source("knuth1997", author="Donald Knuth", title="TAOCP", year=1997) manager.format_inline("knuth1997") '[1]'
Source code in src/papersmith/citations/manager.py
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 | |
sources
property
¶
Get all registered sources.
style
property
writable
¶
Get the current citation style.
add_source(key, **kwargs)
¶
Register a citation source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Unique source identifier. |
required |
**kwargs
|
Any
|
Source fields (author, title, year, etc.). |
{}
|
Source code in src/papersmith/citations/manager.py
format_bibliography_entry(key)
¶
Format a single bibliography entry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Source identifier. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Formatted bibliography string. |
Source code in src/papersmith/citations/manager.py
format_inline(key)
¶
Format an inline citation for the given source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Source identifier. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Formatted inline citation string. |
Source code in src/papersmith/citations/manager.py
get_bibliography()
¶
Get all bibliography entries in order.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of formatted bibliography strings. |
Source code in src/papersmith/citations/manager.py
get_source(key)
¶
Get a source by key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Source identifier. |
required |
Returns:
| Type | Description |
|---|---|
Source
|
The Source object. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the source is not found. |
Source code in src/papersmith/citations/manager.py
import_bibtex(path)
¶
Import sources from a BibTeX file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the .bib file. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Number of sources imported. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If bibtexparser is not installed. |
Source code in src/papersmith/citations/manager.py
resolve_citations(text)
¶
Resolve {cite:key} markers in text to formatted citations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Text containing {cite:key} markers. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Text with citations resolved. |
Source code in src/papersmith/citations/manager.py
Source¶
papersmith.citations.source.Source
dataclass
¶
Represents a citation source (book, article, etc.).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Unique identifier for the source (e.g., "knuth1997"). |
required |
source_type
|
str
|
Type of source (article, book, inproceedings, etc.). |
'article'
|
author
|
str
|
Author name(s). |
''
|
title
|
str
|
Title of the work. |
''
|
year
|
int | None
|
Publication year. |
None
|
journal
|
str | None
|
Journal name (for articles). |
None
|
publisher
|
str | None
|
Publisher name (for books). |
None
|
volume
|
str | None
|
Volume number. |
None
|
issue
|
str | None
|
Issue number. |
None
|
pages
|
str | None
|
Page range (e.g., "10-25"). |
None
|
doi
|
str | None
|
Digital Object Identifier. |
None
|
url
|
str | None
|
URL reference. |
None
|
isbn
|
str | None
|
ISBN number. |
None
|
booktitle
|
str | None
|
Book title (for inproceedings). |
None
|
editor
|
str | None
|
Editor name(s). |
None
|
edition
|
str | None
|
Edition number. |
None
|
institution
|
str | None
|
Institution name. |
None
|
extra
|
dict[str, Any]
|
Additional fields. |
dict()
|
Source code in src/papersmith/citations/source.py
get_authors_list()
¶
Parse the author string into a list of individual authors.
Handles "and" separated authors (BibTeX style).
Returns:
| Type | Description |
|---|---|
list[str]
|
List of author name strings. |
Source code in src/papersmith/citations/source.py
get_last_name()
¶
Get the last name of the first author.
Returns:
| Type | Description |
|---|---|
str
|
Last name string, or empty string if no author. |
Source code in src/papersmith/citations/source.py
Charts¶
render_chart¶
papersmith.charts.renderer.render_chart(chart_type, data, title=None, xlabel=None, ylabel=None, color_scheme='professional', width=6.0, height=4.0, dpi=300)
¶
Render a chart to PNG bytes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart_type
|
str
|
Type of chart (bar, line, pie, scatter). |
required |
data
|
dict[str, Any]
|
Chart data as a dict (keys=labels, values=numbers). |
required |
title
|
str | None
|
Chart title. |
None
|
xlabel
|
str | None
|
X-axis label. |
None
|
ylabel
|
str | None
|
Y-axis label. |
None
|
color_scheme
|
str
|
Color palette name. |
'professional'
|
width
|
float
|
Figure width in inches. |
6.0
|
height
|
float
|
Figure height in inches. |
4.0
|
dpi
|
int
|
Output resolution. |
300
|
Returns:
| Type | Description |
|---|---|
bytes
|
PNG image bytes. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If matplotlib is not installed. |
ValueError
|
If chart_type is not supported. |
Source code in src/papersmith/charts/renderer.py
render_matplotlib_figure¶
papersmith.charts.renderer.render_matplotlib_figure(fig, dpi=300)
¶
Render an existing matplotlib Figure to PNG bytes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fig
|
Any
|
A matplotlib Figure object. |
required |
dpi
|
int
|
Output resolution. |
300
|
Returns:
| Type | Description |
|---|---|
bytes
|
PNG image bytes. |
Source code in src/papersmith/charts/renderer.py
Metadata¶
MetadataManager¶
papersmith.core.metadata.MetadataManager
¶
Manages document metadata (author, title, dates, etc.).
Provides methods to set individual properties and to scrub all metadata to remove signs of programmatic generation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc
|
Document
|
The python-docx Document whose metadata to manage. |
required |
Source code in src/papersmith/core/metadata.py
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 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | |
author
property
writable
¶
Get the document author.
created
property
writable
¶
Get the creation date.
editing_time
property
writable
¶
Get the total editing time in minutes.
keywords
property
writable
¶
Get the document keywords.
last_modified_by
property
writable
¶
Get the last modified by name.
modified
property
writable
¶
Get the last modified date.
revision
property
writable
¶
Get the revision number.
subject
property
writable
¶
Get the document subject.
title
property
writable
¶
Get the document title.
scrub(author=None, realistic_dates=True, editing_time_minutes=None)
¶
Scrub all metadata to remove programmatic generation fingerprints.
Sets realistic values that make the document appear hand-authored in Microsoft Word.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
author
|
str | None
|
Author name to set. If None, uses existing or "User". |
None
|
realistic_dates
|
bool
|
Generate realistic creation/modified dates. |
True
|
editing_time_minutes
|
int | None
|
Total editing time. Random 30-180 if None. |
None
|
Source code in src/papersmith/core/metadata.py
set_application(name='Microsoft Office Word', version='16.0000')
¶
Set the application name and version in extended properties.
Note: python-docx doesn't directly expose app.xml properties, so this modifies the XML directly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Application name. |
'Microsoft Office Word'
|
version
|
str
|
Application version string. |
'16.0000'
|
Source code in src/papersmith/core/metadata.py
to_dict()
¶
Export metadata as a dictionary.
Source code in src/papersmith/core/metadata.py
Style Presets¶
get_preset¶
papersmith.core.styles.get_preset(name)
¶
Get a style preset by name or from a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | dict[str, Any]
|
Preset name (e.g., "academic") or a dict of preset values. |
required |
Returns:
| Type | Description |
|---|---|
StylePreset
|
The resolved StylePreset. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the preset name is not found. |