Help adding jekyll-latex gem #2760
-
Hi, I recently started using al-foilo, and I am loving it! I wanted to add latex support using jekyll-latex (https://github.com/mhartl/jekyll-latex). To do so, I added "gem 'jekyll-latex' " to the Gemfile, and removed the Gemfile.lock from the dockerfile (forcing the use of Gemfile). However, when starting the local server, it hangs on the line.
I tried to debug the issue. Removing the lock does not seem to be the issue, as if I remove the jekyll-latex package everything seems to work fine. But after a few tests I got stuck. Does anyone have ideas on what is going wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
We already support latex equations on our template, check the demo post. Is there any reason the current solution doesn't work for you? |
Beta Was this translation helpful? Give feedback.
-
Hi George,
Thanks a lot for the reply.
I had seen this demo before. My issue is that I almost 'have’ to write notes in latex to share with collaborators/ print them to students, or just to have them in a nice pdf file. I could we-write them in a .md file, but that is somewhat time-consuming…
I was thus looking into a way of adding these to my al-folio page (still in dev) automatically. I tried pan-doc to convert .tex file to .md, but that required a lot of manual corrections as well. I considered compiling the pdf into a html, which works, but I ended up with a page with a completely different layout than the rest of the site, or just uploading the pdf file, which honestly works, but feels not ideal.
Well, this is the context for why I was trying the latex plug-in for Jekyll :) But if you have any other suggestion on how I can integrate these notes into the website I will be happy to hear them!
Thanks again,
Eduardo
… Le 16 oct. 2024 à 03:57, George ***@***.***> a écrit :
We already support latex equations on our template, check the demo post <https://alshedivat.github.io/al-folio/blog/2015/math/>. Is there any reason the current solution doesn't work for you?
—
Reply to this email directly, view it on GitHub <#2760 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQXUUFS7XUBMEGBSQY7SHYLZ3XBXFAVCNFSM6AAAAABPW3LJNOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJVGM4TINA>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
So, that is what I am doing.
In the Gemfile, I added
gem 'jekyll-latex'
I also removed Gemfile.lock (and the corresponding line in Dockerfile that adds it to the container). I then forced the container recreation with
docker compose up --build --force-recreate
Starting up the container, I get the following
Attaching to jekyll-1
jekyll-1 | Resolving dependencies...
jekyll-1 | /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/runtime.rb:299:in `check_for_activated_spec!': You have already activated json 2.7.1, but your Gemfile requires json 2.3.1. Since json is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports json as a default gem. (Gem::LoadError)
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/runtime.rb:25:in `block in setup'
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/spec_set.rb:191:in `each'
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/spec_set.rb:191:in `each'
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/runtime.rb:24:in `map'
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/runtime.rb:24:in `setup'
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler.rb:164:in `setup'
jekyll-1 | from /usr/local/bundle/gems/jekyll-4.3.4/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
jekyll-1 | from /usr/local/bundle/gems/jekyll-4.3.4/exe/jekyll:11:in `<top (required)>'
jekyll-1 | from /usr/local/bundle/bin/jekyll:25:in `load'
jekyll-1 | from /usr/local/bundle/bin/jekyll:25:in `<main>'
but then the container just hangs there… (even without adding the jekyll-latex plugin to _config.yml)
Removing the Jekyll-latex gem from the Gemfile, and following the same steps, I get a working container.
… Le 16 oct. 2024 à 15:52, George ***@***.***> a écrit :
I am not sure that jekyll-latex will generate a perfect version either, but it is worth a try. Can you paste your complete stacktrace?
—
Reply to this email directly, view it on GitHub <#2760 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQXUUFRIGQ5FAFXOV6HMM2LZ3ZVRVAVCNFSM6AAAAABPW3LJNOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJWGAZTMMQ>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
The Dockerfile already had a line
RUN gem install jekyll bundler
which I assume installs jekyll and blunder. Nevertheless I added
RUN gem install bundler
before the line above, but still got the same result…
… Le 17 oct. 2024 à 15:55, George ***@***.***> a écrit :
or try updating to a newer version of bundler
Try to update your bundler installation by adding gem install bundler to your Dockerfile. See if that fixes it.
—
Reply to this email directly, view it on GitHub <#2760 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQXUUFTRM66E4BROACWPZLLZ366UFAVCNFSM6AAAAABPW3LJNOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJXGIYTANI>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
No worries :)
I removed jekyll-minifier, but still get the exact same output
Attaching to jekyll-1
jekyll-1 | Resolving dependencies...
jekyll-1 | /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/runtime.rb:299:in `check_for_activated_spec!': You have already activated json 2.7.1, but your Gemfile requires json 2.3.1. Since json is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports json as a default gem. (Gem::LoadError)
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/runtime.rb:25:in `block in setup'
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/spec_set.rb:191:in `each'
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/spec_set.rb:191:in `each'
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/runtime.rb:24:in `map'
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler/runtime.rb:24:in `setup'
jekyll-1 | from /usr/local/bundle/gems/bundler-2.5.22/lib/bundler.rb:164:in `setup'
jekyll-1 | from /usr/local/bundle/gems/jekyll-4.3.4/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
jekyll-1 | from /usr/local/bundle/gems/jekyll-4.3.4/exe/jekyll:11:in `<top (required)>'
jekyll-1 | from /usr/local/bundle/bin/jekyll:25:in `load'
jekyll-1 | from /usr/local/bundle/bin/jekyll:25:in `<main>'
I am starting to suspect that it is a jekyll-latex issue...
… Le 17 oct. 2024 à 19:28, George ***@***.***> a écrit :
Hmmm I missed that =P
When adding to the Gemfile you should also add the plugin to _config.yml.
Now, this seems to be a tricky fix with dependencies versions. I just went through our commit history and found out that 40505f4 <40505f4> introduced the jekyll-get-json dependency, which might be causing this issue for you (either this one or 503bfc2 <503bfc2> which added jekyll-minifier, but this one is needed).
Looking at jekyll-get-json.gemspec <https://github.com/brockfanning/jekyll-get-json/blob/master/jekyll-get-json.gemspec> it doesn't seem to include anything json-related.
Looking at jekyll-minifier.gemspec <https://github.com/digitalsparky/jekyll-minifier/blob/78245699ec6fa3c208d7902fd71f3ff89dcf3c03/jekyll-minifier.gemspec#L33> it includes gem.add_dependency "json-minify", "~> 0.0.3", which in turn adds spec.add_dependency 'json', '> 0' in its json-minify.gemspec <https://github.com/geoffyoungs/json-minify-rb/blob/531d6f9e75140989d267105f0f4a4dc4294f2b21/json-minify.gemspec#L24>.
Maybe try removing jekyll-minifier to see if it solves for you, and the corresponding parts from _config.yml.
—
Reply to this email directly, view it on GitHub <#2760 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQXUUFXEYSMKEOASZ6TFO7LZ37XU5AVCNFSM6AAAAABPW3LJNOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJXGQ2TKMQ>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
I will do that.
Thanks a lot for the attention!!!
… Le 17 oct. 2024 à 20:05, George ***@***.***> a écrit :
Try opening an issue there, see if the developer can help you with this.
—
Reply to this email directly, view it on GitHub <#2760 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQXUUFXNBT4PXCNQQ7WFB4LZ3734ZAVCNFSM6AAAAABPW3LJNOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJXGQ4DQNI>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
A quick follow-up. I reached out to the developer, he updated the plugin, and now it works smoothly!