@@ -12,6 +12,7 @@ import {
1212 kKeepTyp ,
1313 kOutputExt ,
1414 kOutputFile ,
15+ kOutputSuffix ,
1516 kVariant ,
1617} from "../../config/constants.ts" ;
1718import { Format } from "../../config/types.ts" ;
@@ -45,7 +46,8 @@ export function typstPdfOutputRecipe(
4546 // calculate output and args for pandoc (this is an intermediate file
4647 // which we will then compile to a pdf and rename to .typ)
4748 const [ inputDir , inputStem ] = dirAndStem ( input ) ;
48- const output = inputStem + ".typ" ;
49+ const suffix = format . render [ kOutputSuffix ] || "" ;
50+ const output = inputStem + suffix + ".typ" ;
4951 let args = options . pandocArgs || [ ] ;
5052 const pandoc = { ...format . pandoc } ;
5153 if ( options . flags ?. output ) {
@@ -62,7 +64,7 @@ export function typstPdfOutputRecipe(
6264
6365 // run typst
6466 await validateRequiredTypstVersion ( ) ;
65- const pdfOutput = join ( inputDir , inputStem + ".pdf" ) ;
67+ const pdfOutput = join ( inputDir , inputStem + suffix + ".pdf" ) ;
6668 const typstOptions : TypstCompileOptions = {
6769 quiet : options . flags ?. quiet ,
6870 fontPaths : asArray ( format . metadata ?. [ kFontPaths ] ) as string [ ] ,
@@ -111,7 +113,7 @@ export function typstPdfOutputRecipe(
111113 ? finalOutput === kStdOut
112114 ? undefined
113115 : normalizeOutputPath ( input , finalOutput )
114- : normalizeOutputPath ( input , join ( inputDir , inputStem + ".pdf" ) ) ;
116+ : normalizeOutputPath ( input , join ( inputDir , inputStem + suffix + ".pdf" ) ) ;
115117
116118 // return recipe
117119 const recipe : OutputRecipe = {
0 commit comments