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

first attempt at PreTeXt conversion #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

davidfarmer
Copy link

Initial PreTeXt version is in the "ptx" directory.

Try compiling the HTML and check for systematic errors.

Errors that appear repeatedly can probably be fixed by re-doing the conversion.
Errors that appear only a few times should be fixed by hand after the automated phase
of the conversion is complete
.

You will probably find that the default settings for the HTML conversion are not
suitable for you. That is independent of the source markup.

@davidfarmer
Copy link
Author

I should have added: I can modify the conversion script to hard-code the numbers so that they
match the original book. But you will have to tell me how to do that. (That is: tell me how
the source markup should be done.)

@kyp44
Copy link
Owner

kyp44 commented Dec 5, 2019

Hi David, I finally had a chance to check this out. I am having trouble building the initial PreTeXt version, which most likely means that I am doing something stupid since I am completely inexperienced with PreTeXt.

I am trying to build from the ptx directory using the guide here. In particular, I've cloned the mathbook project and I'm running

xsltproc /path/to/mathbook/xsl/mathbook-html.xsl index.ptx

This generates index.html and article-1.html and I do get a warning about not having any sections, worksheets, or top-level paragraphs. However, when I open either of these in my browser (using Firefox if that's relevant) all it shows is the document title but no real content at all. If I run xsltproc on any of the other .ptx files in the same way it spits out a bunch of stuff and no files are generated. If I try building the LaTeX version of index.ptx per the guide above the .tex file is generated but it will not compile using pdflatex.

Am I doing something wrong here or is there a problem with the PreTeXt such that it's not generating any actual content?

@davidfarmer
Copy link
Author

davidfarmer commented Dec 5, 2019 via email

@kyp44
Copy link
Owner

kyp44 commented Dec 5, 2019

Turns out the main issue was missing the -xinclude option to xsltproc. I knew that /path/to/mathbook/xsl/mathbook-html.xsl should be the actual path, I just left that in there because where I put that isn't relevant. You have a good point though about generating the HTML output to it's own directory instead of mixing it all up with the .ptx XML files.

I did run into some issues with the LaTeX output (I wanted to see what that looked like). Most of the issues were some LaTeX commands I defined in my original manual that didn't make it into the converted version, which I was able to fix myself temporarily to at least get the LaTeX to compile.

I am already very impressed by the fidelity of this conversion and the PreTeXt output, both PDF and HTML. I did discover numerous issues with both output formats, but after seeing this I'm confident that PreTeXt will suite my needs for these solutions manuals, so I'm going to start investing time in learning PreTeXt so I can start resolving these issues.

@davidfarmer
Copy link
Author

davidfarmer commented Dec 5, 2019 via email

@kyp44
Copy link
Owner

kyp44 commented Dec 6, 2019

As I fix issues in the conversion (which won't' be for awhile because my time is currently pretty limited and I need to learn PreTeXt first!) I will make notes of the issues I found and feed these back to you to improve your conversion script as you will.
Also, as you mentioned before, once I learn some PreTeXt I'm happy to contribute back a bit and add a note in the Processing page in the guide about using the --xinclude option but I can't find the PreTeXt source for the guide, which I am guessing is in a GitHub repository. Can you link me to the project?

@davidfarmer
Copy link
Author

davidfarmer commented Dec 6, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants