Giter Site home page Giter Site logo

Comments (6)

gpoore avatar gpoore commented on August 28, 2024

I suspect that this is due to using \mintinline inside \section with

\hypertarget{if-statements}{%
\section{\texorpdfstring{\mintinline[]{text}{if}
statements}{ statements}}\label{if-statements}}

and

\hypertarget{else-statements}{%
\section{\texorpdfstring{\mintinline[]{text}{else}
statements}{ statements}}\label{else-statements}}

Swapping \mintinline for \Verb{if} and \Verb{else} works for me. \Verb is defined by fvextra, and \mintinline uses fvextra internally so I would have expected both to behave identically, but apparently something is different in this case.

from minted.

mattharrison avatar mattharrison commented on August 28, 2024

Thanks for the response. Any indication why commenting out non-section code allows it to work in sections?

from minted.

gpoore avatar gpoore commented on August 28, 2024

My guess is that the section code (which is interacting with the table of contents) fails to open or more likely fails to close a sequence of commands (basically equivalent to an environment that isn't properly closed), and then the unopened/unclosed state is fixed if the right sequence of non-section code appears later in the document. However, given the state of LaTeX error messages, it can be nearly impossible to track down the details of what is happening in some of these cases. I think I found multiple parts of the document that when removed allowed it to compile successfully.

The last minted release (2.7) reimplemented \mintinline so that it would work better inside other commands, like \section. However, since \Verb works here and \mintinline doesn't, there may be some remaining issues. Unless there is a totally separate, unrelated bug or issue that we're both missing that is causing this. At least from the minted side, the \mintinline in sections is the only thing that seems potentially problematic here, and switching to \Verb does work.

from minted.

mattharrison avatar mattharrison commented on August 28, 2024

I'm using pandoc and pandoc-minted. So I removed any mintinline creations from the pandoc-minted plugin.

After jumping through another hoop ( https://tex.stackexchange.com/questions/176113/problem-with-in-pdf-bookmark-under-xelatex ) I appear to be creating PDFs again. Thanks for your help.

from minted.

gpoore avatar gpoore commented on August 28, 2024

I've done some additional experiments, and it appears that memoir redefines \section so that it is incompatible with \mintinline (but only in some situations). Please leave this issue open for now.

  • The documentation for \mintinline needs a note that it may not work inside \section etc. when using some document classes.
  • It may be worth creating an option that causes \mintinline to behave like \Verb when used inside other commands like \section.

from minted.

mattharrison avatar mattharrison commented on August 28, 2024

from minted.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.