From: John H. <jd...@gm...> - 2008-06-12 14:20:20
|
On Wed, Jun 11, 2008 at 4:00 PM, John Hunter <jd...@gm...> wrote: > ! LaTeX Error: Command \Cap already defined. > Or name \end... illegal, see p.192 of the manual. This may have been obvious to all of you,but I am just discovering it. The problem is that *sphinx* is defining \Cap as a color, and this is clashing with the ams name. From Matplotlib.tex:: \newcommand\Car[1]{\textcolor[rgb]{0.73,0.38,0.84}{#1}} \newcommand\Caq[1]{\textcolor[rgb]{0.38,0.68,0.84}{#1}} \newcommand\Cap[1]{\textcolor[rgb]{0.78,0.36,0.04}{#1}} \newcommand\Caw[1]{\textcolor[rgb]{0.13,0.50,0.31}{#1}} but I haven't yet found the file which is adding this. This looks like a docutils/sphinx bug. JDH JDH |
From: Michael D. <md...@st...> - 2008-06-12 14:25:24
|
Interestingly, sphinx *doesn't* define it for me. One of the first things I did was "grep Cap" on the latex build directory. I updated sphinx from SVN pretty recently... I wonder if that has anything to do with it. If that doesn't fix it, yes, that sounds like something to report. Cheers, Mike John Hunter wrote: > On Wed, Jun 11, 2008 at 4:00 PM, John Hunter <jd...@gm...> wrote: > > >> ! LaTeX Error: Command \Cap already defined. >> Or name \end... illegal, see p.192 of the manual. >> > > This may have been obvious to all of you,but I am just discovering it. > The problem is that *sphinx* is defining \Cap as a color, and this is > clashing with the ams name. From Matplotlib.tex:: > > \newcommand\Car[1]{\textcolor[rgb]{0.73,0.38,0.84}{#1}} > \newcommand\Caq[1]{\textcolor[rgb]{0.38,0.68,0.84}{#1}} > \newcommand\Cap[1]{\textcolor[rgb]{0.78,0.36,0.04}{#1}} > \newcommand\Caw[1]{\textcolor[rgb]{0.13,0.50,0.31}{#1}} > > but I haven't yet found the file which is adding this. This looks > like a docutils/sphinx bug. > > JDH > JDH > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
From: Michael D. <md...@st...> - 2008-06-12 14:34:41
|
It appears to be Pygments (source code highlighter) that produces these lines. I have Pygments 0.10 which "works for me" (TM). pygments/formatters/latex.py 158: cmndef = r'\textcolor[rgb]{%s}{%s}' % ( Cheers, Mike Michael Droettboom wrote: > Interestingly, sphinx *doesn't* define it for me. One of the first > things I did was "grep Cap" on the latex build directory. > I updated sphinx from SVN pretty recently... I wonder if that has > anything to do with it. If that doesn't fix it, yes, that sounds like > something to report. > > Cheers, > Mike > > John Hunter wrote: >> On Wed, Jun 11, 2008 at 4:00 PM, John Hunter <jd...@gm...> wrote: >> >> >>> ! LaTeX Error: Command \Cap already defined. >>> Or name \end... illegal, see p.192 of the manual. >>> >> >> This may have been obvious to all of you,but I am just discovering it. >> The problem is that *sphinx* is defining \Cap as a color, and this is >> clashing with the ams name. From Matplotlib.tex:: >> >> \newcommand\Car[1]{\textcolor[rgb]{0.73,0.38,0.84}{#1}} >> \newcommand\Caq[1]{\textcolor[rgb]{0.38,0.68,0.84}{#1}} >> \newcommand\Cap[1]{\textcolor[rgb]{0.78,0.36,0.04}{#1}} >> \newcommand\Caw[1]{\textcolor[rgb]{0.13,0.50,0.31}{#1}} >> >> but I haven't yet found the file which is adding this. This looks >> like a docutils/sphinx bug. >> >> JDH >> JDH >> > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
From: John H. <jd...@gm...> - 2008-06-12 14:35:20
|
On Thu, Jun 12, 2008 at 9:25 AM, Michael Droettboom <md...@st...> wrote: > Interestingly, sphinx *doesn't* define it for me. One of the first things I > did was "grep Cap" on the latex build directory. > I updated sphinx from SVN pretty recently... I wonder if that has anything > to do with it. If that doesn't fix it, yes, that sounds like something to > report. The sphinx highlighting module uses pygments.formatters.latex.LatexFormatter which cycles through letters using a command prefix which defaults to 'C' def _create_stylecmds(self): t2c = self.ttype2cmd = {Token: ''} c2d = self.cmd2def = {} cp = self.commandprefix letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' first = iter(letters) second = iter(letters) firstl = first.next() In sphinx.highlighting, I can override this default with commandprefix='PYGC' and get the build to work, class PygmentsBridge(object): def __init__(self, dest='html', stylename='sphinx'): self.dest = dest if not pygments: return if stylename == 'sphinx': style = SphinxStyle elif '.' in stylename: module, stylename = stylename.rsplit('.', 1) style = getattr(__import__(module, None, None, ['']), stylename) else: style = get_style_by_name(stylename) self.hfmter = {False: HtmlFormatter(style=style), True: HtmlFormatter(style=style, linenos=True)} self.lfmter = {False: LatexFormatter(style=style, commandprefix='PYGC'), True: LatexFormatter(style=style, linenos=True, commandprefix='PYGC')} |
From: Michael D. <md...@st...> - 2008-06-12 14:52:58
|
Johann Cohen-Tanugi wrote: > Personnally I get: > build/latex/Matplotlib.tex:$\Cap$ \code{\textbackslash{}Cap} That's a usage, not a definition. The problem is related to duplicate definitions of \Cap. > but I have sphinx 0.3 which is the version easy_installed on my FC8 > box. Actually I wonder how much trouble this 0.3 version is a promise > of..... Eventually, we'll have to track down and document which versions of sphinx, docutils and pygments work to build the matplotlib documentation. There's a lot of moving parts here... Cheers, Mike > Johann > > > Michael Droettboom wrote: >> Interestingly, sphinx *doesn't* define it for me. One of the first >> things I did was "grep Cap" on the latex build directory. >> I updated sphinx from SVN pretty recently... I wonder if that has >> anything to do with it. If that doesn't fix it, yes, that sounds >> like something to report. >> >> Cheers, >> Mike >> >> John Hunter wrote: >> >>> On Wed, Jun 11, 2008 at 4:00 PM, John Hunter <jd...@gm...> wrote: >>> >>> >>>> ! LaTeX Error: Command \Cap already defined. >>>> Or name \end... illegal, see p.192 of the manual. >>>> >>> This may have been obvious to all of you,but I am just discovering it. >>> The problem is that *sphinx* is defining \Cap as a color, and this is >>> clashing with the ams name. From Matplotlib.tex:: >>> >>> \newcommand\Car[1]{\textcolor[rgb]{0.73,0.38,0.84}{#1}} >>> \newcommand\Caq[1]{\textcolor[rgb]{0.38,0.68,0.84}{#1}} >>> \newcommand\Cap[1]{\textcolor[rgb]{0.78,0.36,0.04}{#1}} >>> \newcommand\Caw[1]{\textcolor[rgb]{0.13,0.50,0.31}{#1}} >>> >>> but I haven't yet found the file which is adding this. This looks >>> like a docutils/sphinx bug. >>> >>> JDH >>> JDH >>> >> >> -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
From: John H. <jd...@gm...> - 2008-06-12 14:58:26
|
On Thu, Jun 12, 2008 at 9:52 AM, Michael Droettboom <md...@st...> wrote: > Eventually, we'll have to track down and document which versions of sphinx, > docutils and pygments work to build the matplotlib documentation. There's a > lot of moving parts here... Documenting is good, and I don't mind requiring updated versions of everything, or even svn for now, to get the docs to build. I consider these to be development/bleeding edge only, and don't want to announce them to the user community until we have a reasonably complete set of docs. But having a documented combination that works in the dev guide would be useful. |
From: Johann Cohen-T. <co...@sl...> - 2008-06-12 15:00:59
|
right, I agree : I tried because I did not know for sure whether it would work or not, and because that was post-lunch time :) .... Looks like bleeding edge sphinx is not required seemingly! Johann John Hunter wrote: > On Thu, Jun 12, 2008 at 9:52 AM, Michael Droettboom <md...@st...> wrote: > > >> Eventually, we'll have to track down and document which versions of sphinx, >> docutils and pygments work to build the matplotlib documentation. There's a >> lot of moving parts here... >> > > Documenting is good, and I don't mind requiring updated versions of > everything, or even svn for now, to get the docs to build. I > consider these to be development/bleeding edge only, and don't want to > announce them to the user community until we have a reasonably > complete set of docs. But having a documented combination that works > in the dev guide would be useful. > |