oscarlevin / discrete-book

An open textbook for Discrete Mathematics, as taught at the University of Northern Colorado
http://discrete.openmathbooks.org/dmoi3.html
Other
212 stars 67 forks source link

Build issues: File `latex-preamble-styles.tex' not found #125

Closed JL102 closed 2 years ago

JL102 commented 2 years ago

Hello,

I'm trying to run the build steps so I can fix some typos I've found and submit a PR with the fixes. Unfortunately, I'm getting the following errors:

! LaTeX Error: File `latex-preamble-styles.tex' not found.

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

If I press enter without typing anything, I get the same message once more. I pressed enter without typing anything again, and then:

Package hyperref Warning: Rerun to get /PageLabels entry.

Package pgfplots Warning: running in backwards compatibility mode (unsuitable t
ick labels; missing features). Consider writing \pgfplotsset{compat=1.18} into 
your preamble.
 on input line 2195.

! Package pdfpages Error: Cannot find file `images/front.pdf'.

See the pdfpages package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.2201 ...pdf[noautoscale=false]{images/front.pdf}
                                                  %
No pages of output.
Transcript written on dmoi.log.
critical: [Errno 2] No such file or directory: 'dmoi.pdf'
##################
Failed to build pdf.  Exiting...

----------------------------------------------------
While running pretext, the following errors occured:

critical: [Errno 2] No such file or directory: 'dmoi.pdf'
----------------------------------------------------
Exception ignored in atexit callback: <function exit_command at 0x7f37f3b00b80>
Traceback (most recent call last):
  File "/home/drak/.local/lib/python3.10/site-packages/pretext/utils.py", line 377, in exit_command
    sys.exit(1)
SystemExit: 1

It's also worth noting that when I try to run the command pretext build pdf -w as per the build instructions, I get the following error:

PreTeXt project found in `/home/drak/OneDrive/Projects/Programming/syncignore_discrete-book`.
Usage: pretext build [OPTIONS] [TARGET]
Try 'pretext build -h' for help.

Error: No such option: -w

so I'm just executing pretext build pdf to attempt the build.

I am using:

How do I fix these issues?

oscarlevin commented 2 years ago

Thanks for alerting me to this. There were a few changes I had to make to work with the updated version of PreTeXt, thanks to my previous hacking to customize things. I think I have it set up to work now. Please try to pull the latest commit and rebuild. Let me know how it goes.

JL102 commented 2 years ago

@oscarlevin The latex-preamble-styles.tex problem seems to be gone! But unfortunately the dmoi.pdf error is still there. This is the last bit of the build output:


! Package pdfpages Error: Cannot find file `external/images/front.pdf'.

See the pdfpages package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.2201 ...oscale=false]{external/images/front.pdf}
                                                  %
No pages of output.
Transcript written on dmoi.log.
critical: [Errno 2] No such file or directory: 'dmoi.pdf'
##################
Failed to build pdf.  Exiting...

----------------------------------------------------
While running pretext, the following errors occured:

critical: [Errno 2] No such file or directory: 'dmoi.pdf'
----------------------------------------------------
Exception ignored in atexit callback: <function exit_command at 0x7fd2d2ffcb80>
Traceback (most recent call last):
  File "/home/drak/.local/lib/python3.10/site-packages/pretext/utils.py", line 377, in exit_command
    sys.exit(1)
SystemExit: 1

Here's .error_schema.log:

/home/drak/OneDrive/Projects/Programming/syncignore_discrete-book/source/dmoi.ptx:4:0:ERROR:RELAXNGV:RELAXNG_ERR_ELEMWRONG: Did not expect element include there
/home/drak/OneDrive/Projects/Programming/syncignore_discrete-book/source/dmoi.ptx:4:0:ERROR:RELAXNGV:RELAXNG_ERR_EXTRACONTENT: Element pretext has extra content: include
JL102 commented 2 years ago

If I comment out line 4 of dmoi.pdf (<!-- <xi:include href="./bookinfo.ptx"/> -->), it seems to build... but only the first 18 pages?

image

oscarlevin commented 2 years ago

Aha. Yes, I was .gitignor-ing pdfs, and forgot to include those manually. I've updated it so now everything in the external directory (starting out in the assets directory) should be available to latex when you build. 🤞

JL102 commented 2 years ago

Eyyyy, it worked! The whole pdf built, thanks!

oscarlevin commented 2 years ago

Wonderful. Thanks for reporting this and making the project better.