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

Separate PDF versions for python and julia cheatsheets #25

Open
mmcky opened this issue Nov 17, 2016 · 11 comments
Open

Separate PDF versions for python and julia cheatsheets #25

mmcky opened this issue Nov 17, 2016 · 11 comments

Comments

@mmcky
Copy link
Contributor

mmcky commented Nov 17, 2016

We may want to have separate PDF files for python and julia cheat sheets for download.

Focusing on html for now.

@vgregory757
Copy link
Contributor

We already have the pdfs from the original tex versions. Did you have in mind one created by Sphinx so we only have to edit the rsts?

@mmcky
Copy link
Contributor Author

mmcky commented Nov 17, 2016

Hi @vgregory757 I think we should probably embrace a full sphinx solution -- as the source is then in one place. This is a good point though -- an interim solution can use the pdf's constructed from the tex.

@jstac
Copy link
Contributor

jstac commented Jan 15, 2017

@vgregory757 @mmcky

Any progress here?

@vgregory757
Copy link
Contributor

I tried using Sphinx to build the latex/pdf files for these and I get all sorts of latex errors from the .tex files it makes. It doesn't seem to like the matrices in particular. If I ignore the errors, the parts of the tables that didn't have errors look good in general. But I'm not sure if the errors are coming from something we did wrong in the .rsts or because Sphinx just doesn't play well with the combination of latex + tables + math.

@mmcky
Copy link
Contributor Author

mmcky commented Jan 16, 2017

@vgregory757 do you think you might have some time to review the generated latex file and then modify the latex code to produce the matrices etc? We could then use this template to modify the LaTeX writer in sphinx to generate what we want as a finished product.

@vgregory757
Copy link
Contributor

@mmcky Sure thing, I'll see if I can get it to look nice.

@mmcky
Copy link
Contributor Author

mmcky commented Jan 17, 2017

Thanks @vgregory757. That would be great.

Note: The way sphinx does syntax highlighting for LaTeX isn't great using lots of \PYG{} markers etc. My advice would be to try and work around that to begin with (i.e. leave the wrapped markup) and see if the matrix infrastructure will work around that. Otherwise we could move towards using minted for syntax highlighting in the LaTeX.

@vgregory757
Copy link
Contributor

@mmcky I cleaned up the generated tex version for the Julia sheet and put it in the main folder.

I wasn't having any problems with the \PYG{} markers. To get the matrices to work, I just got rid of the gather and split environments that Sphinx created around them and put them around dollar signs instead. Other major changes were using longtable instead of tabular so that the tables didn't run off the page, and getting rid of the description environments because they caused some funny looking indenting and caused some of the text to run off the page.

Does this help/look nice?

@mmcky
Copy link
Contributor Author

mmcky commented Jan 18, 2017

Great. Thanks @vgregory757. I can't compile the updated tex because it needs a cls file and if I run make latex then I think it will overwrite your changes etc.

Can I suggest we move the manually edited tex file into a folder julia-manual and including all the files needed to run pdflatex?

@vgregory757
Copy link
Contributor

@mmcky Done. If you run make latex it'll only write to the _build folder. The new julia-manual folder includes the cls files and others you need to compile taken from the _build folder, and the tex file in this folder is the one that was modified by me. The original one created by Sphinx will show up in the _build folder.

@mmcky
Copy link
Contributor Author

mmcky commented Jan 18, 2017

Thanks @vgregory757. I think this looks nice. Now we will have to teach sphinx how to make that LaTeX :)

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

No branches or pull requests

3 participants