Code Monkey home page Code Monkey logo

Comments (5)

gpoore avatar gpoore commented on August 19, 2024

There is an issue with Pygment's LaTeX formatter that prevents the upquote package from working since Pygments 1.6. I opened a Pygments issue nearly a year ago, but so far nothing has been done (although there are comments indicating some recent work).

When you say "(+ a small workaround)", I'm guessing you are doing something like this, redefining the quote character macro:

\def\PYZsq{\textquotesingle}

This approach doesn't work with the current alpha, because \PYZsq is now \PYG<style_name>Zsq. (Currently, a separate set of macros is created for each style, with the style in the name, since this allows formatting macros to be created only once, rather than on each use as in minted 1.7.) So for the alpha you would want something like this for the default style:

\def\PYGdefaultZsq{\textquotesingle}

If Pygments doesn't incorporate a fix soon, then I will probably hard-code one into minted as I try to close all open issues later this summer.

from minted.

jambonrose avatar jambonrose commented on August 19, 2024

Tim is actually waiting for me to fix the issue, but I got sidetracked by the RTF formatter and my own work. The pull request (#215) I submitted last year made too many changes, and was thus rejected. Sometime within the next month I will begin to make incremental changes to the LaTeX formatter, and upquote compatibility is early on the list of changes.

I will be posting changes to a wiki, and would love any help and feedback as I make these changes.

In short: a fix is on the way.

from minted.

alexpcoleman avatar alexpcoleman commented on August 19, 2024

You're exactly right regarding the "small workaround" I was using. I just
replaced it with your new, suggested one:

\def\PYGdefaultZsq{\textquotesingle}

and it's now working perfectly with minted 2.0a. Thanks!

On Wed, Jun 11, 2014 at 10:56 AM, Geoffrey Poore [email protected]
wrote:

There is an issue with Pygment's LaTeX formatter that prevents the upquote
package from working since Pygments 1.6. I opened a Pygments issue
https://bitbucket.org/birkenfeld/pygments-main/issue/889/single-quote-character-in-latex-formatter
nearly a year ago, but so far nothing has been done (although there are
comments indicating some recent work).

When you say "(+ a small workaround)", I'm guessing you are doing
something like this
http://tex.stackexchange.com/questions/46880/in-the-minted-package-how-do-i-enforce-straight-single-quotes/47451#47451,
redefining the quote character macro:

\def\PYZsq{\textquotesingle}

This approach doesn't work with the current alpha, because \PYZsq is now
\PYG<style_name>Zsq. (Currently, a separate set of macros is created for
each style, with the style in the name, since this allows formatting macros
to be created only once, rather than on each use as in minted 1.7.) So for
the alpha you would want something like this for the default style:

\def\PYGdefaultZsq{\textquotesingle}

If Pygments doesn't incorporate a fix soon, then I will probably hard-code
one into minted as I try to close all open issues later this summer.


Reply to this email directly or view it on GitHub
#34 (comment).

from minted.

gpoore avatar gpoore commented on August 19, 2024

@jambonrose Thanks for the update! Good to hear that progress is being made.

from minted.

gpoore avatar gpoore commented on August 19, 2024

I've just modified things so that if the upquote package is loaded, and the problematic Pygments macro is used, then minted will automatically patch the macro to \textquotesingle. This should make things much simpler.

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.