Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing Makie, CairoMakie and Plots as requirements via Requires.jl #8

Merged
merged 6 commits into from
Jan 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,28 @@ version = "0.1.1"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Librsvg_jll = "925c91fb-5dd6-59dd-8e8c-345e74382d89"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
# CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
# Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
# Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
ReadableRegex = "cbbcb084-453d-4c4c-b292-e315607ba6a4"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"

[compat]
CairoMakie = "0.6"
JSON = "0.21"
Librsvg_jll = "2.42"
Makie = "0.15"
Plots = "1"
# CairoMakie = "0.6"
# Makie = "0.15"
# Plots = "1"
ReadableRegex = "0.3"
Requires = "1"
julia = "1"

[extras]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ notebooktolatex
```

### Basic Use
To convert the notebooks just use `notebooktolatex("mynotebook.jl", template=:book)`.
To convert the notebooks just use `notebooktolatex("mynotebook.ipynb", template=:book)`.
This will produce a directory `./build_latex/` where the LaTeX files
will be generated. Inside `build_latex/` you will have:
```
Expand Down Expand Up @@ -76,13 +76,23 @@ as a chapter. To get your final book pdf, just compile the `main.tex` using `lua
In case you want a different project folder, you can run the command
with an extra argument providing the target directory for the LaTeX files, e.g.:
```julia
`notebooktolatex("mynotebook.jl", "./project/",template=:book)`.
`notebooktolatex("mynotebook.ipynb", "./project/",template=:book)`.
```
This will create a `./project/` folder instead of the `./build_latex`.

If instead you just want a simple report containing the Notebook,
you can use the `:article` template.

### Pluto Users

If you want to convert Pluto notebooks, you have to import `Makie.jl`, `CairoMakie.jl` and
`Plots.jl`, which are the packages used in order to save your figures. The reason for this
is that NotebookToLaTeX.jl uses Requires.jl in order to avoid these packages as dependencies.
Hence, to convert Pluto, you have to run:
```julia
notebooktolatex("myplutonotebook.jl", template=:book)
```

### Templates

At the moment, the available templates are:
Expand Down
18 changes: 13 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ notebooktolatex
```

### Basic Use
To convert the notebooks just use `notebooktolatex("mynotebook.jl", template=:book)`.
To convert the notebooks just use `notebooktolatex("mynotebook.ipynb", template=:book)`.
This will produce a directory `./build_latex/` where the LaTeX files
will be generated. Inside `build_latex/` you will have:
```
Expand Down Expand Up @@ -64,13 +64,23 @@ as a chapter. To get your final book pdf, just compile the `main.tex` using `lua
In case you want a different project folder, you can run the command
with an extra argument providing the target directory for the LaTeX files, e.g.:
```julia
`notebooktolatex("mynotebook.jl", "./project/",template=:book)`.
`notebooktolatex("mynotebook.ipynb", "./project/",template=:book)`.
```
This will create a `./project/` folder instead of the `./build_latex`.

If instead you just want a simple report containing the Notebook,
you can use the `:article` template.

### Pluto Users

If you want to convert Pluto notebooks, you have to import `Makie.jl`, `CairoMakie.jl` and
`Plots.jl`, which are the packages used in order to save your figures. The reason for this
is that NotebookToLaTeX.jl uses Requires.jl in order to avoid these packages as dependencies.
Hence, to convert Pluto, you have to run:
```julia
notebooktolatex("myplutonotebook.jl", template=:book)
```

### Font - JuliaMono

Note that when you run `notebooktolatex` without providing a `fontpath`,
Expand All @@ -96,10 +106,8 @@ At the moment, the available templates are:
### Plots and Images

At the moment, this package works with either `Makie.jl` (`CairoMakie.jl`)
and/or `Plots.jl`. These packages are actually dependencies, and they are used
and/or `Plots.jl`. These packages are incorporated via `Requires.jl`, and they are used
to save the plots from Pluto notebooks. This is not necessary for the Jupyter converter.
In a near future, I intend to create a separate package for each converter, and use
`NotebookToLatex.jl` as a main package containing both.

Also important to note is that, while notebooks are good at displaying `svg` images,
this is not the case with LaTeX, which handles `pdf` images better. Hence,
Expand Down
Loading