asciidoctor-pdf 1.6.2 → 2.0.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/CHANGELOG.adoc +224 -30
  4. data/NOTICE.adoc +16 -4
  5. data/README.adoc +207 -67
  6. data/asciidoctor-pdf.gemspec +3 -7
  7. data/data/fonts/ABOUT-mplus1mn-subset +1 -1
  8. data/data/fonts/ABOUT-mplus1p-subset +2 -2
  9. data/data/fonts/ABOUT-notosans-subset +26 -0
  10. data/data/fonts/ABOUT-notoserif-subset +1 -1
  11. data/data/fonts/{LICENSE-notoserif → LICENSE-noto} +0 -0
  12. data/data/fonts/mplus1mn-bold-subset.ttf +0 -0
  13. data/data/fonts/mplus1mn-bold_italic-subset.ttf +0 -0
  14. data/data/fonts/mplus1mn-italic-subset.ttf +0 -0
  15. data/data/fonts/mplus1mn-regular-subset.ttf +0 -0
  16. data/data/fonts/mplus1p-regular-fallback.ttf +0 -0
  17. data/data/fonts/notoemoji-subset.ttf +0 -0
  18. data/data/fonts/notosans-bold-subset.ttf +0 -0
  19. data/data/fonts/notosans-bold_italic-subset.ttf +0 -0
  20. data/data/fonts/notosans-italic-subset.ttf +0 -0
  21. data/data/fonts/notosans-regular-subset.ttf +0 -0
  22. data/data/fonts/notoserif-bold-subset.ttf +0 -0
  23. data/data/fonts/notoserif-bold_italic-subset.ttf +0 -0
  24. data/data/fonts/notoserif-italic-subset.ttf +0 -0
  25. data/data/fonts/notoserif-regular-subset.ttf +0 -0
  26. data/data/themes/base-theme.yml +18 -22
  27. data/data/themes/default-for-print-theme.yml +24 -0
  28. data/data/themes/default-for-print-with-fallback-font-theme.yml +3 -0
  29. data/data/themes/default-theme.yml +49 -54
  30. data/data/themes/default-with-fallback-font-theme.yml +2 -2
  31. data/data/themes/sans-with-fallback-font-theme.yml +10 -0
  32. data/docs/theming-guide.adoc +967 -344
  33. data/lib/asciidoctor/pdf/converter.rb +1691 -1478
  34. data/lib/asciidoctor/pdf/ext/asciidoctor/document.rb +18 -1
  35. data/lib/asciidoctor/pdf/ext/asciidoctor/image.rb +9 -15
  36. data/lib/asciidoctor/pdf/ext/asciidoctor/list.rb +6 -13
  37. data/lib/asciidoctor/pdf/ext/asciidoctor/section.rb +3 -16
  38. data/lib/asciidoctor/pdf/ext/asciidoctor.rb +1 -5
  39. data/lib/asciidoctor/pdf/ext/core/file.rb +1 -1
  40. data/lib/asciidoctor/pdf/ext/core/quantifiable_stdout.rb +1 -4
  41. data/lib/asciidoctor/pdf/ext/core/string.rb +2 -2
  42. data/lib/asciidoctor/pdf/ext/core.rb +1 -4
  43. data/lib/asciidoctor/pdf/ext/pdf-core/page.rb +8 -33
  44. data/lib/asciidoctor/pdf/ext/pdf-core.rb +0 -18
  45. data/lib/asciidoctor/pdf/ext/prawn/coderay_encoder.rb +5 -7
  46. data/lib/asciidoctor/pdf/ext/prawn/extensions.rb +433 -329
  47. data/lib/asciidoctor/pdf/ext/prawn/font/afm.rb +0 -4
  48. data/lib/asciidoctor/pdf/ext/prawn/font_metric_cache.rb +1 -1
  49. data/lib/asciidoctor/pdf/ext/prawn/formatted_text/arranger.rb +33 -3
  50. data/lib/asciidoctor/pdf/ext/prawn/formatted_text/box.rb +20 -14
  51. data/lib/asciidoctor/pdf/ext/prawn/formatted_text/fragment.rb +9 -3
  52. data/lib/asciidoctor/pdf/ext/prawn/images.rb +14 -16
  53. data/lib/asciidoctor/pdf/ext/prawn-svg/loaders/data.rb +6 -0
  54. data/lib/asciidoctor/pdf/ext/prawn-svg/loaders/web.rb +22 -0
  55. data/lib/asciidoctor/pdf/ext/prawn-svg/url_loader.rb +13 -0
  56. data/lib/asciidoctor/pdf/ext/prawn-svg.rb +5 -2
  57. data/lib/asciidoctor/pdf/ext/prawn-table/cell/asciidoc.rb +76 -20
  58. data/lib/asciidoctor/pdf/ext/prawn-table/cell/text.rb +39 -1
  59. data/lib/asciidoctor/pdf/ext/prawn-table/cell.rb +21 -15
  60. data/lib/asciidoctor/pdf/ext/prawn-table.rb +1 -1
  61. data/lib/asciidoctor/pdf/ext/pygments.rb +2 -2
  62. data/lib/asciidoctor/pdf/ext/rouge/formatters/prawn.rb +17 -20
  63. data/lib/asciidoctor/pdf/ext/rouge/themes/asciidoctor_pdf_default.rb +1 -0
  64. data/lib/asciidoctor/pdf/ext/rouge.rb +0 -1
  65. data/lib/asciidoctor/pdf/formatted_text/formatter.rb +2 -2
  66. data/lib/asciidoctor/pdf/formatted_text/inline_destination_marker.rb +8 -10
  67. data/lib/asciidoctor/pdf/formatted_text/inline_image_arranger.rb +69 -78
  68. data/lib/asciidoctor/pdf/formatted_text/inline_image_renderer.rb +7 -10
  69. data/lib/asciidoctor/pdf/formatted_text/inline_text_aligner.rb +2 -4
  70. data/lib/asciidoctor/pdf/formatted_text/parser.rb +53 -47
  71. data/lib/asciidoctor/pdf/formatted_text/parser.treetop +5 -7
  72. data/lib/asciidoctor/pdf/formatted_text/source_wrap.rb +14 -14
  73. data/lib/asciidoctor/pdf/formatted_text/text_background_and_border_renderer.rb +4 -7
  74. data/lib/asciidoctor/pdf/formatted_text/transform.rb +116 -109
  75. data/lib/asciidoctor/pdf/formatted_text.rb +0 -1
  76. data/lib/asciidoctor/pdf/index_catalog.rb +7 -11
  77. data/lib/asciidoctor/pdf/optimizer.rb +3 -5
  78. data/lib/asciidoctor/pdf/pdfmark.rb +16 -8
  79. data/lib/asciidoctor/pdf/roman_numeral.rb +4 -22
  80. data/lib/asciidoctor/pdf/sanitizer.rb +18 -13
  81. data/lib/asciidoctor/pdf/section_info_by_page.rb +24 -0
  82. data/lib/asciidoctor/pdf/theme_loader.rb +89 -79
  83. data/lib/asciidoctor/pdf/version.rb +1 -2
  84. data/lib/asciidoctor/pdf.rb +5 -2
  85. metadata +34 -64
  86. data/data/fonts/mplus1mn-bold-ascii.ttf +0 -0
  87. data/data/fonts/mplus1mn-bold_italic-ascii.ttf +0 -0
  88. data/data/fonts/mplus1mn-italic-ascii.ttf +0 -0
  89. data/data/fonts/mplus1mn-regular-ascii-conums.ttf +0 -0
  90. data/lib/asciidoctor/pdf/ext/asciidoctor/abstract_block.rb +0 -7
  91. data/lib/asciidoctor/pdf/ext/asciidoctor/abstract_node.rb +0 -7
  92. data/lib/asciidoctor/pdf/ext/asciidoctor/list_item.rb +0 -18
  93. data/lib/asciidoctor/pdf/ext/asciidoctor/logging_shim.rb +0 -33
  94. data/lib/asciidoctor/pdf/ext/core/array.rb +0 -11
  95. data/lib/asciidoctor/pdf/ext/core/hash.rb +0 -7
  96. data/lib/asciidoctor/pdf/ext/core/regexp.rb +0 -5
  97. data/lib/asciidoctor/pdf/ext/pdf-core/pdf_object.rb +0 -8
  98. data/lib/asciidoctor-pdf/converter.rb +0 -3
  99. data/lib/asciidoctor-pdf/version.rb +0 -3
@@ -7,7 +7,6 @@ Dan Allen <https://github.com/mojavelinux[@mojavelinux]>
7
7
  :experimental:
8
8
  ifndef::env-github[:icons: font]
9
9
  ifdef::env-github[]
10
- :outfilesuffix: .adoc
11
10
  :!toc-title:
12
11
  :caution-caption: :fire:
13
12
  :important-caption: :exclamation:
@@ -18,8 +17,8 @@ endif::[]
18
17
  :window: _blank
19
18
  // Aliases:
20
19
  :conum-guard-yaml: #
