Skip to content

Commit 8e25d91

Browse files
authored
Merge pull request #5 from davibarreira/article
Adding new templates :article and :matharticle
2 parents 2239012 + ce2d357 commit 8e25d91

File tree

9 files changed

+219
-30
lines changed

9 files changed

+219
-30
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NotebookToLaTeX"
22
uuid = "4acc56a1-9938-4ee1-a82a-abdf2d4f6bfc"
33
authors = ["Davi Barreira <[email protected]> and contributors"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ with an extra argument providing the target directory for the LaTeX files, e.g.:
8080
```
8181
This will create a `./project/` folder instead of the `./build_latex`.
8282

83+
If instead you just want a simple report containing the Notebook,
84+
you can use the `:article` template.
85+
86+
### Templates
87+
88+
At the moment, the available templates are:
89+
* `:book` - The standard LaTeX book template;
90+
* `:mathbook` - Very similar to `:book`, but with some extra packages for mathematics;
91+
* `:article` - Simple template using the `article` document class;
92+
* `:matharticle` - The `article` template with extra packages for mathematics.
93+
8394
Read the [documentation](https://davibarreira.github.io/NotebookToLaTeX.jl/dev) for more information.
8495

8596

docs/src/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ with an extra argument providing the target directory for the LaTeX files, e.g.:
6868
```
6969
This will create a `./project/` folder instead of the `./build_latex`.
7070

71+
If instead you just want a simple report containing the Notebook,
72+
you can use the `:article` template.
73+
7174
### Font - JuliaMono
7275

7376
Note that when you run `notebooktolatex` without providing a `fontpath`,
@@ -86,7 +89,9 @@ correctly find your fonts. You can also do this manually by changing the `julia_
8689

8790
At the moment, the available templates are:
8891
* `:book` - The standard LaTeX book template;
89-
* `:mathbook` - Very similar to `:book`, but with some extra packages already imported.
92+
* `:mathbook` - Very similar to `:book`, but with some extra packages already imported;
93+
* `:article` - Simple template using the `article` document class.
94+
* `:matharticle` - The `article` template with extra packages for mathematics.
9095

9196
### Plots and Images
9297

src/NotebookToLaTeX.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,11 @@ function plutotolatex(notebookname, targetdir="./build_latex"; template=:book, f
211211
for i in nb[:order]
212212
if nb[:celltype][i] == "markdown"
213213
if startswith(strip(nb[:contents][i]), "md\"\"\"")
214-
parsed = markdowntolatex(strip(nb[:contents][i])[7:end-3], targetdir, nb[:notebookdir])*"\n\n"
214+
parsed = markdowntolatex(strip(nb[:contents][i])[7:end-3],
215+
targetdir, nb[:notebookdir], template=template)*"\n\n"
215216
elseif startswith(strip(nb[:contents][i]), "md\"")
216-
parsed = markdowntolatex(strip(nb[:contents][i])[4:end-1], targetdir, nb[:notebookdir])*"\n\n"
217+
parsed = markdowntolatex(strip(nb[:contents][i])[4:end-1],
218+
targetdir, nb[:notebookdir], template=template)*"\n\n"
217219
else
218220
throw(DomainError("Markdown cell must start with either md\"\"\" or md\"."))
219221
end
@@ -289,7 +291,7 @@ function jupytertolatex(notebook, targetdir="./build_latex"; template=:book, fon
289291

290292
# Checks whether the cell has markdown
291293
if get(cell,"cell_type", nothing) == "markdown" || get(cell,"cell_type", nothing) == "raw"
292-
parsed = markdowntolatex(strip(join(cell["source"])), targetdir, notebookdir)
294+
parsed = markdowntolatex(strip(join(cell["source"])), targetdir, notebookdir, template=template)
293295
write(f,parsed)
294296

295297
# Checks whether the cell has code and whether the code is hidden

src/markdowntolatex.jl

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function parseparagraph(paragraph, targetdir, notebookdir)
106106
return parsedparagraph
107107
end
108108

109-
function markdowntolatex(md, targetdir, notebookdir)
109+
function markdowntolatex(md, targetdir, notebookdir; template=:book)
110110
tag = false
111111
component = ""
112112
parsedtext = ""
@@ -133,26 +133,40 @@ function markdowntolatex(md, targetdir, notebookdir)
133133
end
134134
continue
135135
elseif startswith(l, "####")
136-
parsedtext *= "\n\\subsubsection{" * l[6:end] * "}\n"
136+
if template == :article || template == :matharticle
137+
parsedtext *= "\n\\subsubsubsection{" * l[6:end] * "}\n"
138+
else
139+
parsedtext *= "\n\\subsubsection{" * l[6:end] * "}\n"
140+
end
137141
continue
138142
elseif startswith(l, "###")
139-
parsedtext *= "\n\\subsection{" * l[5:end] * "}\n"
143+
if template == :article || template == :matharticle
144+
parsedtext *= "\n\\subsubsection{" * l[5:end] * "}\n"
145+
else
146+
parsedtext *= "\n\\subsection{" * l[5:end] * "}\n"
147+
end
140148
continue
141149
elseif startswith(l, "##")
142-
parsedtext *= "\n\\section{" * l[4:end] * "}\n"
150+
if template == :article || template == :matharticle
151+
parsedtext *= "\n\\subsection{" * l[4:end] * "}\n"
152+
else
153+
parsedtext *= "\n\\section{" * l[4:end] * "}\n"
154+
end
143155
continue
144156
elseif startswith(l, "#")
145-
parsedtext *= "\n\\chapter{" * l[3:end] * "}\n"
157+
if template == :article || template == :matharticle
158+
parsedtext *= "\n\\section{" * l[3:end] * "}\n"
159+
else
160+
parsedtext *= "\n\\chapter{" * l[3:end] * "}\n"
161+
end
146162
continue
147163
end
148164

149165

150166
if tag
151167
parsedtext *= "\t" * l * "\n"
152168
elseif !tag
153-
#= if !startswith(l, "#") =#
154-
parsedtext *= parseparagraph(l, targetdir, notebookdir)
155-
#= end =#
169+
parsedtext *= parseparagraph(l, targetdir, notebookdir)
156170
end
157171
end
158172
return parsedtext

src/templates.jl

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,49 @@ function createtemplate(path=".", template=:book)
1414

1515
elseif template == :mathbook
1616
tex = "%! TeX program = lualatex\n\\documentclass[12pt, oneside]{book}\n\n\\usepackage{listings}\n\n\\pagestyle{plain}\n\\usepackage{pdfpages}\n\\usepackage{titlesec}\n\n%%%% MATH PACKAGES %%%%\n\n\\usepackage{amsfonts, amsthm,amsmath,amssymb,mathtools}\n\\usepackage{bbm}\n\\usepackage{bm}\n\\usepackage{mathtools}\n\\usepackage{thmtools} % List of Theorems\n\n%%%%%%%%%%%%%%%%%%%%%%%\n\n\\usepackage[square,numbers]{natbib}\n\\usepackage[pdftex,bookmarks=true,bookmarksopen=false,bookmarksnumbered=true,colorlinks=true,linkcolor=blue]{hyperref}\n\\usepackage[utf8]{inputenc}\n\\usepackage{float}\n\\usepackage{enumerate}\n\n%%%%%%% JULIA %%%%%%%%%%\n\\input{julia_font}\n\\input{julia_listings}\n\\input{julia_listings_unicode}\n\n\\lstdefinelanguage{JuliaLocal}{\n language = Julia, % inherit Julia lang. to add keywords\n morekeywords = [3]{thompson_sampling}, % define more functions\n morekeywords = [2]{Beta, Distributions}, % define more types and modules\n}\n%%%%%%%%%%%%%%%%%%%%%%%%\n\n\n%%%%%%%%%% BOOK INFORMATION %%%%%%%%%%\n\\newcommand{\\authorname}{Name}\n\\newcommand{\\booktitle}{Title}\n\\newcommand{\\subtitle}{Subtitle}\n\\newcommand{\\publisher}{TBD}\n\\newcommand{\\editionyear}{2021}\n\\newcommand{\\isbn}{XYZ} % replace this with your own ISBN\n\n\\title{\\booktitle}\n\\author{\\authorname}\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n%%%%%%%%%%%% MATH STYLE %%%%%%%%%%%%%\n\\newtheoremstyle{bfnote}%\n {}{}\n {}{}\n {\\bfseries}{.}\n { }{\\thmname{#1}\\thmnumber{ #2}\\thmnote{ (#3)}}\n\\theoremstyle{bfnote}\n\\newenvironment{prf}[1][Proof]{\\textbf{#1.} }{\\qed}\n\\newtheorem{theorem}{Theorem}[section]\n\\newtheorem{definition}[theorem]{Definition}\n\\newtheorem{exer}{Exercise}[section]\n\\newtheorem{lemma}[theorem]{Lemma}\n\\newtheorem{corollary}[theorem]{Corollary}\n\\newtheorem{proposition}[theorem]{Proposition}\n\n\\newtheorem{note}{Note}[section]\n\\newtheorem{example}{Example}[section]\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n\\begin{document}\n\n% \\includepdf{cover.pdf}\n\n\\frontmatter\n\\input{frontmatter/titlepage}\n\\input{frontmatter/copyright}\n% \\include{preface}\n\n\\newpage\n\\tableofcontents\n\n%\\listoftheorems[onlynamed]\n\n\\mainmatter\n\\newpage\n% INCLUDE NOTEBOOKS HERE %\n\n\\bibliography{ref}\n\n\\bibliographystyle{plainnat}\n\n\\include{appendix}\n\n\\end{document}\n\n"
17+
18+
19+
elseif template == :article
20+
tex = "%! TeX program = lualatex\n\\documentclass[12pt]{article}\n\n\\usepackage{listings}\n\n\\pagestyle{plain}\n\\usepackage{pdfpages}\n\n\\usepackage[square,numbers]{natbib}\n\\usepackage[pdftex,bookmarks=true,bookmarksopen=false,bookmarksnumbered=true,colorlinks=true,linkcolor=blue]{hyperref}\n\\usepackage[utf8]{inputenc}\n\\usepackage{float}\n\\usepackage{enumerate}\n\n%%%%%%% JULIA %%%%%%%%%%\n\\input{julia_font}\n\\input{julia_listings}\n\\input{julia_listings}\n\\input{julia_listings_unicode}\n\n\\lstdefinelanguage{JuliaLocal}{\n language = Julia, % inherit Julia lang. to add keywords\n}\n%%%%%%%%%%%%%%%%%%%%%%%%\n\n\n\\begin{document}\n\n\\newpage\n% INCLUDE NOTEBOOKS HERE %\n\n\n\\bibliography{ref}\n\n\\bibliographystyle{plainnat}\n\n\\include{appendix}\n\n\\end{document}\n"
21+
22+
elseif template == :matharticle
23+
tex = "%! TeX program = lualatex\n\\documentclass[12pt]{article}\n\n\\usepackage{listings}\n\n\\pagestyle{plain}\n\\usepackage{pdfpages}\n\n\\usepackage[square,numbers]{natbib}\n\\usepackage[pdftex,bookmarks=true,bookmarksopen=false,bookmarksnumbered=true,colorlinks=true,linkcolor=blue]{hyperref}\n\\usepackage[utf8]{inputenc}\n\\usepackage{float}\n\\usepackage{enumerate}\n\n%%%% MATH PACKAGES %%%%\n\n\\usepackage{amsfonts, amsthm,amsmath,amssymb,mathtools}\n\\usepackage{bbm}\n\\usepackage{bm}\n\\usepackage{mathtools}\n\\usepackage{thmtools} % List of Theorems\n\n%%%%%%% JULIA %%%%%%%%%%\n\\input{julia_font}\n\\input{julia_listings}\n\\input{julia_listings}\n\\input{julia_listings_unicode}\n\n\\lstdefinelanguage{JuliaLocal}{\n language = Julia, % inherit Julia lang. to add keywords\n}\n%%%%%%%%%%%%%%%%%%%%%%%%\n\n%%%%%%%%%%%% MATH STYLE %%%%%%%%%%%%%\n\\newtheoremstyle{bfnote}%\n {}{}\n {}{}\n {\\bfseries}{.}\n { }{\\thmname{#1}\\thmnumber{ #2}\\thmnote{ (#3)}}\n\\theoremstyle{bfnote}\n\\newenvironment{prf}[1][Proof]{\\textbf{#1.} }{\\qed}\n\\newtheorem{theorem}{Theorem}[section]\n\\newtheorem{definition}[theorem]{Definition}\n\\newtheorem{exer}{Exercise}[section]\n\\newtheorem{lemma}[theorem]{Lemma}\n\\newtheorem{corollary}[theorem]{Corollary}\n\\newtheorem{proposition}[theorem]{Proposition}\n\n\\newtheorem{note}{Note}[section]\n\\newtheorem{example}{Example}[section]\n\n\n\\begin{document}\n\n\\newpage\n% INCLUDE NOTEBOOKS HERE %\n\n\n\\bibliography{ref}\n\n\\bibliographystyle{plainnat}\n\n\\include{appendix}\n\n\\end{document}\n"
1724
end
25+
1826
maintex = path * "/main.tex"
1927
if !isfile(maintex)
2028
open(maintex, "w") do f
2129
write(f, tex)
2230
end
2331
end
2432

25-
preface = "\\newpage\n\\chapter*{Preface}\n\\addcontentsline{toc}{chapter}{Preface}\n"
26-
prefacetex = path * "/preface.tex"
2733

28-
if !isfile(prefacetex)
29-
open(prefacetex, "w") do f
30-
write(f, preface)
34+
if template == :book || template == :mathbook
35+
preface = "\\newpage\n\\chapter*{Preface}\n\\addcontentsline{toc}{chapter}{Preface}\n"
36+
prefacetex = path * "/preface.tex"
37+
38+
if !isfile(prefacetex)
39+
open(prefacetex, "w") do f
40+
write(f, preface)
41+
end
3142
end
32-
end
3343

34-
titlepage = "% \\pagestyle{empty}\n\n% % Half title page\n% {\n% \\centering\n\n% ~\n\n% \\vspace{24pt}\n% {\\scshape\\Huge \\booktitle \\par}\n% }\n% \\cleardoublepage\n\n% Title page\n\\begin{titlepage}\n\t\\centering\n\n\t~\n\n\t\\vspace{24pt}\n\t{\\scshape\\Huge \\booktitle\\par}\n\t\\vspace{6pt}\n\t{\\scshape\\large \\subtitle\\par}\n\t\\vspace{\\stretch{1.25}}\n\t{\\itshape\\large by\\par}\n\t\\vspace{6pt}\n\t{\\itshape\\Large \\authorname\\par}\n\t\\vspace{\\stretch{6}}\n\t{\\large \\publisher\\par}\n\\end{titlepage}\n"
44+
titlepage = "% \\pagestyle{empty}\n\n% % Half title page\n% {\n% \\centering\n\n% ~\n\n% \\vspace{24pt}\n% {\\scshape\\Huge \\booktitle \\par}\n% }\n% \\cleardoublepage\n\n% Title page\n\\begin{titlepage}\n\t\\centering\n\n\t~\n\n\t\\vspace{24pt}\n\t{\\scshape\\Huge \\booktitle\\par}\n\t\\vspace{6pt}\n\t{\\scshape\\large \\subtitle\\par}\n\t\\vspace{\\stretch{1.25}}\n\t{\\itshape\\large by\\par}\n\t\\vspace{6pt}\n\t{\\itshape\\Large \\authorname\\par}\n\t\\vspace{\\stretch{6}}\n\t{\\large \\publisher\\par}\n\\end{titlepage}\n"
3545

36-
titlepagetex = path * "/frontmatter/titlepage.tex"
37-
if !isfile(titlepagetex)
38-
open(titlepagetex, "w") do f
39-
write(f, titlepage)
46+
titlepagetex = path * "/frontmatter/titlepage.tex"
47+
if !isfile(titlepagetex)
48+
open(titlepagetex, "w") do f
49+
write(f, titlepage)
50+
end
4051
end
41-
end
4252

43-
copyright = "% Copyright page\n\n{\\small\n\\setlength{\\parindent}{0em}\\setlength{\\parskip}{1em}\n\n~\n\n\\vfill\n\nCopyright \\copyright{} 2021 \\authorname\n\nAll rights reserved. No part of this publication may be reproduced, stored or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise without written permission from the publisher. It is illegal to copy this book, post it to a website, or distribute it by any other means without permission.\n\nFirst edition, \\editionyear{}\n\nISBN \\isbn{} % see main.tex\n\nPublished by \\publisher{}\n}\n"
53+
copyright = "% Copyright page\n\n{\\small\n\\setlength{\\parindent}{0em}\\setlength{\\parskip}{1em}\n\n~\n\n\\vfill\n\nCopyright \\copyright{} 2021 \\authorname\n\nAll rights reserved. No part of this publication may be reproduced, stored or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise without written permission from the publisher. It is illegal to copy this book, post it to a website, or distribute it by any other means without permission.\n\nFirst edition, \\editionyear{}\n\nISBN \\isbn{} % see main.tex\n\nPublished by \\publisher{}\n}\n"
4454

45-
copyrighttex = path * "/frontmatter/copyright.tex"
46-
if !isfile(copyrighttex)
47-
open(copyrighttex, "w") do f
48-
write(f, copyright)
55+
copyrighttex = path * "/frontmatter/copyright.tex"
56+
if !isfile(copyrighttex)
57+
open(copyrighttex, "w") do f
58+
write(f, copyright)
59+
end
4960
end
5061
end
5162
end

templates/article.tex

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
%! TeX program = lualatex
2+
\documentclass[12pt]{article}
3+
4+
\usepackage{listings}
5+
6+
\pagestyle{plain}
7+
\usepackage{pdfpages}
8+
9+
\usepackage[square,numbers]{natbib}
10+
\usepackage[pdftex,bookmarks=true,bookmarksopen=false,bookmarksnumbered=true,colorlinks=true,linkcolor=blue]{hyperref}
11+
\usepackage[utf8]{inputenc}
12+
\usepackage{float}
13+
\usepackage{enumerate}
14+
15+
%%%%%%% JULIA %%%%%%%%%%
16+
\input{julia_font}
17+
\input{julia_listings}
18+
\input{julia_listings}
19+
\input{julia_listings_unicode}
20+
21+
\lstdefinelanguage{JuliaLocal}{
22+
language = Julia, % inherit Julia lang. to add keywords
23+
}
24+
%%%%%%%%%%%%%%%%%%%%%%%%
25+
26+
27+
\begin{document}
28+
29+
\newpage
30+
% INCLUDE NOTEBOOKS HERE %
31+
32+
33+
\bibliography{ref}
34+
35+
\bibliographystyle{plainnat}
36+
37+
\include{appendix}
38+
39+
\end{document}

templates/matharticle.tex

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
%! TeX program = lualatex
2+
\documentclass[12pt]{article}
3+
4+
\usepackage{listings}
5+
6+
\pagestyle{plain}
7+
\usepackage{pdfpages}
8+
9+
\usepackage[square,numbers]{natbib}
10+
\usepackage[pdftex,bookmarks=true,bookmarksopen=false,bookmarksnumbered=true,colorlinks=true,linkcolor=blue]{hyperref}
11+
\usepackage[utf8]{inputenc}
12+
\usepackage{float}
13+
\usepackage{enumerate}
14+
15+
%%%% MATH PACKAGES %%%%
16+
17+
\usepackage{amsfonts, amsthm,amsmath,amssymb,mathtools}
18+
\usepackage{bbm}
19+
\usepackage{bm}
20+
\usepackage{mathtools}
21+
\usepackage{thmtools} % List of Theorems
22+
23+
%%%%%%% JULIA %%%%%%%%%%
24+
\input{julia_font}
25+
\input{julia_listings}
26+
\input{julia_listings}
27+
\input{julia_listings_unicode}
28+
29+
\lstdefinelanguage{JuliaLocal}{
30+
language = Julia, % inherit Julia lang. to add keywords
31+
}
32+
%%%%%%%%%%%%%%%%%%%%%%%%
33+
34+
%%%%%%%%%%%% MATH STYLE %%%%%%%%%%%%%
35+
\newtheoremstyle{bfnote}%
36+
{}{}
37+
{}{}
38+
{\bfseries}{.}
39+
{ }{\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}
40+
\theoremstyle{bfnote}
41+
\newenvironment{prf}[1][Proof]{\textbf{#1.} }{\qed}
42+
\newtheorem{theorem}{Theorem}[section]
43+
\newtheorem{definition}[theorem]{Definition}
44+
\newtheorem{exer}{Exercise}[section]
45+
\newtheorem{lemma}[theorem]{Lemma}
46+
\newtheorem{corollary}[theorem]{Corollary}
47+
\newtheorem{proposition}[theorem]{Proposition}
48+
49+
\newtheorem{note}{Note}[section]
50+
\newtheorem{example}{Example}[section]
51+
52+
53+
\begin{document}
54+
55+
\newpage
56+
% INCLUDE NOTEBOOKS HERE %
57+
58+
59+
\bibliography{ref}
60+
61+
\bibliographystyle{plainnat}
62+
63+
\include{appendix}
64+
65+
\end{document}

test/runtests.jl

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,48 @@ using Test
7979
rm(jupyterpath, recursive=true)
8080
end
8181

82+
@testset "Template :article and :matharticle" begin
83+
jupyterpath = "./jupyter/build_latex/"
84+
85+
for template in [:article, :matharticle]
86+
notebooktolatex("./jupyter/jupyternotebook.ipynb", jupyterpath, template=template)
87+
@test isfile(jupyterpath * "main.tex")
88+
@test !isfile(jupyterpath * "preface.tex")
89+
@test !isfile(jupyterpath * "frontmatter/copyright.tex")
90+
@test !isfile(jupyterpath * "frontmatter/titlepage.tex")
91+
@test isfile(jupyterpath * "julia_font.tex")
92+
@test isfile(jupyterpath * "julia_listings.tex")
93+
@test isfile(jupyterpath * "julia_listings_unicode.tex")
94+
@test isfile(jupyterpath * "/notebooks/jupyternotebook.tex")
95+
@test isfile(jupyterpath * "/fonts/JuliaMono_Bold.ttf")
96+
@test isfile(jupyterpath * "/fonts/JuliaMono_Medium.ttf")
97+
@test isfile(jupyterpath * "/fonts/JuliaMono_Regular.ttf")
98+
@test isfile(jupyterpath * "/figures/figure.pdf")
99+
@test isfile(jupyterpath * "/figures/jupyternotebook_figure1.pdf")
100+
@test isfile(jupyterpath * "/figures/jupyternotebook_figure1.svg")
101+
@test isfile(jupyterpath * "/figures/jupyternotebook_figure2.png")
102+
@test isfile(jupyterpath * "/figures/plotexample.png")
103+
@test contains(read(jupyterpath * "/notebooks/jupyternotebook.tex", String), "\\section{My Notebook}")
104+
@test contains(read(jupyterpath * "/notebooks/jupyternotebook.tex", String), "\\subsection{Start importing}")
105+
@test contains(read(jupyterpath * "/notebooks/jupyternotebook.tex", String), "\\subsubsection{Some theory}")
106+
107+
@test contains(read(jupyterpath * "/notebooks/jupyternotebook.tex", String), "\\subsubsection{Some theory}")
108+
109+
if template == :matharticle
110+
mathspecific = ["\\usepackage{amsfonts, amsthm,amsmath,amssymb,mathtools}",
111+
"\\usepackage{bbm}",
112+
"\\usepackage{bm}",
113+
"\\usepackage{mathtools}",
114+
"\\usepackage{thmtools}"]
115+
for mathpackage in mathspecific
116+
@test contains(read(jupyterpath * "main.tex", String), mathpackage)
117+
end
118+
end
119+
120+
rm(jupyterpath, recursive=true)
121+
end
122+
end
123+
82124
rm(path, recursive=true)
83125
rm("./build_latex/", recursive=true)
84126
end

0 commit comments

Comments
 (0)