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

PDF images for latex & PNG images for html #78

Open
GJBoth opened this issue Oct 8, 2018 · 0 comments
Open

PDF images for latex & PNG images for html #78

GJBoth opened this issue Oct 8, 2018 · 0 comments

Comments

@GJBoth
Copy link

GJBoth commented Oct 8, 2018

Hi everyone,
I've found a (admitted, rather crude) way to include pdf images for latex files and png's for html files. It's pretty redneck engineering right now, but it does what it need to. Basically I create two figure subdirectories, one called 'pdf' and one called 'png'. Place your respective images in each, with the same filename. The makefile below than copies your source directory, find and replaces pdf to png using sed and copies everything to the right directory.

rm -rf "$(INPUTDIR)"/html/ mkdir "$(INPUTDIR)"/html/ cp "$(INPUTDIR)"/*.md "$(INPUTDIR)"/html/ sed -i "" "s/pdf/png/g" "$(INPUTDIR)"/html/*.md pandoc "$(INPUTDIR)"/html/*.md \ -o "$(OUTPUTDIR)/thesis.html" \ --standalone \ --template="$(STYLEDIR)/template.html" \ --bibliography="$(BIBFILE)" \ --csl="$(STYLEDIR)/ref_format.csl" \ --include-in-header="$(STYLEDIR)/style.css" \ --toc \ --number-sections\ --mathjax rm -rf "$(OUTPUTDIR)/source/figures" mkdir "$(OUTPUTDIR)/source/figures" cp -r "$(INPUTDIR)/figures/png" "$(OUTPUTDIR)/source/figures" rm -rf "$(INPUTDIR)"/html/

I'm not that great with git yet, so not sure how to do a pull request, sorry. Also, people more familiar with sed, please let me know how to make the replacement more robust!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant