Opened 7 years ago

Last modified 2 years ago

#17939 new defect

SageTex sageplot giving oversized plots with default Debian pdflatex.

Reported by: anton_t Owned by:
Priority: minor Milestone: sage-6.6
Component: graphics Keywords: sagetex latex pdflatex debian
Cc: tmonteil, vdelecroix, dimpase, chapoton Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


As above.

After using the third possible way of getting latex to talk to sagetex from here:

The example code inside the sagetex folder produces a very ugly set of plots roughly twice the size of those shown here when :

Using: Sage Version 6.5, Release Date: 2015-02-17 from github. pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian)

If no one else can reproduce this but I will attach the produced pdf. This however also happened under regular latex in Debian.

Change History (6)

comment:1 Changed 7 years ago by anton_t

After some minor digging around it looks like line 97 of never evaluates to true and

opts = r'[width=.75\textwidth]'

is never run. Since the name of the variable is "t" and I'm not familiar with the code base around those parts I'm not too keep on trying to fix it myself, as just trying to see where else in the code 't' appears made my eyes bleed.

comment:2 Changed 6 years ago by slelievre

  • Cc tmonteil vdelecroix added
  • Keywords debian added

comment:3 Changed 6 years ago by kcrisman

Can you verify that this is only with Debian?

comment:4 Changed 5 years ago by kcrisman

See also #22499 which might make it easier to deal with such tickets.

comment:5 Changed 3 years ago by kcrisman

  • Cc dimpase chapoton added
  • Priority changed from major to minor

I seem to recall default image sizes getting a lot bigger a few years ago, but haven't seen any specific validation of this ticket. Certainly downgrading status as it is fairly easy (if tedious) to fix on an image-by-image basis.

comment:6 Changed 2 years ago by kcrisman

t is the list of matched tokens in a pyparsing result. So in principle, t.opts is the stuff in the first matching square brackets (if present) from a \sageplot command.

However, if you are right then maybe we need to change

sageplotparser = (r'\sageplot'
                 + Optional(squarebrackets)('opts')
                 + Optional(squarebrackets)('format')
                 + curlybrackets('code'))

to include the default in this part, rather than in the plot method

  def plot(self, s, l, t):
    self.plotn += 1
    if len(t.opts) == 0:
      opts = r'[width=.75\textwidth]'
      opts = t.opts[0]
    return (r'\includegraphics%s{sage-plots-for-%s.tex/plot-%s}' %
      (opts, self.fn, self.plotn - 1))

I'd want to test whether this is really being skipped but at any rate somewhere in here is where the fix would have to lie. Once we figure out whether this is an actual bug, we should report upstream.

By the way, the scripts dtx file is eminently readable!

Note: See TracTickets for help on using tickets.