Before I submit a paper, and for our internal review, I need to have something that looks pretty. My internal reviewers are going to balk at printing out a .md file and reviewing that. What is the workflow that is used to bake the PDF ? Something pandoc-y? Or LaTeX-y?
It would be cool if that was described on the website since that is something that I guess several people will wonder about. I've got a publication I am getting ready to submit in the next week or three.
according to @arfon in https://github.com/openjournals/joss-reviews/issues/456
Yes, there is a way to run locally. You need to download and install the Whedon gem (or Pandoc etc locally).
And I agree it would make sense to put this in the documentation somewhere...
Hmm... I tried running the pandoc stuff directly without whedon (I don't usually use ruby but I can figure it out if I must), but the latex template seems to not get populated properly. And thus, the pandoc build fails because paths are empty.
A mini-tutorial on how to use the whedon stuff would be great. I'm an experienced C++/python/... developer, but not an expert in ruby.
I added the latex.template to my repo (commenting out the image) for local test compilation:
https://github.com/openclimatedata/pymagicc/tree/master/paper
@rgieseke is working through getting this running locally here which should hopefully form the basis of some future docs... 😁
I tried to run that directly in windows with pandoc, but no dice:
D:\NIST\Papers\In Progress\JOSS -ChebTools>pandoc --filter pandoc-citeproc --bibliography paper.bib paper.md --template latex.template -o paper.pdf
! pdfTeX error (font expansion): auto expansion is only possible with scalable
fonts.
\@EveryShipout@Output ...@Org@Shipout \box \@cclv
l.239 \end{document}
pandoc: Error producing PDF from TeX source
I’ll keep digging…
I tried also on an updated ubuntu box with a newer pandoc, cloning the repo and trying to build with
git clone https://github.com/openclimatedata/pymagicc.git
cd pymagicc/paper/
make
and I got the following error:
pandoc --filter pandoc-citeproc --bibliography paper.bib paper.md \
--template latex.template -o paper.pdf
! Font T1/cmr/m/n/10=ecrm1000 at 10.0pt not loadable: Metric (TFM) file not fou
nd.
<to be read again>
relax
l.105 \fontencoding\encodingdefault\selectfont
pandoc: Error producing PDF
Makefile:4: recipe for target 'paper.pdf' failed
make: *** [paper.pdf] Error 43
@ibell - can you take a look at https://github.com/openjournals/whedon/issues/17 and see if that helps? The LaTeX template isn't (currently) really designed to be run outside of the main environment.
@ibell - in both variants you will need both LaTeX and Pandoc and Pandoc-Citeproc properly installed.
Maybe
sudo apt-get install texlive-fonts-recommended
would help?
Basically, I have to keep development off public github until the manuscript is approved, so I can't use the complete whedon system. An alternative solution is most welcomed.
Installed texlive-fonts-recommended, different error:
pandoc --filter pandoc-citeproc --bibliography paper.bib paper.md \
--template latex.template -o paper.pdf
! pdfTeX error (font expansion): auto expansion is only possible with scalable
fonts.
\@EveryShipout@Output ...@Org@Shipout \box \@cclv
l.249
pandoc: Error producing PDF
Makefile:4: recipe for target 'paper.pdf' failed
make: *** [paper.pdf] Error 43
Ok, that looks like the same error message as @ianhbell's above.
Basically, I have to keep development off public github until the manuscript is approved, so I can't use the complete whedon system. An alternative solution is most welcomed.
@ibell Whedon would produce your file locally as well, however it might be useful to have a simple local setup.
A first step should be trying to run
pandoc paper.md -o paper.pdf
This should give you a LaTeX default themed version of your paper. It requires that you have a LaTeX version and Pandoc installed. If there are error messages like above, there are likely missing packages, which you hopefully can find by searching for the error message, for example this suggest that 'cm-super' might be missing: https://tex.stackexchange.com/questions/10706/pdftex-error-font-expansion-auto-expansion-is-only-possible-with-scalable
There might also be option to do a "full" install, depending on your TeX distribution.
Once you have this running you can try running it with pandoc-citeproc to get the bibliography setup:
pandoc paper.md --filter pandoc-citeproc --bibliography paper.bib -o paper.pdf
This should already be good enough for passing around to colleagues.
This should already be good enough for passing around to colleagues.
👍 thanks @rgieseke
So this worked locally with Homebrew installed Ruby etc.
Trying again to get this running on Ubuntu, with a clean checkout this seems to work now without missing libraries, not sure what I had messed up earlier:
bundle install --path vendor/bundle
Adjusting .env with key from GitHub.
bundle exec whedon reviews
However,
bundle exec whedon prepare 502
fails with:
/usr/lib/ruby/2.3.0/find.rb:43:in `block in find': No such file or directory (Errno::ENOENT)
from /usr/lib/ruby/2.3.0/find.rb:43:in `collect!'
from /usr/lib/ruby/2.3.0/find.rb:43:in `find'
from /home/robert/sources/whedon/lib/whedon/processor.rb:49:in `find_paper_paths'
from /home/robert/sources/whedon/bin/whedon:32:in `prepare'
from /home/robert/sources/whedon/vendor/bundle/ruby/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /home/robert/sources/whedon/vendor/bundle/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /home/robert/sources/whedon/vendor/bundle/ruby/2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /home/robert/sources/whedon/vendor/bundle/ruby/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /home/robert/sources/whedon/bin/whedon:99:in `<top (required)>'
from /home/robert/sources/whedon/vendor/bundle/ruby/2.3.0/bin/whedon:22:in `load'
from /home/robert/sources/whedon/vendor/bundle/ruby/2.3.0/bin/whedon:22:in `<main>'
@ibell and @ianhbell are both me - one for work, one for not-work. Sorry for the confusion.
I was able to get a reasonable LaTeX output with
pandoc --filter pandoc-citeproc --bibliography paper.bib paper.md -o paper.pdf
which will suffice for my testing needs.
@arfon The instructions for local building should probably be added in the author's guidelines? Would that be in _paper_contents.html.erb? Or should it go somewhere else?
This recently came up here (https://github.com/openjournals/joss/issues/379#issuecomment-362362109), which looks like a more feature-full preview than last suggested in this issue
Most helpful comment
Ok, that looks like the same error message as @ianhbell's above.
@ibell Whedon would produce your file locally as well, however it might be useful to have a simple local setup.
A first step should be trying to run
This should give you a LaTeX default themed version of your paper. It requires that you have a LaTeX version and Pandoc installed. If there are error messages like above, there are likely missing packages, which you hopefully can find by searching for the error message, for example this suggest that 'cm-super' might be missing: https://tex.stackexchange.com/questions/10706/pdftex-error-font-expansion-auto-expansion-is-only-possible-with-scalable
There might also be option to do a "full" install, depending on your TeX distribution.
Once you have this running you can try running it with
pandoc-citeprocto get the bibliography setup:This should already be good enough for passing around to colleagues.