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

Rethink the cairosvg dependency #107

Merged
merged 3 commits into from
May 14, 2021
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
2 changes: 1 addition & 1 deletion docs/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ @book{orwell1945animal
}

@book{orwell1949nineteen,
title={Nineteen eighty-four: a novel},
title={{Nineteen eighty-four: a novel}},
author={George Orwell},
year={1949},
publisher={Secker & Warburg}
Expand Down
3 changes: 1 addition & 2 deletions docs/contents/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ _gen/my_data_mean-sco.md
Conversions for Gadfly are also included, see @fig:example_plot.
This is actually a bit tricky, because we want to show vector graphics (SVG) on the web, but these are not supported (well) by LaTeX.
Therefore, portable network graphics (PNG) images are passed to LaTeX via cairosvg;
I found that this tool does the best conversions without relying on Cairo.jl.
(Cairo.jl doesn't work for me on NixOS.)
I found that this tool does the best conversions without relying on Cairo and/or Fontconfig, which are not so stable in combination with Compose in my experience.

```{.include}
_gen/example_plot-sco.md
Expand Down
4 changes: 2 additions & 2 deletions docs/src/includes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ function multiple_df_example()
end

sum_example() = code("""
a = 3
b = 4
a = 2
b = 3

a + b
""")
Expand Down
2 changes: 2 additions & 0 deletions src/outputs/compose.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ function convert_gadfly_output(path, out;
svg_filename = "$file.svg"
svg_path = joinpath(im_dir, svg_filename)
write_svg(svg_path, out, width, height)

png_filename = "$file.png"
png_path = joinpath(im_dir, png_filename)
svg2png(svg_path, png_path)

im_link = joinpath("im", svg_filename)
caption, label = caption_label(path, caption, label)
pandoc_image(file, png_path; caption, label)
Expand Down