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

[Todo] Generate PDF in pandoc/ubuntu-latex, missing package. #30

Closed
mittler-works opened this issue Jul 28, 2022 · 9 comments · Fixed by #36
Closed

[Todo] Generate PDF in pandoc/ubuntu-latex, missing package. #30

mittler-works opened this issue Jul 28, 2022 · 9 comments · Fixed by #36
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mittler-works
Copy link

I am currently trying to create a reproducible environment for converting this book to PDF using Docker. For this I use the script provided in ./bin/pdf.sh however I get this error message indicating a missing package or something:

xdvipdfmx:fatal: Cannot proceed without .vf or "physical" font for PDF output...

I am using the official pandoc/ubuntu-latex image. For testing purposes, I installed texlive-full (including texlive-fonts-*) as well as fonts-dejavu-* and some other packages inside of the container. But still no luck. Could you point out the packages needed to build this book as pdf?

Epub works just fine.

@CoMPaTech
Copy link
Contributor

I didn't spend any time on this when we (finally) converted it to markdown other than to make sure it was publishable as we now have on https://lpic2book.github.io/src/ - I included all that we had as scripts etc. for historical purposes but don't have the actual publishing pipeline setup requirements on hand, sorry.

https://www.linuxquestions.org/questions/showthread.php?p=6252065 contains some references to virtual fonts and how someone got it (partially) working - but we could also look at https://github.com/orzih/mkdocs-with-pdf or https://github.com/zhaoterryy/mkdocs-pdf-export-plugin within a container if that deems more useful?

@mittler-works
Copy link
Author

Thank you for the information! Building the whole thing via mkdocs seems to make sense to me, since that is also used in the workflow to generate the HTML for github pages, if I saw that correctly.
I'll take a closer look and come back with an MR when (if) I find a good solution.

In my opinion, it is nice to have the document also downloadable as PDF or epub. Perhaps such a solution could even be integrated into the workflow to automatically generate the assets for new releases as well.

By the way, thanks for publishing this book, it helps a lot in preparing for the LPIC exam! 🚀

@CoMPaTech
Copy link
Contributor

We used to have an epub/pdf published in both mobile platform stores but without proper maintenance that seemed less good of an idea, hence publishing it in the open for the community to improve and use. If (when) I have some spare time I can also take a look - let's leave this one open for someone to pick up, labelling accordingly.

@CoMPaTech CoMPaTech added enhancement New feature or request help wanted Extra attention is needed labels Jul 28, 2022
@CoMPaTech CoMPaTech changed the title Problems with the Converter Script for PDF [Todo] Generate PDF (of even epub) (was: Problems with the Converter Script for PDF) Jul 28, 2022
@stappersg stappersg changed the title [Todo] Generate PDF (of even epub) (was: Problems with the Converter Script for PDF) [Todo] Generate PDF in pandoc/ubuntu-latex, missing package. Oct 10, 2022
@stappersg
Copy link
Contributor

Thit comment is a note (context: my laptop with hostname trancilo)

stappers@trancilo:~/src/github/lpic2book
$ bin/pdf.sh
Error producing PDF.
! LaTeX Error: File `mathdesign.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 
         
l.85 \ifLuaTeX

stappers@trancilo:~/src/github/lpic2book
$ apt-file search mathdesign.sty
texlive-fonts-extra: /usr/share/texlive/texmf-dist/tex/latex/mathdesign/mathdesign.sty
texlive-latex-recommended: /usr/share/texlive/texmf-dist/tex/latex/lwarp/lwarp-mathdesign.sty
stappers@trancilo:~/src/github/lpic2book
$ sudo apt install texlive-fonts-extra
     ....

installing packge texlive-fonts-extra

stappers@trancilo:~/src/github/lpic2book
$ bin/pdf.sh

xdvipdfmx:fatal: Cannot proceed without .vf or "physical" font for PDF output...

No output PDF file written.
Error producing PDF.
! File ended while scanning use of \@writefile.
<inserted text> 
                \par 
l.92 \begin{document}

stappers@trancilo:~/src/github/lpic2book
$ 

Yes, original reported build failure is reproducable.

@stappersg
Copy link
Contributor

More text of the build failure:

(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))

LaTeX Font Warning: Font shape `TU/mdugm/m/n' undefined
(Font)              using `TU/lmr/m/n' instead on input line 186.

) (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/mathdesign/mdugm/t1mdugm.fd)))
(/tmp/tex2pdf.-5f4a40d326c3c96e/input.aux)
Runaway argument?
{\contentsline {subsection}{lsof}{12}{section*.21}\^^M
! File ended while scanning use of \@writefile.
<inserted text> 
                \par 
l.92 \begin{document}
                     
No pages of output.
Transcript written on /tmp/tex2pdf.-5f4a40d326c3c96e/input.log.

Error producing PDF.
! File ended while scanning use of \@writefile.
<inserted text> 
                \par 
l.92 \begin{document}

And yes, now I also outside my comfort zone.

@stappersg
Copy link
Contributor

Mmm, there is no cover.tex in the git repository.

But when I modify bin/pdf.sh to not use it,

--- a/bin/pdf.sh
+++ b/bin/pdf.sh
@@ -2,10 +2,10 @@
 
 cd docs &&
 pandoc --pdf-engine=xelatex \
+  --verbose \
   -V lang="en-us" -V babel-lang=english \
   -V 'mainfont:DejaVuSerif.ttf' \
          -V 'sansfont:DejaVuSans.ttf' \
          -V 'monofont:DejaVuSansMono.ttf' \
          -V 'mathfont:texgyredejavu-math.otf' \
-         --include-before-body cover.tex \
          --toc -s *.md   -t pdf -o  ../dist/lpic2.pdf

the error presists ...

@stappersg
Copy link
Contributor

It might a content problem, not a missing package problem. Anyway, there is now #32.

@CoMPaTech CoMPaTech linked a pull request Oct 10, 2022 that will close this issue
@stappersg
Copy link
Contributor

FWIW #34 is also about creating a .pdf.

@CoMPaTech
Copy link
Contributor

If someone's up for DTP-ing ... https://github.com/orzih/mkdocs-with-pdf has some options for styling the PDF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants