Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #143 from sometea/ps_dvi_formats
Browse files Browse the repository at this point in the history
Add support for ps and dvi file formats for latexmk builder
  • Loading branch information
thomasjo committed Nov 10, 2015
2 parents 08a0de8 + 8067cd4 commit bbdcb22
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/builders/latexmk.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ export default class LatexmkBuilder extends Builder {
}

constructArgs (filePath) {
const outputFormat = atom.config.get('latex.outputFormat') || 'pdf'

const args = [
'-interaction=nonstopmode',
'-f',
'-cd',
'-pdf',
`-${outputFormat}`,
'-synctex=1',
'-file-line-error'
]
Expand Down
7 changes: 7 additions & 0 deletions lib/config-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ export default {
default: ''
},

outputFormat: {
description: 'Output file format. DVI and PS currently only supported for latexmk.',
type: 'string',
enum: ['pdf', 'dvi', 'ps'],
default: 'pdf'
},

enableShellEscape: {
type: 'boolean',
default: false
Expand Down
9 changes: 9 additions & 0 deletions spec/builders/latexmk-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ describe('LatexmkBuilder', () => {
helpers.spyOnConfig('latex.customEngine', 'pdflatex %O %S')
expect(builder.constructArgs(filePath)).toContain('-pdflatex="pdflatex %O %S"')
})

it('adds -ps or -dvi and removes -pdf arguments according to package config', () => {
helpers.spyOnConfig('latex.outputFormat', 'ps')
expect(builder.constructArgs(filePath)).toContain('-ps')
expect(builder.constructArgs(filePath)).not.toContain('-pdf')
helpers.spyOnConfig('latex.outputFormat', 'dvi')
expect(builder.constructArgs(filePath)).toContain('-dvi')
expect(builder.constructArgs(filePath)).not.toContain('-pdf')
})
})

describe('run', () => {
Expand Down

0 comments on commit bbdcb22

Please sign in to comment.