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

Update base.tex.j2 for macro compatibility with newer versions of Pandoc #2196

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

Conversation

PetalAdrift
Copy link

Added the macro \pandocbounded that is used by newer versions of pandoc.

Added the macro \pandocbounded that is used by newer versions of pandoc.
@PetalAdrift
Copy link
Author

Sorry about closing the previous PR on accident. Opened a new one.

@krassowski krassowski linked an issue Jan 2, 2025 that may be closed by this pull request
@krassowski
Copy link
Member

@PetalAdrift thank you! How can we test this PR? Is there a test that you could add to ensure this is tested on CI?

@PetalAdrift
Copy link
Author

@krassowski Sorry, I am not too familiar with the terminology (or Git, actually). Is there a link to relevant documentation on tests used for nbconvert?

@krassowski
Copy link
Member

It may not be much but:

@gabemorris12
Copy link

When is this going to be implemented? It's been months, and nbconvert for latex still only works with pandoc 3.2 or older.

@PetalAdrift
Copy link
Author

For now you can just make the change to your files locally.

@gabemorris12
Copy link

For now you can just make the change to your files locally.

That is fine for me, but I have about a hundred students each semester that have to setup jupyter to successfully convert a notebook to a pdf via latex. I'd hate to redo my setup process only for the solution to finally have been implemented later.

@PetalAdrift
Copy link
Author

I guess one solution is to just just pandoc. It doesn't look as nice (subjective opinion), but it gets the job done.

@ChristofKaufmann
Copy link

@PetalAdrift Maybe I can help a bit to write a simple test. I have not tried it, but you would have to add in tests/exporters/test_latex.py a function like:

    @onlyif_cmds_exist("pandoc")
    def test_template_contains_pandocbounded(self):
        """
        Does the template contain the pandocbounded command for compatibility with pandoc >= 3.2.1?
        """
        (output, resources) = LatexExporter().from_filename(self._get_notebook())
        assert r"\newcommand*\pandocbounded" in output

Either follow the instructions to test it locally before committing or commit and let CI test it. In the CI test output, you should see about here a new test named test_template_contains_pandocbounded.

@krassowski Would that simple test be enough for you? It is actually just testing that the code, which this PR adds, is there. So it does not make much sense. Maybe it would be better to add e.g. \pandocbounded{check} in rawtest.ipynb and try to compile it with a new test in test_pdf.py . What is your opinion?

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

Successfully merging this pull request may close these issues.

Incompatibility issue with latest version of pandoc
4 participants