21
- ifndef::icons[:conum-guard-yaml: # #]
22
20
  ifdef::backend-pdf[:conum-guard-yaml: # #]
21
+ :url-repo-root: https://github.com/asciidoctor/asciidoctor-pdf/tree/main
23
22
  :url-fontforge: https://fontforge.github.io/en-US/
24
23
  :url-fontforge-scripting: https://fontforge.github.io/en-US/documentation/scripting/
25
24
  :url-prawn: http://prawnpdf.org
@@ -28,19 +27,18 @@ ifdef::backend-pdf[:conum-guard-yaml: # #]
28
27
  Topics remaining to document:
29
28
  * line height and line height length (and what that all means)
30
29
  * title page layout / title page images (logo & background)
31
- * document that unicode escape sequences can be used inside double-quoted strings
32
30
  ////
33
31
 
34
32
  [.lead]
35
- The theming system in Asciidoctor PDF is used to control the layout and styling of the PDF file Asciidoctor PDF generates from AsciiDoc.
36
- This document describes how the theming system works, how to define a custom theme in YAML and how to activate the theme when running Asciidoctor PDF.
33
+ The theming system is used to control the style of a PDF file generated by Asciidoctor PDF from AsciiDoc.
34
+ This document describes how the theming system works, how to define a custom theme in YAML, and how to activate the theme when running Asciidoctor PDF.
37
35
 
38
36
  TIP: The quickest way to create your own theme is to <<Extends,extend the default theme>>.
39
- This not only gives you a set of foundation styles to build on, it also provides a collection of <<Bundled Fonts,bundled fonts>>.
40
- If you want to replace the bundled fonts with your own, you must declare the name and location of each font in the <<Custom Fonts,font catalog>>.
41
- To reuse the bundled fonts, you can either extend the default theme and/or redeclare the bundled fonts in the font catalog.
37
+ This gives you a set of foundation styles to build on and provides a collection of <<Bundled Fonts,bundled fonts>> (which you don't have to redeclare).
38
+ If you want to use your own fonts, you must declare the name and location of each font in the <<Custom Fonts,font catalog>>.
39
+ If you want to combine your own fonts with the bundled fonts, you can either extend the font catalog (by setting `merge: true`) or <<Extending the Font Catalog,redeclare the bundled fonts>> alongside your own.
42
40
 
43
- WARNING: If you don't declare your own fonts (or extend the default theme), only the built-in (AFM) fonts provided by the PDF reader will be available.
41
+ WARNING: If the theme doesn't specify any fonts (nor are they being inherited), only the built-in (AFM) fonts provided by the PDF reader will be available.
44
42
  Using AFM fonts can result in missing functionality and warnings.
45
43
  See the <<Built-In (AFM) Fonts>> section to learn more about these limitations.
46
44
 
@@ -52,6 +50,10 @@ The Asciidoctor PDF theme language is described using the http://en.wikipedia.or
52
50
  Therefore, if you have a background in web design, the terminology should be immediately familiar to you.
53
51
  *Note, however, that the theming system isn't actually CSS.*
54
52
 
53
+ The theme can generally influence PDF settings, page numbering, font properties, background and borders, character selections, spacings, and running content.
54
+ It has limited influence over the layout of elements on the page.
55
+ If your theming requirements demand more than what this theming system can accomodate, you can <<extending-the-converter,extend the converter>> to gain more control over the layout and style.
56
+
55
57
  The theme file must be named _<name>-theme.yml_, where `<name>` is the name of the theme.
56
58
  _We recommend *not* using the names *base* or *default* so you don't confuse it with one of the built-in themes._
57
59
 
@@ -69,14 +71,14 @@ Some of these properties have different names from those found in CSS.
69
71
 
70
72
  * An underscore (`_`) may be used in place of a hyphen (`-`) in all property names (so you may use `font_family` or `font-family`).
71
73
  * An underscore (`_`) may be used in place of a hyphen (`-`) in all variable names (so you may use `$base_font_family` or `$base-font-family`).
72
- * Instead of separate properties for font weight and font style, the theme language combines these settings in the `font-style` property (allowed values: `normal`, `bold`, `italic` and `bold_italic`).
74
+ * Instead of separate properties for font weight and font style, the theme language combines these settings in the `font-style` property (allowed values: `normal`, `bold`, `italic`, and `bold_italic`).
73
75
  * The `align` property in the theme language is roughly equivalent to the `text-align` property in CSS.
74
76
  * The `font-color` property in the theme language is equivalent to the `color` property in CSS.
75
77
  ====
76
78
 
77
79
  A theme is described in a YAML-based data format and stored in a dedicated theme file.
78
80
  YAML is a human-friendly data format that resembles CSS and helps to describe the theme.
79
- The theme language adds some extra features to YAML, such as variables, basic math, measurements and color values.
81
+ The theme language adds some extra features to YAML, such as variables, basic math, measurements, and color values.
80
82
  These enhancements will be explained in detail in later sections.
81
83
 
82
84
  === Basic Theme
@@ -86,6 +88,7 @@ Here's an example of a basic theme file that extends the base theme:
86
88
  .basic-theme.yml
87
89
  [source,yaml]
88
90
  ----
91
+ extends: base
89
92
  page:
90
93
  layout: portrait
91
94
  margin: [0.75in, 1in, 0.75in, 1in]
@@ -96,16 +99,14 @@ base:
96
99
  font-size: 12
97
100
  line-height-length: 17
98
101
  line-height: $base-line-height-length / $base-font-size
99
- vertical-spacing: $base-line-height-length
100
102
  heading:
101
103
  font-color: #262626
102
104
  font-size: 17
103
105
  font-style: bold
104
106
  line-height: 1.2
105
- margin-bottom: $vertical-spacing
106
107
  link:
107
108
  font-color: #002FA7
108
- outline-list:
109
+ list:
109
110
  indent: $base-font-size * 1.5
110
111
  footer:
111
112
  height: $base-line-height-length * 2.5
@@ -118,7 +119,7 @@ footer:
118
119
  content: $footer-recto-right-content
119
120
  ----
120
121
 
121
- When creating a new theme, you only have to define the keys you want to override from the base theme, which is loaded prior to loading your custom theme.
122
+ When creating a new theme, you only have to define the keys you want to override from the extended theme, which is loaded prior to loading your custom theme.
122
123
  All the available keys are documented in <<Keys>>.
123
124
  The converter uses the information from the theme map to help construct the PDF.
124
125
 
@@ -134,14 +135,17 @@ base:
134
135
  ----
135
136
 
136
137
  You can also point the extends key at another custom theme to extend from it.
137
- If you don't want to extend any theme, including the base theme, assign the value `~` to the `extends` key (i.e., `extends: ~`).
138
+ If you don't want to extend any theme, including the base theme, omit the `extends` key or assign the value `~` to the `extends` key (i.e., `extends: ~`).
139
+
140
+ If the same theme appears multiple times in the theme hierarchy, it will only be loaded once by default.
141
+ You can force the theme to be loaded, even if it has already been loaded, by adding the `!important` keyword at the end of the value offset by a space.
138
142
 
139
- WARNING: If you start a new theme from scratch, we strongly recommend defining TrueType fonts and specifying them in the `base` and `literal` categories.
143
+ WARNING: If you start a new theme from scratch, we strongly recommend defining TrueType fonts and specifying them in the `base` and `codespan` categories.
140
144
  Otherwise, Asciidoctor PDF will use built-in AFM fonts, which can result in missing functionality and warnings.
141
145
 
142
146
  [TIP]
143
147
  ====
144
- Instead of creating a theme from scratch, another option is to download the https://github.com/asciidoctor/asciidoctor-pdf/blob/main/data/themes/default-theme.yml[default-theme.yml] file from the source repository.
148
+ Instead of creating a theme from scratch, another option is to download the {url-repo-root}/data/themes/default-theme.yml[default-theme.yml] file from the source repository.
145
149
  Save the file using a unique name (e.g., _custom-theme.yml_) and start hacking on it.
146
150
 
147
151
  Alternatively, you can snag the file from your local installation using the following command:
@@ -235,7 +239,7 @@ The following keys are inherited:
235
239
  * font-style
236
240
  * text-transform
237
241
  * line-height (currently some exceptions)
238
- * margin-bottom (if not specified, defaults to $vertical-spacing)
242
+ * margin-bottom
239
243
 
240
244
  .Heading Inheritance
241
245
  ****
@@ -322,7 +326,7 @@ base:
322
326
  === Math Expressions & Functions
323
327
 
324
328
  The theme language supports basic math operations to support calculated values.
325
- Like programming languages, multiply and divide take precedence over add and subtract.
329
+ Like programming languages, the multiply and divide operators take precedence over the add and subtract operators.
326
330
 
327
331
  The following table lists the supported operations and the corresponding operator for each.
328
332
 
@@ -414,7 +418,7 @@ The following units are supported:
414
418
  |pt (default)
415
419
  |===
416
420
 
417
- . A percentage with the % unit is calculated relative to the width or height of the content area.
421
+ 1. A percentage with the % unit is calculated relative to the width or height of the content area.
418
422
  Viewport-relative percentages (vw or vh units) are calculated as a percentage of the page width or height, respectively.
419
423
  Currently, percentage units can only be used for placing elements on the title page or for setting the width of a block image.
420
424
 
@@ -486,15 +490,8 @@ The following transforms are recognized:
486
490
 
487
491
  [CAUTION#transform-unicode-letters]
488
492
  ====
489
- Since Ruby 2.4, Ruby has built-in support for transforming the case of any letter defined by Unicode.
490
-
491
- If you're using Ruby < 2.4, and the text you want to transform contains characters beyond the Basic Latin character set (e.g., an accented character), you must install either the `activesupport` or the `unicode` gem in order for those characters to be transformed.
492
-
493
- $ gem install activesupport
494
-
495
- or
496
-
497
- $ gem install unicode
493
+ Ruby 2.5 and better has built-in support for transforming the case of any letter defined by Unicode.
494
+ You no longer need the `activesupport` or `unicode` gem to transform characters beyond the Basic Latin character set (e.g., accented characters).
498
495
  ====
499
496
 
500
497
  === Colors
@@ -600,6 +597,7 @@ The `transparent` keyword can be used for the background or border color, but no
600
597
  An image is specified either as a bare image path or as an inline image macro as found in the AsciiDoc syntax.
601
598
  Images in the theme file are currently resolved relative to the value of the `pdf-themesdir` attribute.
602
599
  (If `pdf-theme` is a path that ends in `.yml`, and `pdf-themesdir` is not set, then the images are resolved relative to the directory of the path specified by `pdf-theme`).
600
+ If you want to use an image in your theme that's relative to the document you're converting, you can prefix the target with the `\{docdir}` attribute reference.
603
601
 
604
602
  The following image types (and corresponding file extensions) are supported:
605
603
 
@@ -608,7 +606,7 @@ The following image types (and corresponding file extensions) are supported:
608
606
  * SVG (.svg)
609
607
 
610
608
  CAUTION: The GIF format (.gif) and BMP format (.bmp) are not supported unless you're using prawn-gmagick.
611
- See https://github.com/asciidoctor/asciidoctor-pdf#supporting-additional-image-file-formats[support for additional image file formats] for details.
609
+ See {url-repo-root}/README.adoc#supporting-additional-image-file-formats[support for additional image file formats] for details.
612
610
 
613
611
  Here's how an image is specified in the theme file as a bare image path:
614
612
 
@@ -627,6 +625,13 @@ title-page:
627
625
  ----
628
626
 
629
627
  In either case, the image is resolved relative to the value of the `pdf-themesdir` attribute, as previously described.
628
+ If you want to instead reference an image relative to the document you're converting, then prefix the target with the `\{docdir}` attribute reference.
629
+
630
+ [source,yaml]
631
+ ----
632
+ title-page:
633
+ background-image: image:{docdir}/images/title-cover.png[]
634
+ ----
630
635
 
631
636
  Like in the AsciiDoc syntax, wrapping the value in the image macro allows you to specify other settings, such as `pdfwidth`, `fit`, and/or `align`.
632
637
  For example:
@@ -664,7 +669,7 @@ Additionally, normal substitutions are applied to the value of content keys for
664
669
 
665
670
  == Fonts
666
671
 
667
- You can select from <<built-in-afm-fonts,built-in PDF fonts>>, <<bundled-fonts,fonts bundled with Asciidoctor PDF>> or <<custom-fonts,custom fonts>> loaded from TrueType font (TTF) files.
672
+ You can select from <<built-in-afm-fonts,built-in PDF fonts>>, <<bundled-fonts,fonts bundled with Asciidoctor PDF>> or <<custom-fonts,custom fonts>> loaded from TrueType (TTF) or OpenType (OTF) font files.
668
673
  If you want to use custom fonts, you must first declare them in your theme file.
669
674
 
670
675
  IMPORTANT: Asciidoctor has no challenge working with Unicode.
@@ -711,7 +716,7 @@ Even though the built-in fonts require the content to be encoded in WINANSI, _yo
711
716
  Asciidoctor PDF encodes the content into WINANSI when building the PDF.
712
717
 
713
718
  WARNING: Built-in (AFM) fonts do not use the <<fallback-fonts,fallback fonts>>.
714
- In order for the fallback font to kick in, you must use a TrueType font as the primary font.
719
+ In order for the fallback font to kick in, you must use a TrueType font anywhere you want the fallback font to be used (e.g., the base font family, the code font family, etc).
715
720
 
716
721
  .WINANSI Encoding Behavior
717
722
  ****
@@ -744,7 +749,7 @@ http://www.google.com/get/noto/#/family/noto-serif[Noto Serif]::
744
749
  A serif font that can be styled as normal, italic, bold or bold_italic.
745
750
 
746
751
  http://mplus-fonts.osdn.jp/mplus-outline-fonts/design/index-en.html#mplus_1mn[M+ 1mn]::
747
- A monospaced font that maps different thicknesses to the styles normal, italic, bold and bold_italic.
752
+ A monospaced font that maps different thicknesses to the styles normal, italic, bold, and bold_italic.
748
753
  Also provides the circuled numbers used in callouts.
749
754
 
750
755
  http://mplus-fonts.osdn.jp/mplus-outline-fonts/design/index-en.html#mplus_1p[M+ 1p Fallback]::
@@ -752,35 +757,39 @@ A sans-serif font that provides a very complete set of Unicode glyphs.
752
757
  Cannot be styled as italic, bold or bold_italic.
753
758
  Used as the fallback font in the `default-with-fallback-font` theme.
754
759
 
755
- TIP: The default themes in Asciidoctor PDF < 2 do not include the `GEM_FONTS_DIR` prefix in the path of the bundled font files.
756
- Therefore, if you want to specify the location of custom fonts using the `pdf-fontsdir` attribute, yet still be able to use the bundled fonts, you need to qualify the path of the bundled fonts using the `GEM_FONTS_DIR` token.
757
- To do so, you can either a) redeclare the bundle fonts in your theme and prefix the path with the segment `GEM_FONTS_DIR` (e.g., `GEM_FONTS_DIR/mplus1p-regular-fallback.ttf`, or b) include `GEM_FONTS_DIR` in the value of the `pdf-fontsdir` attribute separated by the location of your custom fonts using a semi-colon (e.g., `"path/to/your/fonts;GEM_FONTS_DIR"`).
760
+ TIP: The default themes refer to the bundled fonts using the `GEM_FONTS_DIR` prefix.
761
+ That means you can extend a default theme and not have to worry about how the bundled fonts get resolved.
762
+ If you redeclare the bundled fonts in your custom theme, be sure to prefix the path with the `GEM_FONTS_DIR` token.
763
+ An alternative approach is to include `GEM_FONT_DIR` in the value of the `pdf-fontsdir` attribute separated by the location of your custom fonts using a comma (e.g., `path/to/your/fonts,GEM_FONTS_DIR`) or a semi-colon (e.g., `path/to/your/fonts;GEM_FONTS_DIR`).
758
764
 
759
765
  === Custom Fonts
760
766
 
761
- The limited character set of WINANSI, or the bland look of the built-in fonts, may motivate you to load your own font.
767
+ The limited character set of WINANSI, or the plain look of the built-in or bundled fonts, may motivate you to incorporate your own fonts.
762
768
  Custom fonts can enhance the look of your PDF theme substantially.
763
769
 
770
+ IMPORTANT: In order for a third-party font to work properly with Prawn (and hence Asciidoctor PDF), several modifications are required.
771
+ See <<Preparing a Custom Font>> to learn how to prepare your font for use with Asciidoctor PDF.
772
+
773
+ ==== Selecting Your Font
774
+
764
775
  To start, find the TTF file collection for the font you want to use.
765
- A collection typically consists of all four font styles:
776
+ A collection typically consists of four font styles:
766
777
 
767
778
  * normal
768
779
  * italic
769
780
  * bold
770
781
  * bold_italic
771
782
 
772
- You'll need all four variants to support AsciiDoc content properly.
773
- Otherwise, the converter will likely crash.
774
- If you don't have one of the variants, you can simply reuse the normal variant in its place.
775
- _Asciidoctor PDF cannot italicize a font dynamically like a browser can, so the italic styles are required._
783
+ You'll need all four variants to support AsciiDoc content properly (unless the font only has a single variant).
784
+ If you do not register the font correctly, the converter may crash or revert to the fallback font, depending on how the theme is configured.
785
+ If one of the variants is missing from your collection, you can simply reuse the normal / single variant in its place.
776
786
 
777
- In order for a third-party font to work properly with Prawn (and hence Asciidoctor PDF), several modifications are required.
778
- See <<Preparing a Custom Font>> to learn how to prepare your font for use with Asciidoctor PDF.
787
+ WARNING: Asciidoctor PDF cannot italicize a font dynamically like a browser can, so the italic styles are required to italicize text.
779
788
 
780
- Once you've obtained the TTF files, put them in the directory inside your project where you want to store the fonts.
789
+ Once you've obtained the TTF (or OTF) files, put them in the directory inside your project where you want to store the fonts.
781
790
  It's recommended that you name them consistently so it's easier to type the names in the theme file.
782
791
 
783
- Let's assume the name of the font is https://github.com/google/roboto/tree/master/out/RobotoTTF[Roboto].
792
+ Let's assume the name of the font is https://github.com/googlefonts/roboto/releases[Roboto].
784
793
  Rename the files as follows:
785
794
 
786
795
  * roboto-normal.ttf (_originally Roboto-Regular.ttf_)
@@ -788,22 +797,64 @@ Rename the files as follows:
788
797
  * roboto-bold.ttf (_originally Roboto-Bold.ttf_)
789
798
  * roboto-bold_italic.ttf (_originally Roboto-BoldItalic.ttf_)
790
799
 
791
- Next, declare the font under the `font-catalog` key at the top of your theme file, giving it a unique key (e.g., `Roboto`).
800
+ ==== Declaring Your Font
792
801
 
793
- [source,yaml]
802
+ Next, declare the font under the `font-catalog` key at the top of your theme file.
803
+ Assign each font a unique key (e.g., `Roboto`) and specify the path to each of the four font styles under that key.
804
+
805
+ [source,yaml,subs=attributes+]
794
806
  ----
795
807
  font:
796
808
  catalog:
809
+ merge: false {conum-guard-yaml} <1>
797
810
  Roboto:
798
811
  normal: roboto-normal.ttf
799
812
  italic: roboto-italic.ttf
800
813
  bold: roboto-bold.ttf
801
814
  bold_italic: roboto-bold_italic.ttf
802
815
  ----
816
+ <1> Set value to true to merge catalog with theme you're extending.
803
817
 
804
- CAUTION: You must declare all four variants.
818
+ If you use this form, you must declare all four variants.
805
819
  If you're missing the font file for one of the variants, configure it to use the same font file as the normal variant.
806
820
 
821
+ If your font only has a single variant, assign the font path to the font key directly.
822
+
823
+ [source,yaml,subs=attributes+]
824
+ ----
825
+ font:
826
+ catalog:
827
+ merge: false {conum-guard-yaml} <1>
828
+ VLGothic: vlgothic.ttf
829
+ ----
830
+ <1> Set value to true to merge catalog with theme you're extending.
831
+
832
+ Font paths can be absolute or relative.
833
+ Absolute paths are used as is.
834
+ Relative font paths are resolved from the <<Configuring the Font Search Path,font search path>>.
835
+ You can also use the `GEM_FONTS_DIR` keyword to refer to the location of the bundled fonts.
836
+
837
+ You can add any number of fonts to the catalog.
838
+ Each font must be assigned a unique key, as shown here:
839
+
840
+ [source,yaml,subs=attributes+]
841
+ ----
842
+ font:
843
+ catalog:
844
+ merge: false {conum-guard-yaml} <1>
845
+ Roboto:
846
+ normal: roboto-normal.ttf
847
+ italic: roboto-italic.ttf
848
+ bold: roboto-bold.ttf
849
+ bold_italic: roboto-bold_italic.ttf
850
+ Roboto Light:
851
+ normal: roboto-light-normal.ttf
852
+ italic: roboto-light-italic.ttf
853
+ bold: roboto-light-bold.ttf
854
+ bold_italic: roboto-light-bold_italic.ttf
855
+ ----
856
+ <1> Set value to true to merge catalog with theme you're extending.
857
+
807
858
  You can use the key that you assign to the font in the font catalog anywhere the `font-family` property is accepted in the theme file.
808
859
  For example, to use the Roboto font for all headings (section titles and discrete headings), use:
809
860
 
@@ -811,17 +862,35 @@ For example, to use the Roboto font for all headings (section titles and discret
811
862
  ----
812
863
  heading:
813
864
  font-family: Roboto
865
+ font-style: bold
814
866
  ----
815
867
 
868
+ The font name and font style are used to locate an entry in the font catalog.
869
+
870
+ .About Fonts in SVGs
871
+ ****
872
+ Fonts defined for text in SVGs will be mapped to the font catalog from your theme.
873
+ So if you have an SVG that requires a specific font, you'll need to declare that font in the font catalog in your theme.
874
+
875
+ We recommend that you match the font key in your theme file to the name of the font seen by the operating system.
876
+ This will allow you to use the same font names (aka families) in both your graphics program and Asciidoctor PDF, thus making them portable.
877
+ ****
878
+
879
+ ==== Configuring the Font Search Path
880
+
816
881
  When you execute Asciidoctor PDF, specify the directory where the fonts reside using the `pdf-fontsdir` attribute:
817
882
 
818
883
  $ asciidoctor-pdf -a pdf-theme=basic-theme.yml -a pdf-fontsdir=path/to/fonts document.adoc
819
884
 
820
- You can specify multiple directories by separating the entries with a semi-colon and enclosing the value in double quotes:
885
+ You can specify multiple directories by separating the paths with either a comma (`,`):
886
+
887
+ $ asciidoctor-pdf -a pdf-theme=basic-theme.yml -a pdf-fontsdir=path/to/fonts,path/to/more-fonts document.adoc
888
+
889
+ or a semi-colon (`;`) (which requires enclosing the combined value in double quotes to escape the delimiter from the shell):
821
890
 
822
891
  $ asciidoctor-pdf -a pdf-theme=basic-theme.yml -a pdf-fontsdir="path/to/fonts;path/to/more-fonts" document.adoc
823
892
 
824
- To include the bundled fonts in the search, use the `GEM_FONTS_DIR` token:
893
+ To include the location of the bundled fonts in the search, include the `GEM_FONTS_DIR` token in the list:
825
894
 
826
895
  $ asciidoctor-pdf -a pdf-theme=basic-theme.yml -a pdf-fontsdir="path/to/fonts;GEM_FONTS_DIR" document.adoc
827
896
 
@@ -829,36 +898,16 @@ When running Asciidoctor PDF on the JVM (perhaps using AsciidoctorJ PDF), you ca
829
898
 
830
899
  $ asciidoctorj -b pdf -a pdf-theme=basic-theme.yml -a pdf-fontsdir="uri:classloader:/path/to/fonts;GEM_FONTS_DIR" document.adoc
831
900
 
832
- TIP: When Asciidoctor PDF creates the PDF, it only embeds the glyphs from the font that are needed to render the characters present in the document.
901
+ ==== Subsetting Your Font
902
+
903
+ When Asciidoctor PDF creates the PDF, it only embeds the glyphs from the font that are needed to render the characters present in the document.
833
904
  Effectively, it subsets the font.
834
905
  While that saves space taken up by the generated PDF, you may still be storing the full font in your source repository.
906
+
835
907
  To minimize the size of the source font, you can use {url-fontforge}[FontForge] to subset the font ahead of time.
836
908
  Subsetting a font means remove glyphs you don't plan to use.
837
909
  Doing so is not a requirement, simply a personal preference.
838
910
 
839
- You can add any number of fonts to the catalog.
840
- Each font must be assigned a unique key, as shown here:
841
-
842
- [source,yaml]
843
- ----
844
- font:
845
- catalog:
846
- Roboto:
847
- normal: roboto-normal.ttf
848
- italic: roboto-italic.ttf
849
- bold: roboto-bold.ttf
850
- bold_italic: roboto-bold_italic.ttf
851
- Roboto Light:
852
- normal: roboto-light-normal.ttf
853
- italic: roboto-light-italic.ttf
854
- bold: roboto-light-bold.ttf
855
- bold_italic: roboto-light-bold_italic.ttf
856
- ----
857
-
858
- Text in SVGs will use the font catalog from your theme.
859
- We recommend that you match the font key in your theme file to the name of the font seen by the operating system.
860
- This will allow you to use the same font names (aka families) in both your graphics program and Asciidoctor PDF, thus making them portable.
861
-
862
911
  === Fallback Fonts
863
912
 
864
913
  If a TrueType font is missing a character needed to render the document, such as a special symbol or emoji, you can have Asciidoctor PDF look for the character in a fallback font.
@@ -868,7 +917,7 @@ If the character isn't found in the fallback font, it will mostly likely be repl
868
917
 
869
918
  IMPORTANT: When defining the fallback font, you *must specify all four variants* (normal, bold, italic, bold_italic), even if you use the same font file for each.
870
919
 
871
- IMPORTANT: The fallback font only gets used when the primary font is a TrueType font (i.e., TTF, DFont, TTC).
920
+ IMPORTANT: The fallback font only gets used when the primary font is a TrueType or OpenType font (i.e., TTF, DFont, TTC, OTF).
872
921
  Any glyph missing from an AFM font is simply replaced with the "`not`" glyph (`&#172;`).
873
922
 
874
923
  CAUTION: The `default` theme does not use a fallback font.
@@ -892,15 +941,20 @@ font:
892
941
  italic: roboto-italic.ttf
893
942
  bold: roboto-bold.ttf
894
943
  bold_italic: roboto-bold_italic.ttf
895
- DroidSansFallback:
896
- normal: droid-sans-fallback.ttf
897
- italic: droid-sans-fallback.ttf
898
- bold: droid-sans-fallback.ttf
899
- bold_italic: droid-sans-fallback.ttf
944
+ DroidSansFallback: droid-sans-fallback.ttf
945
+ ----
946
+
947
+ Notice that we only declare the fallback font file once using a literal value.
948
+ This ensures the font is defined for all four variants so it will be used regardless of which font style is active when it's called on.
949
+ This assignment is equivalent to the following:
950
+
951
+ [source,yaml]
952
+ ----
953
+ DroidSansFallback:
954
+ '*': droid-sans-fallback.ttf
900
955
  ----
901
956
 
902
- Notice that we define all four variants for the fallback font, even though we're use the same font file for each variant.
903
- This ensures the fallback font will be used regardless of which font style is active when it gets called on.
957
+ The benefit of this syntax is that it allows you to use a separate font file for just one of the variants (e.g., bold).
904
958
 
905
959
  Next, add the key name to the `fallbacks` key under the `font-catalog` key.
906
960
  The `fallbacks` key accepts an array of values, meaning you can specify more than one fallback font.
@@ -915,11 +969,7 @@ font:
915
969
  italic: roboto-italic.ttf
916
970
  bold: roboto-bold.ttf
917
971
  bold_italic: roboto-bold_italic.ttf
918
- DroidSansFallback:
919
- normal: droid-sans-fallback.ttf
920
- italic: droid-sans-fallback.ttf
921
- bold: droid-sans-fallback.ttf
922
- bold_italic: droid-sans-fallback.ttf
972
+ DroidSansFallback: droid-sans-fallback.ttf
923
973
  fallbacks:
924
974
  - DroidSansFallback
925
975
  ----
@@ -936,7 +986,7 @@ base:
936
986
 
937
987
  That's it!
938
988
  Now you're covered.
939
- If your custom TTF font is missing a glyph, Asciidoctor PDF will look in your fallback font.
989
+ If your custom font is missing a glyph, Asciidoctor PDF will look in your fallback font.
940
990
  You don't need to reference the fallback font anywhere else in your theme file.
941
991
 
942
992
  Here's another example that shows how to use an alternative emoji font (Symbola):
@@ -964,11 +1014,11 @@ This nested structure is for organizational purposes only.
964
1014
  All keys are flatted when the theme is loaded (e.g., `align` nested under `base` becomes `base-align`).
965
1015
 
966
1016
  The converter uses the values of these keys to control how most elements are arranged and styled in the PDF.
967
- The default values listed in this section get inherited from the https://github.com/asciidoctor/asciidoctor-pdf/blob/main/data/themes/base-theme.yml[base theme].
1017
+ The default values listed in this section get inherited from the {url-repo-root}/data/themes/base-theme.yml[base theme].
968
1018
 
969
- IMPORTANT: The https://github.com/asciidoctor/asciidoctor-pdf/blob/main/data/themes/default-theme.yml[default theme] has a different set of values which are not shown in this guide.
1019
+ IMPORTANT: The {url-repo-root}/data/themes/default-theme.yml[default theme] has a different set of values which are not shown in this guide.
970
1020
 
971
- When creating a theme, all keys are optional.
1021
+ When creating a theme that extends the base theme, all keys are optional.
972
1022
  Required keys are provided by the base theme.
973
1023
  Therefore, you only have to declare keys that you want to override.
974
1024
 
@@ -992,12 +1042,7 @@ If the filename is absolute, it's used as is.
992
1042
  If the filename begins with `./`, it's resolved as a theme file relative to the current theme file.
993
1043
  Otherwise, the filename is resolved as a theme file in the normal way (relative to the value of the `pdf-themesdir` attribute).
994
1044
 
995
- CAUTION: If you define the <<Custom fonts,font catalog>> in a theme that extends from `default`, you either have to redeclare any built-in font that on which the combined theme depends, or you need to set `merge: true` above your font definitions.
996
- You can find the built-in definitions in default theme.
997
- You'll then need to include `GEM_FONTS_DIR` in the value of the `pdf-fontsdir` attribute so that the converter can find and register them.
998
- To avoid having to do this, make sure you set the font family for any element that declares a font family in the default theme.
999
-
1000
- Currently, the base theme is always loaded first.
1045
+ Currently, the theme starts out empty.
1001
1046
  Then, the files referenced by the extends key are loaded in order.
1002
1047
  Finally, the keys in the current file are loaded.
1003
1048
  Each time a theme is loaded, the keys are overlaid onto the keys from the previous theme.
@@ -1007,13 +1052,93 @@ Each time a theme is loaded, the keys are overlaid onto the keys from the previo
1007
1052
  |Key |Value Type |Example
1008
1053
 
1009
1054
  |extends
1010
- |String or Array
1055
+ |String or Array +
1011
1056
  (default: [])
1012
1057
  |extends:
1013
1058
  - default
1014
1059
  - ./brand-theme.yml
1015
1060
  |===
1016
1061
 
1062
+ === Font
1063
+
1064
+ The font key is where you declare custom fonts (`catalog` key) and configure the fallback fonts (`fallbacks` key).
1065
+
1066
+ The data format of the `catalog` key is a map.
1067
+ Each key is the name of the font that you can use to refer to the font elsewhere in the theme.
1068
+ The value is either a font path (which is used for all font styles) or another map that specifies a font path to each of the four font styles.
1069
+ You can also configure the `catalog` to merge entries from an inherited font catalog.
1070
+ See <<Extending the Font Catalog>>.
1071
+
1072
+ The data format of the `fallbacks` key is an array.
1073
+ The values of the array are the font names declared in the `catalog` (or a name inherited from another theme).
1074
+ These fallbacks are used, in the order listed, when a glyph cannot be found in the primary font for a given element.
1075
+
1076
+ [cols="1,2,5l"]
1077
+ |===
1078
+ |Key |Value Type |Example
1079
+
1080
+ |catalog
1081
+ |Map
1082
+ |font:
1083
+ catalog:
1084
+ Noto Serif:
1085
+ normal: GEM_FONTS_DIR/notoserif-regular-subset.ttf
1086
+ bold: GEM_FONTS_DIR/notoserif-bold-subset.ttf
1087
+ italic: GEM_FONTS_DIR/notoserif-italic-subset.ttf
1088
+ bold_italic: GEM_FONTS_DIR/notoserif-bold_italic-subset.ttf
1089
+
1090
+ |fallbacks
1091
+ |Array
1092
+ |font:
1093
+ fallbacks:
1094
+ - M+ 1p Fallback
1095
+ - Noto Emoji
1096
+ |===
1097
+
1098
+ ==== Extending the Font Catalog
1099
+
1100
+ If you define a <<Custom fonts,font catalog>> in a theme that extends from `default`, and you want to continue to use the bundled fonts in your theme, you either have to redeclare the bundled fonts:
1101
+
1102
+ .Redeclaring the bundle fonts in a custom theme
1103
+ [source,yaml]
1104
+ ----
1105
+ extends: default
1106
+ font:
1107
+ catalog:
1108
+ Noto Serif:
1109
+ normal: GEM_FONTS_DIR/notoserif-regular-subset.ttf
1110
+ bold: GEM_FONTS_DIR/notoserif-bold-subset.ttf
1111
+ italic: GEM_FONTS_DIR/notoserif-italic-subset.ttf
1112
+ bold_italic: GEM_FONTS_DIR/notoserif-bold_italic-subset.ttf
1113
+ M+ 1mn:
1114
+ normal: GEM_FONTS_DIR/mplus1mn-regular-subset.ttf
1115
+ bold: GEM_FONTS_DIR/mplus1mn-bold-subset.ttf
1116
+ italic: GEM_FONTS_DIR/mplus1mn-italic-subset.ttf
1117
+ bold_italic: GEM_FONTS_DIR/mplus1mn-bold_italic-subset.ttf
1118
+ Your Font:
1119
+ normal: /path/to/your/font.ttf
1120
+ heading:
1121
+ font-family: Your Font
1122
+ ----
1123
+
1124
+ or you need to set `merge: true` above your font definitions:
1125
+
1126
+ .Merging with the inherited font catalog
1127
+ [source,yaml]
1128
+ ----
1129
+ extends: default
1130
+ font:
1131
+ catalog:
1132
+ merge: true
1133
+ Your Font:
1134
+ normal: /path/to/your/font.ttf
1135
+ heading:
1136
+ font-family: Your Font
1137
+ ----
1138
+
1139
+ If you're referring to a bundled font, you'll need to prefix the path with `GEM_FONTS_DIR` (or add it to the value of the `pdf-fontsdir` attribute) so the converter can find and register it.
1140
+ You can find the bundle font definitions in default theme.
1141
+
1017
1142
  [#keys-role]
1018
1143
  === Role
1019
1144
 
@@ -1022,7 +1147,7 @@ The name of the role is the first subkey level.
1022
1147
  The role name may contain a hyphen, but *a role name cannot contain an underscore*.
1023
1148
  The keys under the role are the theming properties.
1024
1149
 
1025
- IMPORTANT: Custom roles only apply to inline phrases.
1150
+ IMPORTANT: Custom roles only apply to inline phrases and paragraphs.
1026
1151
 
1027
1152
  Here's an example of a role for making text red:
1028
1153
 
@@ -1057,9 +1182,11 @@ This role can be used as follows:
1057
1182
  ----
1058
1183
 
1059
1184
  The converter provides several predefined roles, which can can all be redefined.
1185
+ The `lead` defines the font properties for a lead paragraph, whether the role is assign implicitly or explicitly.
1060
1186
  The `big` and `small` roles map the font size to the $base-font-size-large and $base-font-size-small values, respectively.
1061
1187
  The `underline` and `line-through` roles add the underline and strikethrough decorations, respectively.
1062
1188
  The `subtitle` role is used to configure the font properties of the subtitle of a section title.
1189
+ The `unresolved` role is applied to the text of an unresolved reference (currently footnotes only).
1063
1190
  The color roles (e.g., `blue`), which you may be familiar with from the HTML converter, are not mapped by default.
1064
1191
  You'll need to define these color roles in your theme if you'd like to make use of them when converting to PDF.
1065
1192
 
@@ -1148,16 +1275,42 @@ You'll need to define these color roles in your theme if you'd like to make use
1148
1275
 
1149
1276
  |text-decoration-width
1150
1277
  |<<values,Number>> +
1151
- (default: 1)
1278
+ (default: $base-text-decoration-width)
1152
1279
  |role:
1153
1280
  underline:
1154
1281
  text-decoration-width: 0.5
1155
1282
  |===
1156
1283
 
1284
+ [#keys-cover]
1285
+ === Cover
1286
+
1287
+ The keys in this category control the front and back cover images.
1288
+ Currently, the only supported feature is setting the image per side.
1289
+
1290
+ [cols="3,4,5l"]
1291
+ |===
1292
+ |Key |Value Type |Example
1293
+
1294
+ 3+|[#key-prefix-cover]*Key Prefix:* <<key-prefix-cover,cover>>
1295
+
1296
+ |<face>-image^[1]^
1297
+ |path, image macro^[2]^ +
1298
+ (default: _not set_)
1299
+ |cover:
1300
+ front:
1301
+ image: image:cover.pdf[page=2]
1302
+ |===
1303
+ 1. `<face>` can be `front` or `back`.
1304
+ 2. The value may be an image file or a PDF file.
1305
+ A relative path will be resolved relative to the value of the `pdf-themesdir` attribute.
1306
+ An image files is handled just like a background image.
1307
+ If a PDF file is specified, the first page is used unless another page is specified by the `page` attribute.
1308
+ The page from the PDF file will be imported as is.
1309
+
1157
1310
  [#keys-page]
1158
1311
  === Page
1159
1312
 
1160
- The keys in this category control the size, margins and background of each page (i.e., canvas).
1313
+ The keys in this category control the size, margins, and background of each page (i.e., canvas).
1161
1314
  We recommended that you define this category before all other categories.
1162
1315
 
1163
1316
  NOTE: The background of the title page can be styled independently of other pages.
@@ -1237,30 +1390,35 @@ See <<Title Page>> for details.
1237
1390
  |page:
1238
1391
  size: Letter
1239
1392
 
1240
- |numbering-start-at^[5]^
1241
- |title {vbar} toc {vbar} body {vbar} Integer +
1393
+ 3+|[#key-prefix-page-numbering]*Key Prefix:* <<key-prefix-page-numbering,numbering>>
1394
+
1395
+ |start-at^[5]^
1396
+ |cover {vbar} title {vbar} toc {vbar} after-toc {vbar} body {vbar} Integer +
1242
1397
  (default: body)
1243
1398
  |page:
1244
- numbering-start-at: toc
1399
+ numbering:
1400
+ start-at: toc
1245
1401
  |===
1246
1402
 
1247
- . To disable the background color for the page, set the value to white (i.e., FFFFFF).
1403
+ 1. To disable the background color for the page, set the value to white (i.e., FFFFFF).
1248
1404
  The color keyword `transparent` is not recognized in this context.
1249
- . By default, page background and foreground images are automatically scaled to fit the bounds of the page (i.e., `fit=contain`) and centered (i.e., `position=center`).
1405
+ 2. By default, page background and foreground images are automatically scaled to fit the bounds of the page (i.e., `fit=contain`) and centered (i.e., `position=center`).
1250
1406
  The size of the image can be controlled using any of the sizing attributes on the image macro (i.e., fit, pdfwidth, scaledwidth, or width) when `fit=none`.
1251
1407
  The position of the image can be controlled using the `position` attribute.
1252
1408
  If the recto (right-hand, odd-numbered pages) or verso (left-hand, even-numbered pages) background image is specified, it will be used only for that side (not available for the foreground image).
1253
1409
  If you define the keys using the flatten structure (e.g., `page-background-image-recto`), you can also set the default page background image (`page-background-image`), which will then be used as a fallback if a background image isn't specified for a given side.
1254
1410
  To disable the image, use the value `none`.
1255
- . Target may be an absolute path or a path relative to the value of the `pdf-themesdir` attribute.
1256
- . The margins for `recto` (right-hand, odd-numbered) and `verso` (left-hand, even-numbered) pages are calculated automatically from the margin-inner and margin-outer values.
1411
+ 3. Target may be an absolute path or a path relative to the value of the `pdf-themesdir` attribute.
1412
+ 4. The margins for `recto` (right-hand, odd-numbered) and `verso` (left-hand, even-numbered) pages are calculated automatically from the margin-inner and margin-outer values.
1257
1413
  These margins and used when the value `prepress` is assigned to the `media` document attribute.
1258
1414
  If no cover is specified, the recto margin is not applied to the title page.
1259
- To apply the recto margin to the title page, but not include a cover, assign the value `~` to the `front-cover-image` attribute.
1260
- . Only works if the document uses a title page (i.e., doctype is book or `title-page` attribute is set)
1415
+ To apply the recto margin to the title page, but not include a cover, assign the value `~` to the `front-cover-image` and `back-cover-image` attributes.
1416
+ 5. The `cover` value is only recognized if the documet has a front cover page (i.e., `front-cover-image`).
1417
+ The `title`, `toc`, and `after-toc` values are only recognized if the title page is enabled (i.e., doctype is book or `title-page` attribute is set)
1261
1418
  The `toc` value only applies if the toc is in the default location (before the first page of the body).
1262
- If the toc macro is used to position the toc, the start-at behavior is the same as if the toc is not enabled.
1419
+ If value is `toc`, and the toc macro is used to position the toc, the start-at behavior is the same as if the toc is not enabled.
1263
1420
  If value is an integer, page numbering will start at the specified page of the body (i.e., 1 is first page, 2 is second page, etc.)
1421
+ If value is `after-toc`, the page numbering will start after the toc, no matter where it's placed in the document.
1264
1422
 
1265
1423
  [#keys-base]
1266
1424
  === Base
@@ -1375,27 +1533,33 @@ NOTE: While it's common to define additional keys in this category (e.g., `base-
1375
1533
  text-decoration-width: 0.5
1376
1534
  |===
1377
1535
 
1378
- . The `text-transform` key cannot be set globally.
1536
+ 1. The `text-transform` key cannot be set globally.
1379
1537
  Therefore, this key should not be used.
1380
1538
  The value of `none` is implicit and is documented here for completeness.
1381
- . `line-height-length` is a utility property that's internal to the theme.
1539
+ 2. `line-height-length` is a utility property that's internal to the theme.
1382
1540
  It's used as an intermediate property for computing the `base-line-height` from the base font size and the desired line height size.
1383
1541
  For instance, if you set `base-line-height-length`, you can use `$base-line-height-length / $base-font-size` to set the value of `base-line-height`.
1384
1542
  You don't have to go about it this way in your own theme.
1385
1543
 
1386
- [#keys-vertical-spacing]
1387
- === Vertical Spacing
1544
+ [#keys-quotes]
1545
+ === Quotes
1388
1546
 
1389
- The keys in this category control the general spacing between elements where a more specific setting is not designated.
1547
+ The keys in this category define the characters to use for typographic quotation marks (i.e., quotes).
1390
1548
 
1391
1549
  [cols="3,4,5l"]
1392
1550
  |===
1393
1551
  |Key |Value Type |Example
1394
1552
 
1395
- |vertical-spacing
1396
- |<<values,Number>> +
1397
- (default: 12)
1398
- |vertical-spacing: 10
1553
+ 3+|[#key-prefix-quotes]*Key Prefix:* <<key-prefix-quotes,quotes>>
1554
+
1555
+ |quotes
1556
+ |<<quoted-string,Quoted string[double-open, double-close, single-open, single-close]>> +
1557
+ (default: ['\&#8220;', '\&#8221;', '\&#8216;', '\&#8217;'])
1558
+ |quotes:
1559
+ - '&#x00ab;'
1560
+ - '&#x00bb;'
1561
+ - '&#x2039;'
1562
+ - '&#x203a;'
1399
1563
  |===
1400
1564
 
1401
1565
  [#keys-link]
@@ -1409,6 +1573,18 @@ The keys in this category are used to style hyperlink text.
1409
1573
 
1410
1574
  3+|[#key-prefix-link]*Key Prefix:* <<key-prefix-link,link>>
1411
1575
 
1576
+ |background-color
1577
+ |<<colors,Color>> +
1578
+ (default: _not set_)
1579
+ |link:
1580
+ background-color: #efefef
1581
+
1582
+ |border-offset
1583
+ |<<values,Number>> +
1584
+ (default: 0)
1585
+ |link:
1586
+ border-offset: 2
1587
+
1412
1588
  |font-color
1413
1589
  |<<colors,Color>> +
1414
1590
  (default: #0000ee)
@@ -1447,13 +1623,13 @@ The keys in this category are used to style hyperlink text.
1447
1623
 
1448
1624
  |text-decoration-width
1449
1625
  |<<values,Number>> +
1450
- (default: 1)
1626
+ (default: $base-text-decoration-width)
1451
1627
  |link:
1452
1628
  text-decoration-width: 0.5
1453
1629
  |===
1454
1630
 
1455
- [#keys-literal]
1456
- === (Inline) Literal
1631
+ [#keys-codespan]
1632
+ === Codespan
1457
1633
 
1458
1634
  The keys in this category are used for inline monospaced text in prose and table cells.
1459
1635
 
@@ -1461,73 +1637,77 @@ The keys in this category are used for inline monospaced text in prose and table
1461
1637
  |===
1462
1638
  |Key |Value Type |Example
1463
1639
 
1464
- 3+|[#key-prefix-literal]*Key Prefix:* <<key-prefix-literal,literal>>
1640
+ 3+|[#key-prefix-codespan]*Key Prefix:* <<key-prefix-codespan,codespan>>
1465
1641
 
1466
1642
  |background-color
1467
1643
  |<<colors,Color>> +
1468
1644
  (default: _not set_)
1469
- |literal:
1645
+ |codespan:
1470
1646
  background-color: #f5f5f5
1471
1647
 
1472
1648
  |border-color^[1]^
1473
1649
  |<<colors,Color>> +
1474
1650
  (default: _not set_)
1475
- |literal:
1651
+ |codespan:
1476
1652
  border-color: #cccccc
1477
1653
 
1478
1654
  |border-offset^[2]^
1479
1655
  |<<values,Number>> +
1480
1656
  (default: 0)
1481
- |literal:
1657
+ |codespan:
1482
1658
  border-offset: 2
1483
1659
 
1484
1660
  |border-radius
1485
1661
  |<<values,Number>> +
1486
1662
  (default: _not set_)
1487
- |literal:
1663
+ |codespan:
1488
1664
  border-radius: 3
1489
1665
 
1490
1666
  |border-width
1491
1667
  |<<values,Number>> +
1492
1668
  (default: $base-border-width)
1493
- |literal:
1669
+ |codespan:
1494
1670
  border-width: 0.5
1495
1671
 
1496
1672
  |font-color
1497
1673
  |<<colors,Color>> +
1498
1674
  (default: _inherit_)
1499
- |literal:
1675
+ |codespan:
1500
1676
  font-color: #b12146
1501
1677
 
1502
1678
  |font-family
1503
1679
  |<<fonts,Font family name>> +
1504
1680
  (default: Courier)
1505
- |literal:
1681
+ |codespan:
1506
1682
  font-family: M+ 1mn
1507
1683
 
1508
- |font-size
1684
+ |font-size^[3]^
1509
1685
  |<<values,Number>> +
1510
1686
  (default: _inherit_)
1511
- |literal:
1512
- font-size: 12
1687
+ |codespan:
1688
+ font-size: 1.15em
1513
1689
 
1514
1690
  |font-style
1515
1691
  |<<font-styles,Font style>> +
1516
1692
  (default: _inherit_)
1517
- |literal:
1693
+ |codespan:
1518
1694
  font-style: bold
1519
1695
  |===
1520
1696
 
1521
- . The border is only used if a border color is specified and the border width is not explicitly set to 0.
1522
- The border only works properly if the literal phrase does not have nested formatting.
1697
+ 1. The border is only used if a border color is specified and the border width is not explicitly set to 0.
1698
+ The border only works properly if the code phrase does not have nested formatting.
1523
1699
  Otherwise, the border will be inherited, producing a less than desirable result.
1524
- . The border offset is the amount that the background and border swells around the text.
1700
+ 2. The border offset is the amount that the background and border swells around the text.
1525
1701
  It does not affect the distance between the formatted phrase and the phrases that surround it.
1702
+ 3. You're strongly encouraged to set the value of the font-size property to a relative font size using the `em` units (e.g., `0.9em`).
1703
+ A code span with a fixed font size will not be scaled when the font size of the parent element (e.g., table, caption, etc) is specified.
1704
+ However, by using a relative value, the font size will be computed relative to the size of the text that surrounds it, giving you effectively the same result.
1526
1705
 
1527
1706
  [#keys-heading]
1528
1707
  === Heading
1529
1708
 
1530
- The keys in this category control the style of most headings, including part titles, chapter titles, sections titles, the table of contents title and discrete headings.
1709
+ The keys in this category control the style of most headings, including part titles, chapter titles, sections titles, the table of contents title, and discrete headings.
1710
+ The <<key-prefix-heading-level,heading-h1 key>> controls the font properties of the document title (aka doctitle) when the doctype is article and the title page is not enabled (i.e., the title-page document attribute is not set).
1531
1711
 
1532
1712
  [cols="3,4,5l"]
1533
1713
  |===
@@ -1586,7 +1766,7 @@ The keys in this category control the style of most headings, including part tit
1586
1766
 
1587
1767
  |text-decoration-width
1588
1768
  |<<values,Number>> +
1589
- (default: 1)
1769
+ (default: $base-text-decoration-width)
1590
1770
  |heading:
1591
1771
  text-decoration-width: 0.5
1592
1772
 
@@ -1606,19 +1786,19 @@ The keys in this category control the style of most headings, including part tit
1606
1786
  |<<measurement-units,Measurement>> +
1607
1787
  (default: 4)
1608
1788
  |heading:
1609
- margin-top: $vertical-spacing * 0.2
1789
+ margin-top: 6
1610
1790
 
1611
1791
  |margin-page-top
1612
1792
  |<<measurement-units,Measurement>> +
1613
1793
  (default: 0)
1614
1794
  |heading:
1615
- margin-page-top: $vertical-spacing
1795
+ margin-page-top: 12
1616
1796
 
1617
1797
  |margin-bottom
1618
1798
  |<<measurement-units,Measurement>> +
1619
1799
  (default: 12)
1620
1800
  |heading:
1621
- margin-bottom: 9.6
1801
+ margin-bottom: 6
1622
1802
 
1623
1803
  |min-height-after
1624
1804
  |<<measurement-units,Measurement>> +
@@ -1695,13 +1875,13 @@ The keys in this category control the style of most headings, including part tit
1695
1875
  |<<measurement-units,Measurement>> +
1696
1876
  (default: $heading-margin-top)
1697
1877
  |heading:
1698
- h2-margin-top: $vertical-spacing * 0.5
1878
+ h2-margin-top: 6
1699
1879
 
1700
1880
  |margin-page-top
1701
1881
  |<<measurement-units,Measurement>> +
1702
1882
  (default: $heading-margin-page-top)
1703
1883
  |heading:
1704
- h2-margin-page-top: $vertical-spacing
1884
+ h2-margin-page-top: 12
1705
1885
 
1706
1886
  |margin-bottom
1707
1887
  |<<measurement-units,Measurement>> +
@@ -1710,8 +1890,10 @@ The keys in this category control the style of most headings, including part tit
1710
1890
  h2-margin-bottom: 10
1711
1891
  |===
1712
1892
 
1713
- . `<n>` is a number ranging from 1 to 6, representing each of the six heading levels.
1714
- . A font size is assigned to each heading level by the base theme.
1893
+ 1. `<n>` is a number ranging from 1 to 6, representing each of the six heading levels.
1894
+ h1 is used for part titles (book doctype) or the doctitle (article doctype when the title-page document attribute is not set).
1895
+ h2 is used for chapter titles (book doctype only).
1896
+ 2. A font size is assigned to each heading level by the base theme.
1715
1897
  If you want the font size of a specific level to be inherited, you must assign the value `null` (or `~` for short).
1716
1898
 
1717
1899
  [#keys-section]
@@ -1731,7 +1913,8 @@ The keys in this category control the style of a section body.
1731
1913
  |section:
1732
1914
  indent: [0.5in, 0]
1733
1915
  |===
1734
- . A single value gets applied to both the left and right side (e.g., `0.5in`).
1916
+ 1. Applies to the section body only, excluding section titles and discrete headings.
1917
+ A single value gets applied to both the left and right side (e.g., `0.5in`).
1735
1918
  A two-value array configures the left and right side independently (e.g., `[0.5in, 0]`).
1736
1919
 
1737
1920
  [#keys-title-page]
@@ -1744,8 +1927,10 @@ If you want to enable the title page when using a different doctype (such as the
1744
1927
 
1745
1928
  NOTE: Subtitle partitioning of the doctitle is only enabled when the title page is also enabled.
1746
1929
 
1747
- TIP: The title page can be disabled for the book doctype by setting the `notitle` attribute in the AsciiDoc document header (i.e., `:notitle:`).
1748
- (For other doctypes, just don't set the `title-page` attribute).
1930
+ TIP: For documents that declare the book doctype, the title page can be omitted by setting the `notitle` attribute in the AsciiDoc document header (i.e., `:notitle:`) or by setting the value of the `title_page` category key in the theme to `false`.
1931
+ (It's counterpart, `:!showtitle:`, does not work with this converter).
1932
+ For all other doctypes, the title page is not added by default.
1933
+ In that case, setting the `:notitle:` attribute only removes the document title from the first page of content.
1749
1934
 
1750
1935
  [cols="3,4,5l"]
1751
1936
  |===
@@ -2143,19 +2328,19 @@ TIP: The title page can be disabled for the book doctype by setting the `notitle
2143
2328
  margin-bottom: 5
2144
2329
  |===
2145
2330
 
2146
- . To disable the background color for the title page, set the value to white (i.e., FFFFFF).
2331
+ 1. To disable the background color for the title page, set the value to white (i.e., FFFFFF).
2147
2332
  The color keyword `transparent` is not recognized in this context.
2148
- . By default, page background images are automatically scaled to fit the bounds of the page (i.e., `fit=contain`) and centered (i.e., `position=center`).
2333
+ 2. By default, page background images are automatically scaled to fit the bounds of the page (i.e., `fit=contain`) and centered (i.e., `position=center`).
2149
2334
  The size of the background image can be controlled using any of the sizing attributes on the image macro (i.e., fit, pdfwidth, scaledwidth, or width) when `fit=none`.
2150
2335
  The position of the background image can be controlled using the `position` attribute.
2151
- . Target may be an absolute path or a path relative to the value of the `pdf-themesdir` attribute.
2152
- . % unit is relative to content height; vh unit is relative to page height.
2336
+ 3. Target may be an absolute path or a path relative to the value of the `pdf-themesdir` attribute.
2337
+ 4. % unit is relative to content height; vh unit is relative to page height.
2153
2338
 
2154
2339
  [#keys-prose]
2155
2340
  === Prose
2156
2341
 
2157
- The keys in this category control the spacing around paragraphs (paragraph blocks, paragraph content of a block, and other prose content).
2158
- Typically, all the margin is placed on the bottom.
2342
+ The keys in this category control the spacing below paragraphs, lists, and index categories.
2343
+ The bottom margin is only added if the block is followed by an adjacent block within the same enclosure (e.g., a sidebar, a table cell, or the area outside of any blocks).
2159
2344
 
2160
2345
  [cols="3,4,5l"]
2161
2346
  |===
@@ -2163,17 +2348,17 @@ Typically, all the margin is placed on the bottom.
2163
2348
 
2164
2349
  3+|[#key-prefix-prose]*Key Prefix:* <<key-prefix-prose,prose>>
2165
2350
 
2166
- |margin-top
2167
- |<<measurement-units,Measurement>> +
2168
- (default: 0)
2169
- |prose:
2170
- margin-top: 0
2351
+ //|margin-top
2352
+ //|<<measurement-units,Measurement>> +
2353
+ //(default: 0)
2354
+ //|prose:
2355
+ // margin-top: 0
2171
2356
 
2172
2357
  |margin-bottom
2173
2358
  |<<measurement-units,Measurement>> +
2174
2359
  (default: 12)
2175
2360
  |prose:
2176
- margin-bottom: $vertical-spacing
2361
+ margin-bottom: 6
2177
2362
 
2178
2363
  |margin-inner^[1]^
2179
2364
  |<<measurement-units,Measurement>> +
@@ -2186,15 +2371,24 @@ Typically, all the margin is placed on the bottom.
2186
2371
  (default: _not set_)
2187
2372
  |prose:
2188
2373
  text-indent: 18
2374
+
2375
+ |text-indent-inner^[2]^
2376
+ |<<measurement-units,Measurement>> +
2377
+ (default: _not set_)
2378
+ |prose:
2379
+ text-indent-inner: 18
2189
2380
  |===
2190
2381
 
2191
- . Controls the margin between adjacent paragraphs.
2382
+ 1. Controls the margin between adjacent paragraphs.
2192
2383
  Useful when using indented paragraphs.
2384
+ 2. Only applied to inner paragraphs (paragraphs that follow an adjacent paragraph).
2193
2385
 
2194
2386
  [#keys-block]
2195
2387
  === Block
2196
2388
 
2197
- The keys in this category control the spacing around block elements when a more specific setting is not designated.
2389
+ The keys in this category control the spacing below block elements when a more specific setting is not designated.
2390
+ See the second table in this section for a list of blocks to which these keys apply.
2391
+ The bottom margin is only added if the block is followed by an adjacent block within the same enclosure (e.g., a sidebar, a table cell, or the area outside of any blocks).
2198
2392
 
2199
2393
  [cols="3,4,5l"]
2200
2394
  |===
@@ -2202,16 +2396,22 @@ The keys in this category control the spacing around block elements when a more
2202
2396
 
2203
2397
  3+|[#key-prefix-block]*Key Prefix:* <<key-prefix-block,block>>
2204
2398
 
2399
+ |anchor-top
2400
+ |<<measurement-units,Measurement>> +
2401
+ (default: 0)
2402
+ |block:
2403
+ anchor-top: -12
2404
+
2205
2405
  //|padding
2206
2406
  //|<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>>
2207
2407
  //|block:
2208
2408
  // padding: [12, 15, 12, 15]
2209
2409
 
2210
- |margin-top
2211
- |<<measurement-units,Measurement>> +
2212
- (default: 0)
2213
- |block:
2214
- margin-top: 6
2410
+ //|margin-top
2411
+ //|<<measurement-units,Measurement>> +
2412
+ //(default: 0)
2413
+ //|block:
2414
+ // margin-top: 6
2215
2415
 
2216
2416
  |margin-bottom
2217
2417
  |<<measurement-units,Measurement>> +
@@ -2242,7 +2442,7 @@ Block styles are applied to the following block types:
2242
2442
  === Caption
2243
2443
 
2244
2444
  The keys in this category control the arrangement and style of block captions.
2245
- In addition to the generic caption category, each of these keys can be set on the caption key nested inside the following block categories: blockquote, code, example, footnotes, image, listing, table, and verse.
2445
+ In addition to the generic caption category, each of these keys (except for text decoration) can be set on the caption key nested inside the following block categories: blockquote, code (applies to literal, listing, and source blocks), example, footnotes, image, table, and verse.
2246
2446
 
2247
2447
  [cols="3,4,5l"]
2248
2448
  |===
@@ -2286,6 +2486,24 @@ In addition to the generic caption category, each of these keys can be set on th
2286
2486
  |caption:
2287
2487
  font-style: italic
2288
2488
 
2489
+ |text-decoration
2490
+ |<<text-decorations,Text decoration>> +
2491
+ (default: none)
2492
+ |caption:
2493
+ text-decoration: line-through
2494
+
2495
+ |text-decoration-color
2496
+ |<<colors,Color>> +
2497
+ (default: $caption-font-color)
2498
+ |caption:
2499
+ text-decoration-color: #ff0000
2500
+
2501
+ |text-decoration-width
2502
+ |<<values,Number>> +
2503
+ (default: $base-text-decoration-width)
2504
+ |caption:
2505
+ text-decoration-width: 0.5
2506
+
2289
2507
  |text-transform
2290
2508
  |<<text-transforms,Text transform>> +
2291
2509
  (default: _inherit_)
@@ -2305,13 +2523,13 @@ In addition to the generic caption category, each of these keys can be set on th
2305
2523
  margin-outside: 0
2306
2524
  |===
2307
2525
 
2308
- . When nested inside the `image` key (i.e., `image-caption-align`), the value `inherit` is also accepted.
2526
+ 1. When nested inside the `image` key (i.e., `image-caption-align`), the value `inherit` is also accepted.
2309
2527
  The value `inherit` resolves to the alignment of the block image.
2310
2528
 
2311
2529
  [#keys-code]
2312
- === Code
2530
+ === Code Block
2313
2531
 
2314
- The keys in this category are used to control the style of literal, listing and source blocks.
2532
+ The keys in this category are used to control the style of literal, listing, and source blocks and literal table cells.
2315
2533
 
2316
2534
  [cols="3,4,5l"]
2317
2535
  |===
@@ -2402,10 +2620,10 @@ The keys in this category are used to control the style of literal, listing and
2402
2620
  linenum-font-color: #ccc
2403
2621
  |===
2404
2622
 
2405
- . The line-gap property is used to tune the height of the background color applied to a span of block text highlighted using Rouge.
2406
- . The code-highlight category only applies when using Rouge as the source highlighter.
2623
+ 1. The line-gap property is used to tune the height of the background color applied to a span of block text highlighted using Rouge.
2624
+ 2. The code-highlight category only applies when using Rouge as the source highlighter.
2407
2625
  Otherwise, the styles are controlled by the source highlighter theme.
2408
- . The code-linenum category only applies when using Pygments as the source highlighter.
2626
+ 3. The code-linenum category only applies when using Pygments as the source highlighter.
2409
2627
  Otherwise, the styles are controlled by the source highlighter theme.
2410
2628
 
2411
2629
  [#keys-callout-numbers]
@@ -2455,18 +2673,19 @@ The keys in this category are used to control the style of callout numbers (i.e.
2455
2673
  |conum:
2456
2674
  line-height: 4 / 3
2457
2675
 
2458
- |glyphs^[2]^
2676
+ |glyphs^[3]^
2459
2677
  |circled {vbar} filled {vbar} Unicode String ranges +
2460
2678
  (default: circled)
2461
2679
  |conum:
2462
2680
  glyphs: \u0031-\u0039
2463
2681
  |===
2464
2682
 
2465
- . Currently, the font must contain the circle numbers starting at glyph U+2460.
2466
- . font-family, font-kerning, font-size, font-style, and line-height are only used for markers in a colist.
2683
+ 1. Currently, the font must contain the circle numbers starting at glyph U+2460.
2684
+ 2. font-family, font-kerning, font-size, font-style, and line-height are only used for markers in a colist.
2467
2685
  These properties are inherited for conums inside a verbatim block.
2468
- . The font must provide the required glyphs.
2686
+ 3. The font must provide the required glyphs.
2469
2687
  The glyphs can be specified as a comma-separated list of ranges, where the range values are Unicode numbers (e.g., \u2460).
2688
+ Unicode escape sequences are recognized even if the value is not enclosed in double quotes.
2470
2689
 
2471
2690
  [#keys-button]
2472
2691
  === Button
@@ -2540,92 +2759,94 @@ The keys in this category apply to a button reference (generated from the inline
2540
2759
  font-style: normal
2541
2760
  |===
2542
2761
 
2543
- . The border is only used if a border color is specified and the border width is not explicitly set to 0.
2544
- . The border offset is the amount that the background and border swells around the text.
2762
+ 1. The border is only used if a border color is specified and the border width is not explicitly set to 0.
2763
+ 2. The border offset is the amount that the background and border swells around the text.
2545
2764
  It does not affect the distance between the formatted phrase and the phrases that surround it.
2546
- . The character sequence `%s` in the content key gets replaced with the button label.
2765
+ 3. The character sequence `%s` in the content key gets replaced with the button label.
2547
2766
 
2548
- [#keys-key]
2549
- === Key
2767
+ [#keys-kbd]
2768
+ === Kbd (Keyboard Input)
2550
2769
 
2551
- The keys in this category apply to a key reference (generated from the inline kbd macro).
2770
+ The keys in this category apply to a kbd reference (generated from the inline kbd macro).
2771
+ The kbd reference is a span of text denoting textual user input from a keyboard, voice input, or other text entry device.
2552
2772
 
2553
2773
  [cols="3,4,5l"]
2554
2774
  |===
2555
2775
  |Key |Value Type |Example
2556
2776
 
2557
- 3+|[#key-prefix-key]*Key Prefix:* <<key-prefix-key,key>>
2777
+ 3+|[#key-prefix-kbd]*Key Prefix:* <<key-prefix-kbd,kbd>>
2558
2778
 
2559
2779
  |background-color
2560
2780
  |<<colors,Color>> +
2561
2781
  (default: _not set_)
2562
- |key:
2782
+ |kbd:
2563
2783
  background-color: #fafafa
2564
2784
 
2565
2785
  |border-color^[1]^
2566
2786
  |<<colors,Color>> +
2567
2787
  (default: _not set_)
2568
- |key:
2788
+ |kbd:
2569
2789
  border-color: #cccccc
2570
2790
 
2571
2791
  |border-offset^[2]^
2572
2792
  |<<values,Number>> +
2573
2793
  (default: 0)
2574
- |key:
2794
+ |kbd:
2575
2795
  border-offset: 1.5
2576
2796
 
2577
2797
  |border-radius
2578
2798
  |<<values,Number>> +
2579
2799
  (default: 0)
2580
- |key:
2800
+ |kbd:
2581
2801
  border-radius: 2
2582
2802
 
2583
2803
  |border-width
2584
2804
  |<<values,Number>> +
2585
2805
  (default: $base-border-width)
2586
- |key:
2806
+ |kbd:
2587
2807
  border-width: 0.375
2588
2808
 
2589
2809
  |separator^[3]^
2590
2810
  |<<quoted-string,Quoted string>> +
2591
2811
  (default: "+")
2592
- |key:
2812
+ |kbd:
2593
2813
  separator: "\u2009+\u2009"
2594
2814
 
2595
2815
  |font-color
2596
2816
  |<<colors,Color>> +
2597
2817
  (default: _inherit_)
2598
- |key:
2818
+ |kbd:
2599
2819
  font-color: #000
2600
2820
 
2601
2821
  |font-family
2602
2822
  |<<fonts,Font family name>> +
2603
2823
  (default: Courier)
2604
- |key:
2824
+ |kbd:
2605
2825
  font-family: $base-font-family
2606
2826
 
2607
2827
  |font-size
2608
2828
  |<<values,Number>> +
2609
2829
  (default: _inherit_)
2610
- |key:
2830
+ |kbd:
2611
2831
  font-size: 10.5
2612
2832
 
2613
2833
  |font-style
2614
2834
  |<<font-styles,Font style>> +
2615
2835
  (default: italic)
2616
- |key:
2836
+ |kbd:
2617
2837
  font-style: normal
2618
2838
  |===
2619
2839
 
2620
- . The border is only used if a border color is specified and the border width is not explicitly set to 0.
2621
- . The border offset is the amount that the background and border swells around the text.
2840
+ 1. The border is only used if a border color is specified and the border width is not explicitly set to 0.
2841
+ 2. The border offset is the amount that the background and border swells around the text.
2622
2842
  It does not affect the distance between the formatted phrase and the phrases that surround it.
2623
- . The separator is only used for multi-key sequences.
2843
+ 3. The separator is only used for multi-key input sequences.
2624
2844
 
2625
2845
  [#keys-menu]
2626
2846
  === Menu
2627
2847
 
2628
2848
  The keys in this category apply to the menu label (generated from the inline menu macro).
2849
+ Keep in mind that the styles for the caret can be controlled independently using the `<font>` tag.
2629
2850
 
2630
2851
  [cols="3,4,5l"]
2631
2852
  |===
@@ -2638,6 +2859,66 @@ The keys in this category apply to the menu label (generated from the inline men
2638
2859
  (default: " \u203a ")
2639
2860
  |menu:
2640
2861
  caret-content: ' > '
2862
+
2863
+ |font-color
2864
+ |<<colors,Color>> +
2865
+ (default: _inherit_)
2866
+ |menu:
2867
+ font-color: #AA0000
2868
+
2869
+ |font-family
2870
+ |<<fonts,Font family name>> +
2871
+ (default: _inherit_)
2872
+ |menu:
2873
+ font-family: M+ 1mn
2874
+
2875
+ |font-size
2876
+ |<<values,Number>> +
2877
+ (default: _inherit_)
2878
+ |menu:
2879
+ font-size: 8
2880
+
2881
+ |font-style
2882
+ |<<font-styles,Font style>> +
2883
+ (default: bold)
2884
+ |menu:
2885
+ font-style: bold_italic
2886
+ |===
2887
+
2888
+ [#keys-mark]
2889
+ === Mark
2890
+
2891
+ The keys in this category apply to a mark phrase.
2892
+
2893
+ [cols="3,4,5l"]
2894
+ |===
2895
+ |Key |Value Type |Example
2896
+
2897
+ 3+|[#key-prefix-mark]*Key Prefix:* <<key-prefix-mark,mark>>
2898
+
2899
+ |font-color
2900
+ |<<colors,Color>> +
2901
+ (default: _inherit_)
2902
+ |mark:
2903
+ font-color: #333333
2904
+
2905
+ |font-style
2906
+ |<<font-styles,Font style>> +
2907
+ (default: _inherit_)
2908
+ |mark:
2909
+ font-style: bold
2910
+
2911
+ |background-color
2912
+ |<<colors,Color>> +
2913
+ (default: #ff0000)
2914
+ |mark:
2915
+ background-color: #fcf8e3
2916
+
2917
+ |border-offset
2918
+ |<<values,Number>> +
2919
+ (default: 1)
2920
+ |mark:
2921
+ border-offset: 2
2641
2922
  |===
2642
2923
 
2643
2924
  [#keys-blockquote]
@@ -2762,7 +3043,7 @@ The keys in this category control the arrangement and style of quote blocks.
2762
3043
  text-transform: uppercase
2763
3044
  |===
2764
3045
 
2765
- . If border-left-width is non-zero, the border is only applied to the left side.
3046
+ 1. If border-left-width is non-zero, the border is only applied to the left side.
2766
3047
  Otherwise, if border-width is non-zero, the border is drawn around the whole block.
2767
3048
 
2768
3049
  [#keys-verse]
@@ -2806,7 +3087,7 @@ The keys in this category control the arrangement and style of verse blocks.
2806
3087
  |verse:
2807
3088
  font-color: #333333
2808
3089
 
2809
- |font-family
3090
+ |font-family^[2]^
2810
3091
  |<<fonts,Font family name>> +
2811
3092
  (default: _inherit_)
2812
3093
  |verse:
@@ -2887,8 +3168,10 @@ The keys in this category control the arrangement and style of verse blocks.
2887
3168
  text-transform: uppercase
2888
3169
  |===
2889
3170
 
2890
- . If border-left-width is non-zero, the border is only applied to the left side.
3171
+ 1. If border-left-width is non-zero, the border is only applied to the left side.
2891
3172
  Otherwise, if border-width is non-zero, the border is drawn around the whole block.
3173
+ 2. The verse block does not use a fixed-width font by default, which can affect the layout if the content relies on columns.
3174
+ You can change verse blocks to use a fixed-width font (not necessarily a monospaced font) using this setting.
2892
3175
 
2893
3176
  [#keys-sidebar]
2894
3177
  === Sidebar
@@ -3188,7 +3471,8 @@ The keys in this category control the arrangement and style of admonition blocks
3188
3471
  |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>> +
3189
3472
  (default: $admonition-padding)
3190
3473
  |admonition:
3191
- padding: [0, 12, 0, 12]
3474
+ label:
3475
+ padding: [0, 12, 0, 12]
3192
3476
 
3193
3477
  |vertical-align
3194
3478
  |top {vbar} middle {vbar} bottom +
@@ -3268,12 +3552,12 @@ The keys in this category control the arrangement and style of admonition blocks
3268
3552
  size: 24
3269
3553
  |===
3270
3554
 
3271
- . The top and bottom padding values are ignored on admonition-label-padding.
3272
- . `<name>` can be `note`, `tip`, `warning`, `important`, or `caution`.
3555
+ 1. The top and bottom padding values are ignored on admonition-label-padding.
3556
+ 2. `<name>` can be `note`, `tip`, `warning`, `important`, or `caution`.
3273
3557
  All icon types must be grouped under a single `icons` category.
3274
3558
  In other words, _do not_ declare the `icons` category multiple times.
3275
3559
  The subkeys in the icon category cannot be flattened (e.g., `tip-name: far-lightbulb` is not valid syntax).
3276
- . Required.
3560
+ 3. Required.
3277
3561
  See the `.yml` files in the https://github.com/jessedoyle/prawn-icon/tree/master/data/fonts[prawn-icon repository] for a list of valid icon names.
3278
3562
  The prefix (e.g., `fas-`) determines which font set to use.
3279
3563
  If the prefix is not specified, `fa-` is assumed.
@@ -3369,6 +3653,8 @@ The keys in this category control the arrangement of block images.
3369
3653
  alt:
3370
3654
  font-style: italic
3371
3655
 
3656
+ 3+|[#key-prefix-image-caption]*Key Prefix:* <<key-prefix-image-caption,image-caption>>
3657
+
3372
3658
  |caption-align
3373
3659
  |<<text-alignments,Text alignment>> {vbar} inherit +
3374
3660
  (default: $caption-align)
@@ -3376,22 +3662,29 @@ The keys in this category control the arrangement of block images.
3376
3662
  caption:
3377
3663
  align: inherit
3378
3664
 
3665
+ |caption-text-align
3666
+ |<<text-alignments,Text alignment>> {vbar} inherit +
3667
+ (default: $image-caption-align)
3668
+ |image:
3669
+ caption:
3670
+ text-align: left
3671
+
3379
3672
  |caption-max-width^[5]^
3380
- |fit-content {vbar} none {vbar} <<measurement-units,Measurement>> +
3673
+ |fit-content {vbar} fit-content(percentage) {vbar} none {vbar} <<measurement-units,Measurement>> +
3381
3674
  (default: none)
3382
3675
  |image:
3383
3676
  caption:
3384
3677
  max-width: fit-content
3385
3678
  |===
3386
3679
 
3387
- . Only applies to block images that don't have either a `pdfwidth` or `scaledwidth` attribute on the image macro.
3680
+ 1. Only applies to block images that don't have either a `pdfwidth` or `scaledwidth` attribute on the image macro.
3388
3681
  If specified, this value takes precedence over the value of the `width` attribute on the image macro, but not over the value of the `pdfwidth` or `scaledwidth` attributes.
3389
3682
  This key accepts the same values as the `pdfwidth` attribute.
3390
- . The border is only used if a border color is specified, the border width is specified, the border width is greater than 0, and the `noborder` role is not present.
3683
+ 2. The border is only used if a border color is specified, the border width is specified, the border width is greater than 0, and the `noborder` role is not present.
3391
3684
  The border is drawn above the image on the inside of the box reserved for the image.
3392
- . The value `auto` means the border should expand to fit the width of the container (i.e., full width) instead of the image.
3393
- . Use the placeholders `%\{alt}`, `%\{target}`, `%\{link}`, and `%{/link}` to insert the alt text, image target, and link open/close tags into the content template.
3394
- . In order for the image to be sized correctly when max-width is fit-content, a width should always be specified on the image.
3685
+ 3. The value `auto` means the border should expand to fit the width of the container (i.e., full width) instead of the image.
3686
+ 4. Use the placeholders `%\{alt}`, `%\{target}`, `%\{link}`, and `%{/link}` to insert the alt text, image target, and link open/close tags into the content template.
3687
+ 5. In order for the image to be sized correctly when max-width is fit-content, a width should always be specified on the image.
3395
3688
 
3396
3689
  [#keys-svg]
3397
3690
  === SVG
@@ -3411,61 +3704,7 @@ The keys in this category control the SVG integration.
3411
3704
  fallback_font_family: Times-Roman
3412
3705
  |===
3413
3706
 
3414
- . The fallback font family is only used when the font family in the SVG does not map to a known font name from the font catalog.
3415
-
3416
- [#keys-lead]
3417
- === Lead
3418
-
3419
- The keys in this category control the styling of lead paragraphs.
3420
-
3421
- [cols="3,4,5l"]
3422
- |===
3423
- |Key |Value Type |Example
3424
-
3425
- 3+|[#key-prefix-lead]*Key Prefix:* <<key-prefix-lead,lead>>
3426
-
3427
- |font-color
3428
- |<<colors,Color>> +
3429
- (default: _inherit_)
3430
- |lead:
3431
- font-color: #262626
3432
-
3433
- |font-family
3434
- |<<fonts,Font family name>> +
3435
- (default: _inherit_)
3436
- |lead:
3437
- font-family: M+ 1p
3438
-
3439
- |font-kerning
3440
- |normal {vbar} none +
3441
- (default: _inherit_)
3442
- |lead:
3443
- font-kerning: none
3444
-
3445
- |font-size
3446
- |<<values,Number>> +
3447
- (default: 13.5)
3448
- |lead:
3449
- font-size: 13
3450
-
3451
- |font-style
3452
- |<<font-styles,Font style>> +
3453
- (default: _inherit_)
3454
- |lead:
3455
- font-style: bold
3456
-
3457
- |text-transform
3458
- |<<text-transforms,Text transform>> +
3459
- (default: _inherit_)
3460
- |lead:
3461
- text-transform: uppercase
3462
-
3463
- |line-height
3464
- |<<values,Number>> +
3465
- (default: 1.4)
3466
- |lead:
3467
- line-height: 1.4
3468
- |===
3707
+ 1. The fallback font family is only used when the font family in the SVG does not map to a known font name from the font catalog.
3469
3708
 
3470
3709
  [#keys-abstract]
3471
3710
  === Abstract
@@ -3619,7 +3858,7 @@ The keys in this category control the style of thematic breaks (aka horizontal r
3619
3858
 
3620
3859
  |margin-bottom
3621
3860
  |<<measurement-units,Measurement>> +
3622
- (default: $vertical-spacing)
3861
+ (default: 12)
3623
3862
  |thematic-break:
3624
3863
  margin-bottom: 18
3625
3864
  |===
@@ -3635,9 +3874,8 @@ Asciidoctor PDF supports unordered and ordered description lists.
3635
3874
  These are defined as a description list, but get displayed as an unordered or ordered description list with the term as a subject.
3636
3875
  Only one term is supported.
3637
3876
  The subject is shown using the term font style (bold by default).
3638
- The subject is stacked above the description if the "stack" role is present.
3639
- Otherwise, the subject is arranged as a run-in followed by a subject stop (`:` by default).
3640
- The subject stop can be customized using the `subject-stop` attribute.
3877
+
3878
+ By default, the subject is arranged as a run-in followed by a subject stop (`:` by default).
3641
3879
 
3642
3880
  [source,asciidoc]
3643
3881
  ----
@@ -3645,6 +3883,25 @@ The subject stop can be customized using the `subject-stop` attribute.
3645
3883
  alpha:: partially complete and unstable
3646
3884
  beta:: feature complete and undergoing testing
3647
3885
  ----
3886
+
3887
+ The subject stop can be customized using the `subject-stop` attribute.
3888
+
3889
+ [source,asciidoc]
3890
+ ----
3891
+ [unordered,subject-stop=)]
3892
+ alpha:: partially complete and unstable
3893
+ beta:: feature complete and undergoing testing
3894
+ ----
3895
+
3896
+ If the `stack` role is present, the subject is stacked above the description.
3897
+ In this case, the subject stop is only used if specified explicitly.
3898
+
3899
+ [source,asciidoc]
3900
+ ----
3901
+ [unordered.stack]
3902
+ alpha:: partially complete and unstable
3903
+ beta:: feature complete and undergoing testing
3904
+ ----
3648
3905
  ====
3649
3906
 
3650
3907
  [cols="3,4,5l"]
@@ -3708,44 +3965,44 @@ beta:: feature complete and undergoing testing
3708
3965
  description-indent: 15
3709
3966
  |===
3710
3967
 
3711
- [#keys-outline-list]
3712
- === Outline List
3968
+ [#keys-list]
3969
+ === List
3713
3970
 
3714
- The keys in this category control the arrangement and style of outline list items.
3971
+ The keys in this category control the arrangement and style of regular (ordered and unordered) lists.
3715
3972
 
3716
3973
  [cols="3,4,5l"]
3717
3974
  |===
3718
3975
  |Key |Value Type |Example
3719
3976
 
3720
- 3+|[#key-prefix-outline-list]*Key Prefix:* <<key-prefix-outline-list,outline-list>>
3977
+ 3+|[#key-prefix-list]*Key Prefix:* <<key-prefix-list,list>>
3721
3978
 
3722
3979
  |indent
3723
3980
  |<<measurement-units,Measurement>> +
3724
3981
  (default: 30)
3725
- |outline-list:
3982
+ |list:
3726
3983
  indent: 40
3727
3984
 
3728
3985
  |item-spacing
3729
3986
  |<<measurement-units,Measurement>> +
3730
3987
  (default: 6)
3731
- |outline-list:
3988
+ |list:
3732
3989
  item-spacing: 4
3733
3990
 
3734
3991
  |marker-font-color^[1]^
3735
3992
  |<<colors,Color>> +
3736
3993
  (default: _inherit_)
3737
- |outline-list:
3994
+ |list:
3738
3995
  marker-font-color: #3c763d
3739
3996
 
3740
3997
  |text-align^[2]^
3741
3998
  |<<text-alignments,Text alignment>> +
3742
3999
  (default: $base-align)
3743
- |outline-list:
4000
+ |list:
3744
4001
  text-align: left
3745
4002
  |===
3746
4003
 
3747
- . Controls the color of the bullet glyph that marks items in unordered lists and the number for items in ordered lists.
3748
- . Controls the alignment of the list text only, not nested content (blocks or lists).
4004
+ 1. Controls the color of the bullet glyph that marks items in unordered lists and the number for items in ordered lists.
4005
+ 2. Controls the alignment of the list text only, not nested content (blocks or lists).
3749
4006
 
3750
4007
  [#keys-ulist]
3751
4008
  === Unordered List
@@ -3774,7 +4031,7 @@ The keys in this category control the arrangement and style of unordered list it
3774
4031
 
3775
4032
  |font-color
3776
4033
  |<<colors,Color>> +
3777
- (default: $outline-list-marker-font-color)
4034
+ (default: $list-marker-font-color)
3778
4035
  |ulist:
3779
4036
  marker:
3780
4037
  font-color: #cccccc
@@ -3833,7 +4090,90 @@ The keys in this category control the arrangement and style of unordered list it
3833
4090
  line-height: 2
3834
4091
  |===
3835
4092
 
3836
- . <type> is one of disc, square, circle, checked, unchecked
4093
+ 1. <type> is one of disc, square, circle, checked, unchecked
4094
+
4095
+ [#keys-callout-list]
4096
+ === Callout List
4097
+
4098
+ The keys in this category control the arrangement and style of callout lists (i.e., colists).
4099
+
4100
+ NOTE: The <<keys-callout-numbers>> category controls the appearance of the list markers (i.e., conums) in a callout list.
4101
+ If you change the font-size setting on the callout list, then you likely need to change the font-size setting on the conum category as well.
4102
+
4103
+ [cols="3,4,5a"]
4104
+ |===
4105
+ |Key |Value Type |Example
4106
+
4107
+ 3+|[#key-prefix-callout-list]*Key Prefix:* <<key-prefix-callout-list,callout-list>>
4108
+
4109
+ |item-spacing
4110
+ |<<measurement-units,Measurement>> +
4111
+ (default: $list-item-spacing)
4112
+ |[source,yaml]
4113
+ callout-list:
4114
+ item-spacing: 3
4115
+
4116
+ |font-color
4117
+ |<<colors,Color>> +
4118
+ (default: _inherit_)
4119
+ |[source,yaml]
4120
+ callout-list:
4121
+ font-color: #555555
4122
+
4123
+ |font-family
4124
+ |<<fonts,Font family name>> +
4125
+ (default: _inherit_)
4126
+ |[source,yaml]
4127
+ callout-list:
4128
+ font-family: M+ 1p
4129
+
4130
+ |font-kerning
4131
+ |normal {vbar} none +
4132
+ (default: _inherit_)
4133
+ |[source,yaml]
4134
+ callout-list:
4135
+ font-kerning: none
4136
+
4137
+ |font-size
4138
+ |<<values,Number>> +
4139
+ (default: _inherit_)
4140
+ |[source,yaml]
4141
+ callout-list:
4142
+ font-size: 9
4143
+
4144
+ |font-style
4145
+ |<<font-styles,Font style>> +
4146
+ (default: _inherit_)
4147
+ |[source,yaml]
4148
+ callout-list:
4149
+ font-style: italic
4150
+
4151
+ |text-transform
4152
+ |<<text-transforms,Text transform>> +
4153
+ (default: _inherit_)
4154
+ |[source,yaml]
4155
+ callout-list:
4156
+ text-transform: lowercase
4157
+
4158
+ |line-height
4159
+ |<<values,Number>> +
4160
+ (default: _inherit_)
4161
+ |[source,yaml]
4162
+ callout-list:
4163
+ line-height: 1
4164
+
4165
+ |text-align
4166
+ |<<text-alignments,Text alignment>> +
4167
+ (default: $list-text-align)
4168
+ |callout-list:
4169
+ text-align: left
4170
+
4171
+ |margin-top-after-code
4172
+ |<<measurement-units,Measurement>> +
4173
+ (default: -$block-margin-bottom)
4174
+ |callout-list:
4175
+ margin-top-after-code: 0
4176
+ |===
3837
4177
 
3838
4178
  [#keys-table]
3839
4179
  === Table
@@ -3876,6 +4216,13 @@ The keys in this category control the arrangement and style of tables and table
3876
4216
  |table:
3877
4217
  caption-align: inherit
3878
4218
 
4219
+ |caption-text-align
4220
+ |<<text-alignments,Text alignment>> {vbar} inherit +
4221
+ (default: $table-caption-align)
4222
+ |table:
4223
+ caption:
4224
+ text-align: left
4225
+
3879
4226
  |caption-side
3880
4227
  |top {vbar} bottom +
3881
4228
  (default: top)
@@ -3883,7 +4230,7 @@ The keys in this category control the arrangement and style of tables and table
3883
4230
  caption-side: bottom
3884
4231
 
3885
4232
  |caption-max-width
3886
- |fit-content {vbar} none {vbar} <<measurement-units,Measurement>> +
4233
+ |fit-content {vbar} fit-content(percentage) {vbar} none {vbar} <<measurement-units,Measurement>> +
3887
4234
  (default: fit-content)
3888
4235
  |table:
3889
4236
  caption-max-width: none
@@ -3919,19 +4266,19 @@ The keys in this category control the arrangement and style of tables and table
3919
4266
  font-style: italic
3920
4267
 
3921
4268
  |grid-color
3922
- |<<colors,Color>> +
4269
+ |<<colors,Color>> {vbar} <<colors,Color[x,y]>> +
3923
4270
  (default: $table-border-color)
3924
4271
  |table:
3925
4272
  grid-color: #eeeeee
3926
4273
 
3927
4274
  |grid-style
3928
- |solid {vbar} dashed {vbar} dotted +
4275
+ |solid {vbar} dashed {vbar} dotted {vbar} Style[x,y] +
3929
4276
  (default: solid)
3930
4277
  |table:
3931
4278
  grid-style: dashed
3932
4279
 
3933
4280
  |grid-width
3934
- |<<values,Number>> +
4281
+ |<<values,Number>> {vbar} <<values,Number[x,y]>> +
3935
4282
  (default: $table-border-width)
3936
4283
  |table:
3937
4284
  grid-width: 0.5
@@ -4008,6 +4355,13 @@ The keys in this category control the arrangement and style of tables and table
4008
4355
  head:
4009
4356
  font-style: normal
4010
4357
 
4358
+ |line-height
4359
+ |<<values,Number>> +
4360
+ (default: _inherit_)
4361
+ |table:
4362
+ head:
4363
+ line-height: 1.15
4364
+
4011
4365
  |text-transform
4012
4366
  |<<text-transforms,Text transform>> +
4013
4367
  (default: _inherit_)
@@ -4070,6 +4424,13 @@ The keys in this category control the arrangement and style of tables and table
4070
4424
 
4071
4425
  3+|[#key-prefix-table-cell]*Key Prefix:* <<key-prefix-table-cell,table-cell>>
4072
4426
 
4427
+ |line-height
4428
+ |<<values,Number>> +
4429
+ (default: _inherit_)
4430
+ |table:
4431
+ cell:
4432
+ line-height: 1.5
4433
+
4073
4434
  |padding
4074
4435
  |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>> +
4075
4436
  (default: 2)
@@ -4077,6 +4438,15 @@ The keys in this category control the arrangement and style of tables and table
4077
4438
  cell:
4078
4439
  padding: 3
4079
4440
 
4441
+ 3+|[#key-prefix-table-asciidoc-cell]*Key Prefix:* <<key-prefix-table-asciidoc-cell,table-asciidoc-cell>>
4442
+
4443
+ |style
4444
+ |inherit {vbar} initial
4445
+ (default: inherit)
4446
+ |table:
4447
+ asciidoc-cell:
4448
+ style: initial
4449
+
4080
4450
  3+|[#key-prefix-table-header-cell]*Key Prefix:* <<key-prefix-table-header-cell,table-header-cell>>
4081
4451
 
4082
4452
  //|align
@@ -4129,12 +4499,30 @@ The keys in this category control the arrangement and style of tables and table
4129
4499
  text-transform: uppercase
4130
4500
  |===
4131
4501
 
4132
- . This key only controls the color that is used for stripes.
4502
+ 1. This key only controls the color that is used for stripes.
4133
4503
  The appearance of stripes is controlled using the `stripes` table attribute, the `table-stripes` document attribute (since Asciidoctor 2), or the `stripes` document attribute (prior to Asciidoctor 2).
4134
4504
  Permitted attribute values are even, odd, all, and none.
4135
4505
  Prior to Asciidoctor 2, even rows are shaded by default (e.g., `stripes=even`).
4136
4506
  Since Asciidoctor 2, table stripes are not enabled by default (e.g., `stripes=none`).
4137
4507
 
4508
+ [#keys-index]
4509
+ === Index
4510
+
4511
+ The keys in this category control the style of the autogenerated index section.
4512
+
4513
+ [cols="3,4,5l"]
4514
+ |===
4515
+ |Key |Value Type |Example
4516
+
4517
+ 3+|[#key-prefix-index]*Key Prefix:* <<key-prefix-index,index>>
4518
+
4519
+ |columns
4520
+ |Integer +
4521
+ (default: 2)
4522
+ |index:
4523
+ columns: 2
4524
+ |===
4525
+
4138
4526
  [#keys-footnotes]
4139
4527
  === Footnotes
4140
4528
 
@@ -4241,7 +4629,7 @@ The keys in this category control the arrangement and style of the table of cont
4241
4629
 
4242
4630
  |text-decoration-width
4243
4631
  |<<values,Number>> +
4244
- (default: 1)
4632
+ (default: $base-text-decoration-width)
4245
4633
  |toc:
4246
4634
  text-decoration-width: 0.5
4247
4635
 
@@ -4395,9 +4783,9 @@ The keys in this category control the arrangement and style of the table of cont
4395
4783
  levels: 2 3
4396
4784
  |===
4397
4785
 
4398
- . `<n>` is a number ranging from 1 to 6, representing each of the six heading levels.
4399
- . The dot leader inherits all font properties except `font-style` from the root `toc` category.
4400
- . 0-based levels (e.g., part = 0, chapter = 1).
4786
+ 1. `<n>` is a number ranging from 1 to 6, representing each of the six heading levels.
4787
+ 2. The dot leader inherits all font properties except `font-style` from the root `toc` category.
4788
+ 3. 0-based levels (e.g., part = 0, chapter = 1).
4401
4789
  Dot leaders are only shown for the specified levels.
4402
4790
  If value is not specified, dot leaders are shown for all levels.
4403
4791
 
@@ -4407,7 +4795,7 @@ If value is not specified, dot leaders are shown for all levels.
4407
4795
  The keys in this category control the arrangement and style of running header and footer content.
4408
4796
  Please note that the running content will _not_ be used unless a) the periphery (header or footer) is configured and b) the height key for the periphery is assigned a value.
4409
4797
 
4410
- CAUTION: If the height of the running content periphery is larger than the page margin, the running content will cover the main content.
4798
+ CAUTION: If the height of the running content periphery is taller than the page margin, the running content will cover the main content.
4411
4799
  To avoid this problem, reduce the height of the running content periphery or make the page margin on that side larger.
4412
4800
 
4413
4801
  [cols="3,4,5l"]
@@ -4446,6 +4834,30 @@ To avoid this problem, reduce the height of the running content periphery or mak
4446
4834
  |header:
4447
4835
  border-width: 0.25
4448
4836
 
4837
+ |column-rule-color
4838
+ |<<colors,Color>> +
4839
+ (default: _not set_)
4840
+ |header:
4841
+ column-rule-color: #CCCCCC
4842
+
4843
+ |column-rule-spacing
4844
+ |<<measurement-units,Measurement>> +
4845
+ (default: 0)
4846
+ |header:
4847
+ column-rule-spacing: 5
4848
+
4849
+ |column-rule-style
4850
+ |solid {vbar} double {vbar} dashed {vbar} dotted +
4851
+ (default: solid)
4852
+ |header:
4853
+ column-rule-style: dashed
4854
+
4855
+ |column-rule-width
4856
+ |<<measurement-units,Measurement>> +
4857
+ (default: _not set_)
4858
+ |header:
4859
+ column-rule-width: 0.25
4860
+
4449
4861
  |font-color
4450
4862
  |<<colors,Color>> +
4451
4863
  (default: _inherit_)
@@ -4488,6 +4900,18 @@ To avoid this problem, reduce the height of the running content periphery or mak
4488
4900
  |header:
4489
4901
  line-height: 1.2
4490
4902
 
4903
+ |margin
4904
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom (n/a),left]>> +
4905
+ (default: [0, inherit])
4906
+ |header:
4907
+ margin: 0
4908
+
4909
+ |content-margin
4910
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>> +
4911
+ (default: [0, inherit])
4912
+ |header:
4913
+ content-margin: 0
4914
+
4491
4915
  |padding^[3]^
4492
4916
  |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>> +
4493
4917
  (default: 0)
@@ -4531,6 +4955,27 @@ To avoid this problem, reduce the height of the running content periphery or mak
4531
4955
  recto:
4532
4956
  columns: <25% =50% >25%
4533
4957
 
4958
+ |<side>-margin^[5]^
4959
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom (n/a),left]>> +
4960
+ (default: _inherit_)
4961
+ |header:
4962
+ recto:
4963
+ margin: [0, 0, 0, inherit]
4964
+
4965
+ |<side>-content-margin^[5]^
4966
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>> +
4967
+ (default: _inherit_)
4968
+ |header:
4969
+ recto:
4970
+ content-margin: [0, 0, 0, inherit]
4971
+
4972
+ |<side>-padding^[5]^
4973
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>> +
4974
+ (default: _inherit_)
4975
+ |header:
4976
+ recto:
4977
+ padding: [0, 3, 0, 3]
4978
+
4534
4979
  |<side>-<position>-content^[5,6]^
4535
4980
  |<<quoted-string,Quoted string>> +
4536
4981
  (default: '\{page-number}')
@@ -4571,6 +5016,30 @@ To avoid this problem, reduce the height of the running content periphery or mak
4571
5016
  |footer:
4572
5017
  border-width: 0.25
4573
5018
 
5019
+ |column-rule-color
5020
+ |<<colors,Color>> +
5021
+ (default: _not set_)
5022
+ |footer:
5023
+ column-rule-color: #CCCCCC
5024
+
5025
+ |column-rule-spacing
5026
+ |<<measurement-units,Measurement>> +
5027
+ (default: 0)
5028
+ |footer:
5029
+ column-rule-spacing: 5
5030
+
5031
+ |column-rule-style
5032
+ |solid {vbar} double {vbar} dashed {vbar} dotted +
5033
+ (default: solid)
5034
+ |footer:
5035
+ column-rule-style: dashed
5036
+
5037
+ |column-rule-width
5038
+ |<<measurement-units,Measurement>> +
5039
+ (default: _not set_)
5040
+ |footer:
5041
+ column-rule-width: 0.25
5042
+
4574
5043
  |font-color
4575
5044
  |<<colors,Color>> +
4576
5045
  (default: _inherit_)
@@ -4613,6 +5082,18 @@ To avoid this problem, reduce the height of the running content periphery or mak
4613
5082
  |footer:
4614
5083
  line-height: 1.2
4615
5084
 
5085
+ |margin
5086
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top (n/a),right,bottom,left]>> +
5087
+ (default: [0, inherit])
5088
+ |footer:
5089
+ margin: 0
5090
+
5091
+ |content-margin
5092
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>> +
5093
+ (default: [0, inherit])
5094
+ |footer:
5095
+ content-margin: 0
5096
+
4616
5097
  |padding^[3]^
4617
5098
  |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>> +
4618
5099
  (default: 0)
@@ -4656,6 +5137,27 @@ To avoid this problem, reduce the height of the running content periphery or mak
4656
5137
  verso:
4657
5138
  columns: <50% =0% <50%
4658
5139
 
5140
+ |<side>-margin^[5]^
5141
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top (n/a),right,bottom,left]>> +
5142
+ (default: [0, inherit])
5143
+ |footer:
5144
+ verso:
5145
+ margin: [0, inherit, 0, 0]
5146
+
5147
+ |<side>-content-margin^[5]^
5148
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>> +
5149
+ (default: _inherit_)
5150
+ |footer:
5151
+ verso:
5152
+ content-margin: [0, inherit, 0, 0]
5153
+
5154
+ |<side>-padding^[5]^
5155
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>> +
5156
+ (default: _inherit_)
5157
+ |footer:
5158
+ verso:
5159
+ padding: [0, 3, 0, 3]
5160
+
4659
5161
  |<side>-<position>-content^[5,6]^
4660
5162
  |<<quoted-string,Quoted string>> +
4661
5163
  (default: '\{page-number}')
@@ -4667,23 +5169,27 @@ To avoid this problem, reduce the height of the running content periphery or mak
4667
5169
  3+|[#key-prefix-running-content]*Key Prefix:* <<key-prefix-running-content,running-content>>
4668
5170
 
4669
5171
  |start-at^[7]^
4670
- |title {vbar} toc {vbar} body {vbar} Integer +
5172
+ |title {vbar} toc {vbar} after-toc {vbar} body {vbar} Integer +
4671
5173
  (default: body)
4672
5174
  |running-content:
4673
5175
  start-at: toc
4674
5176
  |===
4675
5177
 
4676
- . The background color spans the width of the page, as does the border when a background color is specified.
4677
- . *If the height is not set, the running content at this periphery is disabled.*
4678
- . If the side padding is negative, the content will bleed into the margin of the page.
4679
- . The maximum section level considered when assigning the implicit `section-title` attribute (and related) available to the running content.
4680
- . `<side>` can be `recto` (right-hand, odd-numbered pages) or `verso` (left-hand, even-numbered pages).
5178
+ 1. To make the background color and border span the width of the page, set the margin to 0 (and adjust the content-margin accordingly).
5179
+ 2. *If the height is not set, the running content at this periphery is disabled.*
5180
+ 3. Do not use negative margins.
5181
+ Instead, adjust the values of the margin and content-margin keys.
5182
+ 4. The maximum section level considered when assigning the implicit `section-title` attribute (and related) available to the running content.
5183
+ 5. `<side>` can be `recto` (right-hand, odd-numbered pages) or `verso` (left-hand, even-numbered pages).
4681
5184
  The `columns` key can also be defined one level up (on `header` or `footer`), in which case the setting will be inherited.
4682
5185
  Where the page sides fall in relation to the physical or printed page number is controlled using the `pdf-folio-placement` attribute (except when `media=prepress`, which implies `physical`).
4683
- . `<position>` can be `left`, `center` or `right`.
4684
- . Only works if the document uses a title page (i.e., doctype is book or `title-page` attribute is set)
5186
+ The column rules are only added if the `columns` key is specified.
5187
+ 6. `<position>` can be `left`, `center` or `right`.
5188
+ 7. The `title`, `toc`, and `after-toc` values are only recognized if the title page is enabled (i.e., doctype is book or `title-page` attribute is set)
4685
5189
  The `toc` value only applies if the toc is in the default location (before the first page of the body).
4686
- If the toc macro is used to position the toc, the start-at behavior is the same as if the toc is not enabled.
5190
+ If value is `toc`, and the toc macro is used to position the toc, the start-at behavior is the same as if the toc is not enabled.
5191
+ If value is `after-toc`, the running content will start after the toc, no matter where it's placed in the document.
5192
+ To disable the running content on toc pages inserted by the toc macro, set the noheader and/or nofooter options on the macro (e.g., `toc::[opts=nofooter]`).
4687
5193
  If value is an integer, the running content will start at the specified page of the body (i.e., 1 is first page, 2 is second page, etc.)
4688
5194
 
4689
5195
  IMPORTANT: If you don't specify a height for either the header or footer key, it effectively disables the content at that periphery.
@@ -4754,6 +5260,7 @@ In addition, the following attributes are also available when defining the conte
4754
5260
 
4755
5261
  * page-count
4756
5262
  * page-number (only set if the `pagenums` attribute is set on the document, which it is by default)
5263
+ * page-layout
4757
5264
  * document-title
4758
5265
  * document-subtitle
4759
5266
  * part-title
@@ -4782,6 +5289,7 @@ header:
4782
5289
  center:
4783
5290
  content: $header-recto-center-content
4784
5291
  footer:
5292
+ background-image: image:running-content-bg-{page-layout}.svg[]
4785
5293
  height: 0.75in
4786
5294
  line-height: 1
4787
5295
  recto:
@@ -4856,18 +5364,18 @@ This is done using AsciiDoc attributes.
4856
5364
 
4857
5365
  There are three AsciiDoc attributes that tell Asciidoctor PDF how to locate and apply your theme.
4858
5366
 
4859
- pdf-theme (or pdf-style):: The name of the YAML theme file to load.
5367
+ pdf-theme:: The name of the YAML theme file to load.
4860
5368
  If the name ends with `.yml`, it's assumed to be the complete name of a file and is resolved relative to `pdf-themesdir`, if specified, otherwise the current directory.
4861
5369
  Otherwise, `-theme.yml` is appended to the name to make the file name (i.e., `<name>-theme.yml`) and is resolved relative to `pdf-themesdir`, if specified, otherwise the built-in themes dir.
4862
5370
 
4863
- pdf-themesdir (or pdf-stylesdir):: The directory where the theme file is located.
5371
+ pdf-themesdir:: The directory where the theme file is located.
4864
5372
  _Specifying an absolute path is recommended._
4865
5373
  +
4866
5374
  If you use images in your theme, image paths are resolved relative to this directory.
4867
5375
  If `pdf-theme` ends with `.yml`, and `pdf-themesdir` is not specified, then `pdf-themesdir` defaults to the directory of the path specified by `pdf-theme`.
4868
5376
 
4869
5377
  pdf-fontsdir:: The directory or directories where the fonts used by your theme, if any, are located.
4870
- Multiple entries must be separated by a semi-colon.
5378
+ Multiple entries must be separated by either a comma or a semi-colon.
4871
5379
  To reference a file inside a JAR file on the classpath, prefix with the path with `uri:classloader:` (AsciidoctorJ only).
4872
5380
  _Specifying an absolute path is recommended._
4873
5381
 
@@ -4922,149 +5430,240 @@ This only works when running Asciidoctor PDF on the JVM.
4922
5430
  == Theme-Related Document Attributes
4923
5431
 
4924
5432
  There are various settings in the theme you control using document attributes.
4925
- These settings override equivalent keys defined in the theme file, where applicable.
5433
+ If an attribute is marked as "Header Only", it only takes effect if defined in the AsciiDoc document header or via the API.
5434
+ If an attribute matches a key in the theme file, the attribute takes precedence.
4926
5435
 
4927
- [cols="2,3,6l"]
5436
+ [cols="2,3,^1,6l"]
4928
5437
  |===
4929
- |Attribute |Value Type |Example
5438
+ |Attribute |Value Type | Header Only |Example
4930
5439
 
4931
5440
  |autofit-option
4932
5441
  |flag (default: _not set_)
5442
+ |No
4933
5443
  |:autofit-option:
4934
5444
 
4935
- |chapter-label
4936
- |string (default: Chapter)
4937
- |:chapter-label: Chapitre
4938
-
4939
5445
  |<face>-cover-image^[1]^
4940
5446
  |path^[2]^ {vbar} image macro^[3]^ +
4941
5447
  (format can be image or PDF)
5448
+ |Yes
4942
5449
  |:front-cover-image: image:front-cover.pdf[]
4943
5450
 
4944
5451
  |hyphens^[7]^
4945
5452
  |language code {vbar} _blank_ to default to en_us (default: _not set_)
5453
+ |Yes
4946
5454
  |:hyphens: de
4947
5455
 
5456
+ |icons^[13]^
5457
+ |font {vbar} image (default: _not set_)
5458
+ |No
5459
+ |:icons: font
5460
+
4948
5461
  |media
4949
5462
  |screen {vbar} print {vbar} prepress
5463
+ |Yes
4950
5464
  |:media: prepress
4951
5465
 
4952
5466
  |compress
4953
5467
  |flag (default: _not set_)
5468
+ |Yes
4954
5469
  |:compress:
4955
5470
 
4956
5471
  |optimize
4957
5472
  |screen {vbar} ebook {vbar} printer {vbar} prepress {vbar} default (default: default)
5473
+ |Yes
4958
5474
  |:optimize: prepress
4959
5475
 
4960
- |outlinelevels^[10]^
5476
+ |outlinelevels^[12]^
4961
5477
  |Integer {vbar} Integer:Integer (default: same as _toclevels_)
5478
+ |Yes
4962
5479
  |:outlinelevels: 2
4963
5480
 
4964
5481
  |page-background-image^[4]^
4965
5482
  |path^[2]^ {vbar} image macro^[3]^
5483
+ |Yes
4966
5484
  |:page-background-image: image:bg.jpg[]
4967
5485
 
4968
5486
  |page-background-image-(recto{vbar}verso)^[4]^
4969
5487
  |path^[2]^ {vbar} image macro^[3]^
5488
+ |Yes
4970
5489
  |:page-background-image-recto: image:bg-recto.jpg[]
4971
5490
 
4972
5491
  |page-foreground-image
4973
5492
  |path^[2]^ {vbar} image macro^[3]^
5493
+ |Yes
4974
5494
  |:page-foreground-image: image:watermark.svg[]
4975
5495
 
4976
5496
  |pagenums^[5]^
4977
5497
  |flag (default: _set_)
5498
+ |Yes
4978
5499
  |:pagenums:
4979
5500
 
4980
5501
  |pdf-page-layout
4981
5502
  |portrait {vbar} landscape
5503
+ |Yes
4982
5504
  |:pdf-page-layout: landscape
4983
5505
 
4984
5506
  |pdf-page-margin
4985
5507
  |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[top,right,bottom,left]>>
5508
+ |Yes
4986
5509
  |:pdf-page-margin: [1in, 0.5in]
4987
5510
 
4988
5511
  |pdf-page-mode
4989
5512
  |outline {vbar} none {vbar} thumbs {vbar} fullscreen {vbar} fullscreen outline {vbar} fullscreen none {vbar} fullscreen thumbs (default: outline)
5513
+ |Yes
4990
5514
  |:pdf-page-mode: fullscreen none
4991
5515
 
4992
5516
  |pdf-page-size
4993
5517
  |https://github.com/prawnpdf/pdf-core/blob/0.6.0/lib/pdf/core/page_geometry.rb#L16-L68[Named size^] {vbar} <<measurement-units,Measurement[width, height]>>
5518
+ |Yes
4994
5519
  |:pdf-page-size: [6in, 9in]
4995
5520
 
4996
5521
  |pdf-folio-placement
4997
5522
  |virtual {vbar} virtual-inverted {vbar} physical {vbar} physical-inverted
5523
+ |Yes
4998
5524
  |:pdf-folio-placement: physical
4999
5525
 
5000
5526
  |pdf-version
5001
5527
  |1.3 {vbar} 1.4 {vbar} 1.5 {vbar} 1.6 {vbar} 1.7 (default: 1.4)
5528
+ |Yes
5002
5529
  |:pdf-version: 1.7
5003
5530
 
5004
5531
  |pdfmark^[6]^
5005
5532
  |flag (default: _not set_)
5533
+ |Yes
5006
5534
  |:pdfmark:
5007
5535
 
5008
- |scripts^[7]^
5536
+ |scripts^[8]^
5009
5537
  |cjk (default: _not set_)
5538
+ |Yes
5010
5539
  |:scripts: cjk
5011
5540
 
5012
- |text-align^[8]^
5541
+ |text-align^[9]^
5013
5542
  |<<text-alignments,Text alignment>>
5543
+ |Yes
5014
5544
  |:text-align: left
5015
5545
 
5016
5546
  |title-logo-image
5017
5547
  |path^[2]^ {vbar} image macro^[3]^
5548
+ |Yes
5018
5549
  |:title-logo-image: image:logo.png[top=25%, align=center, pdfwidth=0.5in]
5019
5550
 
5020
- |title-page^[9]^
5551
+ |title-page^[10]^
5021
5552
  |flag (default: _not set_)
5553
+ |Yes
5022
5554
  |:title-page:
5023
5555
 
5024
5556
  |title-page-background-image
5025
5557
  |path^[2]^ {vbar} image macro^[3]^
5558
+ |Yes
5026
5559
  |:title-page-background-image: image:title-bg.jpg[]
5027
5560
 
5028
- |toc-max-pagenum-digits^[10]^
5561
+ |toc-max-pagenum-digits^[11]^
5029
5562
  |Integer (default: 3)
5563
+ |Yes
5030
5564
  |:toc-max-pagenum-digits: 4
5031
5565
  |===
5032
5566
 
5033
- . `<face>` can be `front` or `back`.
5034
- . The path is resolved relative to base_dir.
5035
- . The target of the image macro is resolved relative to `imagesdir`.
5036
- If the image macro syntax is not used, the value is resolved relative to the base directory, which defaults to the document directory.
5037
- . By default, page background images are automatically scaled to fit the bounds of the page (i.e., `fit=contain`) and centered (i.e., `position=center`).
5567
+ 1. `<face>` can be `front` or `back`.
5568
+ 2. A bare path is resolved relative to base_dir, which defaults to the document directory.
5569
+ 3. The target of the image macro is resolved relative to `imagesdir` since it's defined in the AsciiDoc document (unlike in the theme, where it is resolved relative to the value of `pdf-themesdir`).
5570
+ 4. By default, page background images are automatically scaled to fit the bounds of the page (i.e., `fit=contain`) and centered (i.e., `position=center`).
5038
5571
  The size of the background image can be controlled using any of the sizing attributes on the image macro (i.e., fit, pdfwidth, scaledwidth, or width) when `fit=none`.
5039
5572
  The position of the background image can be controlled using the `position` attribute.
5040
5573
  If the recto (right-hand, odd-numbered pages) or verso (left-hand, even-numbered pages) background is specified, it will be used only for that side.
5041
5574
  If a background image isn't specified for a side, the converter will use the default page background image (`page-background-image`), if specified.
5042
5575
  To disable the background image for a side, use the value `none`.
5043
- . Controls whether the implicit `page-number` attribute is to the running header and footer content specified in the theme file.
5576
+ 5. Controls whether the implicit `page-number` attribute is to the running header and footer content specified in the theme file.
5044
5577
  Instead of disabling page numbers, you can use the `noheader` and `nofooter` attributes to disable the running header and footer, respectively.
5045
- . Enables generation of the http://milan.kupcevic.net/ghostscript-ps-pdf/#marks[pdfmark] file, which contains metadata that is fed to Ghostscript when optimizing the PDF file.
5046
- . Activates line break rules for CJK languages (specifically Chinese and Japanese).
5578
+ 6. Enables generation of the http://milan.kupcevic.net/ghostscript-ps-pdf/#marks[pdfmark] file, which contains metadata that can be fed to Ghostscript when optimizing the PDF file.
5579
+ If you're using Ghostscript >= 8.54, this feature is not needed.
5580
+ 7. Activates hyphenation for the language code specified (defaults to en_us).
5581
+ 8. Activates line break rules for CJK languages (specifically Chinese and Japanese).
5047
5582
  Chinese and Japanese are written without spaces (and may not use spaces when mixing with English words either).
5048
5583
  This setting allows a line break to be placed between any two CJK characters to accommodate wrapping.
5049
5584
  These languages also use different punctuation for pause, full stop, and dash, which are taken into account when breaking lines.
5050
- . _(Experimental)_ The `text-align` document attribute is intended as a simple way to toggle text justification.
5585
+ 9. _(Experimental)_ The `text-align` document attribute is intended as a simple way to toggle text justification.
5051
5586
  The value of this attribute overrides the `base-align` key set by the theme.
5052
5587
  For more fine-grained control, you should customize using the theme.
5053
- . The title page is only enabled by default for the book doctype.
5588
+ 10. The title page is only enabled by default for the book doctype.
5054
5589
  To force the title page to be used for other doctypes, set the `title-page` attribute in the document header.
5055
- . If the TOC overlaps the first page of content, increase this number.
5056
- . The second number in the value of `outlinelevels` is the number of levels of the outline to expand (e.g., `3:1`).
5590
+ 11. If the TOC overlaps the first page of content, increase this number.
5591
+ 12. The second number in the value of `outlinelevels` is the number of levels of the outline to expand (e.g., `3:1`).
5057
5592
  If the second number is not present, all levels are expanded.
5593
+ 13. By default, admonitions have a text-based label that matches the admonition type.
5594
+ To use icons instead, set the `icons` attribute to `font`.
5595
+ This setting allows the theme to control the icon used for each type (see the <<key-prefix-admonition-icon,admonition-icon key>>).
5596
+ It also enables the `icon` macro (covered in the README).
5597
+ To use local image filees, set the `icons` attribute to `image`.
5598
+ Note that if the value of the `icons` attribute is `image`, the `icon` macro will produce text-based output.
5599
+
5600
+ == Page Numbering
5601
+
5602
+ The converter automatically keeps track of page numbers.
5603
+ These page numbers are available as metadata and determine folio placement (recto/verso pages).
5604
+
5605
+ By default, the converter assigns the page number 1 to the first body page of the document.
5606
+ It then increments the page number for each page thereafter.
5607
+ All front matter pages that precede the first body page in the book doctype (or when the `title-page` attribute is set) (e.g., cover page, title page, and toc pages) are numbered using roman numerals (e.g., i, ii, iii, etc).
5608
+ Since these computed page numbers can differ from the physical page numbers, we refer to them as [.term]_virtual page numbers_.
5609
+
5610
+ By default, the folio placement is derived from the virtual page number.
5611
+ Odd page numbers (e.g., 1, 3, 5, ...) designate recto pages and even page numbers (e.g., 2, 4, 6, ...) designate verso pages.
5612
+
5613
+ It's possible to influence the virtual page numbering using a combination of the theme and document attributes.
5614
+ One such customization is to control where the transition from roman numerals to integers occurs.
5615
+
5616
+ The theme can specify the page where the integer (1-based) page numbering should begin using the `page-numbering-start-at` key.
5617
+ For instance, the theme can specify `page-numbering-start-at: title`, which will make the integer page numbering start at the title page when enabled (i.e., the title page will be assigned the virtual page number 1).
5618
+ Alternately, the theme can specify an offset from the first body page where the page numbering should begin (all doctypes).
5619
+ For instance, `page-numbering-start-at: 2` tells the converter to assign the virtual page number 1 to the second page of the body.
5620
+ Any page that precedes that page will be numbered using roman numerals.
5621
+
5622
+ Changing the page on which the integer page numbering begins can alter to folio placement.
5623
+ To correct for this, or to change the folio placement in general, you can use the `pdf-folio-placement` document attribute.
5624
+ For instance, to base the folio placement on physical page numbers, set the value of this attribute to `physical` (e.g., `pdf-folio-placement=physical`).
5625
+ To invert the recto and verso pages, add the `-inverted` qualifier to the value (e.g., `pdf-folio-placement=physical-inverted`).
5626
+
5627
+ The default theme shows the virtual page number in the footer of all body pages.
5628
+ If you're starting with a blank theme, you can add the page number by using the `\{page-number}` attribute reference in the `content` key of the running content (header or footer).
5629
+ For example:
5630
+
5631
+ [source,yaml]
5632
+ ----
5633
+ footer:
5634
+ recto:
5635
+ right:
5636
+ content: '\{page-number}'
5637
+ ----
5638
+
5639
+ If you want the running content to also appear on front matter pages, you can use the theme to change the page on which the running content starts with the `running-content-start-at` key.
5640
+ For instance, to start the running content on the title page, assuming the title page is enabled, set `running-content-start-at: title` in your theme file.
5641
+
5642
+ Aside from the configurability mentioned, the page numbering logic is computed automatically.
5643
+
5644
+ [#print]
5645
+ == Printing Mode (print)
5646
+
5647
+ Asciidoctor PDF provides the following behaviors to assist with printing:
5058
5648
 
5059
- == Publishing Mode
5649
+ * Shows the URL for links (unless the linked text matches the URL)
5650
+ * Consolidates page ranges in the index
5651
+ * Disables links from page numbers in index to location of term in document
5060
5652
 
5061
- Asciidoctor PDF provides the following features to assist with publishing:
5653
+ You activate these printing features by setting the `media` attribute to `print` in the header of your AsciiDoc document (e.g., `:media: print`) or from the API or CLI (e.g., `-a media=print`).
5654
+ You may also want to consider using the print-optimized theme, which uses darker, grayscale colors for text and borders (e.g., `-a pdf-theme=default-for-print`).
5655
+
5656
+ [#prepress]
5657
+ == Publishing Mode (prepress)
5658
+
5659
+ In addition to the <<print,printing mode behaviors>>, Asciidoctor PDF provides the following behaviors to assist with publishing:
5062
5660
 
5063
5661
  * Double-sided (mirror) page margins
5064
5662
  * Automatic facing pages
5065
5663
 
5066
- These features are activated when you set the `media` attribute to `prepress` in the header of your AsciiDoc document or from the CLI or API.
5664
+ You activate these publishing (aka prepress) features by setting the `media` attribute to `prepress` in the header of your AsciiDoc document (e.g., `:media: prepress`) or from the API or CLI (e.g., `-a media=prepress`).
5067
5665
  The following sections describe the behaviors that this setting activates.
5666
+ You may also want to consider using the print-optimized theme, which uses darker, grayscale colors for text and borders (e.g., `-a pdf-theme=default-for-print`).
5068
5667
 
5069
5668
  === Double-Sided Page Margins
5070
5669
 
@@ -5089,7 +5688,7 @@ The page margins alternate between recto and verso.
5089
5688
  The first page in the document (after the cover) is a recto page.
5090
5689
 
5091
5690
  If no cover is specified, the recto margin is not applied to the title page.
5092
- To apply the recto margin to the title page, but not include a cover, assign the value `~` to the `front-cover-image` attribute.
5691
+ To apply the recto margin to the title page, but not include a cover, assign the value `~` to the `front-cover-image` and `back-cover-image` attributes.
5093
5692
 
5094
5693
  === Automatic Facing Pages
5095
5694
 
@@ -5122,8 +5721,31 @@ You can check on the status of this defect by following https://github.com/ascii
5122
5721
 
5123
5722
  == Source Highlighting Theme
5124
5723
 
5125
- You can define and apply your own source highlighting theme to source blocks when using Rouge as the source highlighter.
5126
- This section explains how.
5724
+ When using Rouge as the source highlighter, you can apply a bundled theme (aka style) to your source blocks or define and apply your own.
5725
+
5726
+ === Using a Highlighting Theme
5727
+
5728
+ Rouge bundles several themes you can use to colorize your source blocks.
5729
+ To use one of these themes, first set the value of the `source-highlighter` document attribute to `rouge`.
5730
+ Then, specify the desired theme using the `rouge-style` document attribute.
5731
+
5732
+ The following example demonstrates how to apply the monokai theme from Rouge to source blocks.
5733
+
5734
+ [source,asciidoc]
5735
+ ----
5736
+ :source-highlighter: rouge
5737
+ :rouge-style: monokai
5738
+ ----
5739
+
5740
+ You can generate a list of all available themes by running the following command:
5741
+
5742
+ $ ruby -e 'require :rouge.to_s; puts Rouge::Theme.registry.keys.sort.join ?\n'
5743
+
5744
+ You can also find the list of themes in the Rouge source repository at https://github.com/rouge-ruby/rouge/tree/master/lib/rouge/themes.
5745
+
5746
+ If the bundled themes don't suit your needs, you can define one of your own.
5747
+
5748
+ === Custom Highlighting Theme
5127
5749
 
5128
5750
  A custom theme for Rouge is defined using a Ruby class.
5129
5751
  Start by creating a Ruby source file to define your theme.
@@ -5306,8 +5928,8 @@ Let's customize the part title page by making the background orange, making the
5306
5928
  The method `typeset_text` and `calc_line_metrics` are provided by Asciidoctor PDF to make writing text easier.
5307
5929
  If you wanted, you could just use the low-level `text` method provided by Prawn.
5308
5930
 
5309
- To find all the available methods to override, consult the https://www.rubydoc.info/github/asciidoctor/asciidoctor-pdf/Asciidoctor/Pdf/Converter[API docs].
5310
- For deeper examples of how to override the behavior of the converter, refer to the extended converter in the https://github.com/mraible/infoq-mini-book/blob/master/src/main/ruby/asciidoctor-pdf-extensions.rb[InfoQ Mini-Book template].
5931
+ To find all the available methods to override, consult the https://www.rubydoc.info/github/asciidoctor/asciidoctor-pdf/Asciidoctor/PDF/Converter[API docs].
5932
+ For deeper examples of how to override the behavior of the converter, refer to the extended converter in the https://github.com/mraible/infoq-mini-book/blob/main/src/main/ruby/asciidoctor-pdf-extensions.rb[InfoQ Mini-Book template].
5311
5933
 
5312
5934
  Now that you've seen some examples of how to extend the converter, let's look at how to use it.
5313
5935
 
@@ -5323,14 +5945,15 @@ Now you're hacking the typesetting!
5323
5945
  [appendix]
5324
5946
  == Preparing a Custom Font
5325
5947
 
5326
- Any TTF font can be used with Prawn--and hence Asciidoctor PDF--without modifications (unless, of course, it's corrupt or contains errors).
5948
+ Any TTF or OTF font can be used with Prawn--and hence Asciidoctor PDF--without modifications (unless, of course, it's corrupt or contains errors).
5327
5949
  However, you may discover that kerning is disabled and certain required glyphs are missing (or replaced with boxes).
5328
5950
  To address these problems, you need to prepare the font using a font program such as {url-fontforge}[FontForge].
5951
+ These instructions will cover how to prepare a TTF font, but the same applies for an OTF font.
5329
5952
 
5330
5953
  === Validate the Font
5331
5954
 
5332
5955
  Before using the font, you may want to check that the font is valid.
5333
- To do so, create the following script, which will verify that the TTF font is free from errors.
5956
+ To do so, create the following script, which will verify that the font is free from errors.
5334
5957
 
5335
5958
  .validate-font.rb
5336
5959
  [source,ruby]
@@ -5363,7 +5986,7 @@ You can find a crash course in how to use the program on the FontForge project s
5363
5986
 
5364
5987
  Here are the modifications you need to apply to a custom font for it to work best with Asciidoctor PDF:
5365
5988
 
5366
- * Convert the font to TTF (only required if the font is not already a TTF, such as an OTF or TTC).
5989
+ * Convert the font to TTF or OTF (only required if the font is a TTC or other format not supported by Prawn).
5367
5990
  * Add the glyphs for the required characters if missing from the font (optional if using a fallback font).
5368
5991
  * Subset the font to exclude unused characters to reduce the file size (optional).
5369
5992
  * Save the file using the old-style kern table to activate kerning.
@@ -5426,5 +6049,5 @@ Performing all this font modification manually can be tedious (not to mention ha
5426
6049
  Fortunately, FontForge provides a {url-fontforge-scripting}[scripting interface], which you can use to automate the process.
5427
6050
 
5428
6051
  In fact, that's what we use to prepare the fonts that are bundled with Asciidoctor PDF.
5429
- You can find that FontForge script, the Bash script that calls it, and the Docker image in which it is run in the https://github.com/asciidoctor/asciidoctor-pdf/tree/main/scripts[scripts directory] of this project.
6052
+ You can find that FontForge script, the Bash script that calls it, and the Docker image in which it is run in the {url-repo-root}/scripts[scripts directory] of this project.
5430
6053
  You can use that script as a starting point or reference for your own font preparation / modification script.