Skip to content

Commit 7f79e2a

Browse files
author
JJ Allaire
committed
don't add koma extras if the user has specified a non-koma documentclass
1 parent b8cff79 commit 7f79e2a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎src/format/pdf/format-pdf.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,24 @@ function createPdfFormat(autoShiftHeadings = true, koma = true): Format {
9696
formatExtras: (_input: string, flags: PandocFlags, format: Format) => {
9797
const extras: FormatExtras = {};
9898

99+
console.log(format.metadata["documentclass"]);
100+
99101
// Post processed for dealing with latex output
100102
extras.postprocessors = [pdfLatexPostProcessor(flags, format)];
101103

104+
// user may have overridden koma, check for that here
105+
const documentclass = format.metadata[kDocumentClass] as
106+
| string
107+
| undefined;
108+
if (
109+
documentclass &&
110+
!["srcbook", "scrreprt", "scrartcl", "scrlttr2"].includes(
111+
documentclass,
112+
)
113+
) {
114+
koma = false;
115+
}
116+
102117
// default to KOMA article class. we do this here rather than
103118
// above so that projectExtras can override us
104119
if (koma) {

0 commit comments

Comments
 (0)