Skip to content

Commit

Permalink
📑 Remove fontenc in latex test templates (#1572)
Browse files Browse the repository at this point in the history
Fixes #1512
  • Loading branch information
rowanc1 authored Oct 7, 2024
1 parent 91b8591 commit ec48a72
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 45 deletions.
1 change: 0 additions & 1 deletion packages/jtex/docs/command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jtex parse arxiv_two_column/template.tex
> preprint line 2
> lipsum line 3
> amsthm line 19
> fontenc line 20
```

```{warning}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/dois/outputs/dois.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
59 changes: 30 additions & 29 deletions packages/mystmd/tests/endToEnd.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,41 @@ function resolve(relative: string) {
return path.resolve(__dirname, relative);
}

const only = '';

describe.concurrent(
'End-to-end cli export tests',
() => {
const cases = loadCases('exports.yml');
test.each(cases.map((c): [string, TestCase] => [c.title, c]))(
'%s',
async (_, { cwd, command, outputs }) => {
// Clean expected outputs if they already exist
await Promise.all(
outputs.map(async (output) => {
if (fs.existsSync(resolve(output.path))) {
await exec(`rm ${resolve(output.path)}`, { cwd: resolve(cwd) });
}
}),
);
// Run CLI command
await exec(command, { cwd: resolve(cwd) });
// Expect correct output
outputs.forEach((output) => {
expect(fs.existsSync(resolve(output.path))).toBeTruthy();
if (path.extname(output.content) === '.json') {
expect(
JSON.parse(fs.readFileSync(resolve(output.path), { encoding: 'utf-8' })),
).toMatchObject(
JSON.parse(fs.readFileSync(resolve(output.content), { encoding: 'utf-8' })),
);
} else {
expect(fs.readFileSync(resolve(output.path), { encoding: 'utf-8' })).toEqual(
fs.readFileSync(resolve(output.content), { encoding: 'utf-8' }),
);
test.each(
cases.filter((c) => !only || c.title === only).map((c): [string, TestCase] => [c.title, c]),
)('%s', async (_, { cwd, command, outputs }) => {
// Clean expected outputs if they already exist
await Promise.all(
outputs.map(async (output) => {
if (fs.existsSync(resolve(output.path))) {
await exec(`rm ${resolve(output.path)}`, { cwd: resolve(cwd) });
}
});
},
);
}),
);
// Run CLI command
await exec(command, { cwd: resolve(cwd) });
// Expect correct output
outputs.forEach((output) => {
expect(fs.existsSync(resolve(output.path))).toBeTruthy();
if (path.extname(output.content) === '.json') {
expect(
JSON.parse(fs.readFileSync(resolve(output.path), { encoding: 'utf-8' })),
).toMatchObject(
JSON.parse(fs.readFileSync(resolve(output.content), { encoding: 'utf-8' })),
);
} else {
expect(fs.readFileSync(resolve(output.path), { encoding: 'utf-8' })).toEqual(
fs.readFileSync(resolve(output.content), { encoding: 'utf-8' }),
);
}
});
});
},
{ timeout: 15000 },
);
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/nested-toc-file/.outputs/out.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/outputs/acronym.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/outputs/glossary.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/outputs/multi-page-tex-chapters.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/outputs/multi-page-tex-from-toc.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/outputs/multi-page-tex-part.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/outputs/multi-page-tex-single.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/outputs/multi-page-tex.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/outputs/notebook.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/outputs/templated-tex.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/templates/tex/template.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
Expand Down
1 change: 0 additions & 1 deletion packages/mystmd/tests/templates/tex/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ packages:
- babel
- caption
- enumitem
- fontenc
- framed
- geometry
- graphicx
Expand Down

0 comments on commit ec48a72

Please sign in to comment.