AllenDowney / ThinkDSP

Think DSP: Digital Signal Processing in Python, by Allen B. Downey.
https://allendowney.github.io/ThinkDSP/
3.97k stars 3.23k forks source link

Can't run `make hevea` #39

Closed heyLu closed 5 years ago

heyLu commented 6 years ago

I wanted to build the HTML version of the book, to try and convert it into an EPUB version, but that failed with the following error (when running make hevea):

sed 's/\(figs\/[^.]*\).\(pdf\|png\)/\1.eps/' book.tex > thinkdsp.tex
rm -rf html
mkdir html
hevea -O -e latexonly htmlonly thinkdsp
Exclude comment 'comment'
/usr/lib/hevea/hyperref.hva:65: Warning: Ignoring option: 'bookmarks'
./thinkdsp.tex:68: Warning: Command not found: \topsep
./thinkdsp.tex:69: Warning: Command not found: \topsep
./thinkdsp.tex:5203: Warning: '_' occurring outside math mode
./thinkdsp.tex:5223: Warning: '_' occurring outside math mode
./thinkdsp.tex:5250: Warning: '_' occurring outside math mode
./thinkdsp.tex:5374: Warning: '_' occurring outside math mode
./thinkdsp.tex:5420: Warning: '_' occurring outside math mode
./thinkdsp.tex:5479: Warning: '_' occurring outside math mode
./thinkdsp.tex:5523: Warning: '_' occurring outside math mode
./thinkdsp.tex:5555: Warning: '_' occurring outside math mode
./thinkdsp.tex:5578: Warning: '_' occurring outside math mode
./thinkdsp.tex:6830: Warning: Command not found: \backmatter
HeVeA Warning: images may have changed, run 'imagen  thinkdsp'
thinkdsp.html:488:143: Warning, block level element: div nested inside text-level element
thinkdsp.html:488:142: This opening tag is pending
thinkdsp.html:748:143: Warning, block level element: div nested inside text-level element
thinkdsp.html:748:142: This opening tag is pending
thinkdsp.html:1093:143: Warning, block level element: div nested inside text-level element
thinkdsp.html:1093:142: This opening tag is pending
thinkdsp.html:2999:126: Parser error: Unexpected </span>
thinkdsp.html:3854:369: Lexer error: extract_tag
thinkdsp.html:3854:369: Lexer error: abstract_tag
grep -v latexonly thinkdsp.image.tex > a; mv a thinkdsp.image.tex
grep -v fancyhdr thinkdsp.image.tex > a; mv a thinkdsp.image.tex
imagen -png thinkdsp
RESOLUTION: 100
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Arch Linux) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./thinkdsp.image.tex
LaTeX2e <2017-04-15>
Babel <3.15> and hyphenation patterns for 84 language(s) loaded.
(/usr/share/texmf-dist/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/bk12.clo))
Runaway argument?
width=5.5in,height=8.5in, \newcommand {\theversion }{1.0.4} 
! Paragraph ended before \@fileswith@ptions was complete.
<to be read again> 
                   \par 
l.5 

? 
! Emergency stop.
<to be read again> 
                   \par 
l.5 

No pages of output.
Transcript written on thinkdsp.image.log.
This is dvips(k) 5.997 Copyright 2017 Radical Eye Software (www.radicaleye.com)
dvips: DVI file can't be opened: thinkdsp.image.dvi: No such file or directory
hacha thinkdsp.html
cp up.png next.png back.png html
mv index.html thinkdsp.css thinkdsp*.html  html
mv thinkdsp*.png *motif.gif html
mv: cannot stat 'thinkdsp*.png': No such file or directory
make: *** [Makefile:36: hevea] Error 1

As far as I can see, some command generates the thinkdsp.image.tex file, which starts as follows:

\newif\ifimagen\imagentrue
\documentclass[12pt]{book}
\usepackage[width=5.5in,height=8.5in,
\newcommand{\theversion}{1.0.4}

\pagestyle{empty}
\thispagestyle{empty}
\begin{document}
\newtheorem{exercise}{Exercise}[chapter]
\setcounter{chapter}{-1}

The \usepackage[width=5.5in,height=8.5in, command (line 3) looks wrong to me.

heyLu commented 6 years ago

I forgot to say: thanks for writing this book. It looks really good! ✨

AllenDowney commented 6 years ago

I think I know what the problem is here. I will fix it as soon as I can. Thank you!

klingtnet commented 6 years ago

Any news on this?

AllenDowney commented 6 years ago

It looks like the sed command in the Makefile isn't working. I should be able to fix it, but I'm afraid it might be a little while before I get to it.

On Wed, Feb 28, 2018 at 2:49 PM, Andreas Linz notifications@github.com wrote:

Any news on this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AllenDowney/ThinkDSP/issues/39#issuecomment-369360814, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy37Rgg6TiQOsLboiyfCSO1COh_w8CTks5tZa2ygaJpZM4R8vR1 .

klingtnet commented 6 years ago

Thank you for the update. You mean this one github.com/AllenDowney/ThinkDSP/blob/master/book/Makefile#L26 ?

AllenDowney commented 6 years ago

That is what I meant, but now that I look at it, I think it is not the problem.

Rather, I think the problem is caused by the line I just replaced:

https://github.com/AllenDowney/ThinkDSP/commit/3807c69eef451af26012f1690cb14f2a6273638d

Would you try the new version and let me know how it goes?

On Wed, Feb 28, 2018 at 4:42 PM, Andreas Linz notifications@github.com wrote:

Thank you for the update. You mean this one github.com/AllenDowney/ ThinkDSP/blob/master/book/Makefile#L26 ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AllenDowney/ThinkDSP/issues/39#issuecomment-369393090, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy37V5wobxH5YxBbGCSWcDK-n5uEY_uks5tZchHgaJpZM4R8vR1 .

klingtnet commented 6 years ago

Yeah, for sure. I will try it and let you if it worked.

klingtnet commented 6 years ago

Works like a charm now, thank you very much for you work!

AllenDowney commented 6 years ago

Glad I was able to help.

By the way, I am not super happy with hevea, because of hackery like this. I would be happy to find a better tool, if you have any suggestions.

klingtnet commented 6 years ago

For the curious reader, I used pandoc to generate an epub from the html output like this:

$ make -C book hevea && pushd book/html && pandoc thinkdsp.html -o ../../ThinkDSP.epub && popd
klingtnet commented 6 years ago

@AllenDowney I use pandoc for almost any kind of document format conversion, so maybe it will fit for this use case as well?