AllenDowney / plastex-oreilly

Branch of plastex that generates DocBook 4.5 that meets O'Reilly style guidelines.
7 stars 7 forks source link

Figures should not have anchor tags #4

Closed AllenDowney closed 12 years ago

AllenDowney commented 12 years ago

Right now figures are getting rendered with anchor tags embedded, like this:

<figure id="nsfg_hist"><title>Histogram of pregnancy lengths.</title>
<mediaobject>
  <imageobject remap="includegraphics">
   <imagedata fileref="figs/nsfg_hist.pdf"></imagedata>
  </imageobject>
</mediaobject><para> <anchor id="a0000000900" /> </para>
</figure>

But that's not valid. It should be

<figure id="nsfg_hist"><title>Histogram of pregnancy lengths.</title>
<mediaobject>
  <imageobject remap="includegraphics">
    <imagedata fileref="figs/nsfg_hist.pdf"></imagedata>
  </imageobject>
</mediaobject>
</figure>

At some point I must have figured this out, because I have another version of plastex that doesn't have this problem. But I don't remember the fix.

tiarno commented 12 years ago

I don't see how the anchor is getting rendered either. I tried to clone your repo today, but I can't install the new plastex on my network here at work. I will get it installed on my laptop tonight and see what I can figure out. I wonder if the \label tag is getting rendered twice--once for the figure and once just with a general id.

You've been doing a lot of work. I'll get back to you as soon as I can. I've also asked Kevin to take a look to get him involved.

AllenDowney commented 12 years ago

Thanks for looking into it!

On Mon, Jul 23, 2012 at 4:25 PM, Tim Arnold < reply@reply.github.com

wrote:

I don't see how the anchor is getting rendered either. I tried to clone your repo today, but I can't install the new plastex on my network here at work. I will get it installed on my laptop tonight and see what I can figure out. I wonder if the \label tag is getting rendered twice--once for the figure and once just with a general id.

You've been doing a lot of work. I'll get back to you as soon as I can. I've also asked Kevin to take a look to get him involved.


Reply to this email directly or view it on GitHub:

https://github.com/AllenDowney/plastex-oreilly/issues/4#issuecomment-7190010

AllenDowney commented 12 years ago

Ok, it turns out I was removing the unnecessary anchors in Renderers/DocBook/init.py. I accidentally removed that line. Now I put it back.

It's not the best solution, but it will do for now.

tiarno commented 12 years ago

in my copy I removed all the postprocessing regexps in the docbook renderer--it was making debugging too confusing for me.

AllenDowney commented 12 years ago

Yes, they are problematic. I would like to get rid of as many as possible.

Allen

On Tue, Jul 24, 2012 at 4:39 PM, Tim Arnold < reply@reply.github.com

wrote:

in my copy I removed all the postprocessing regexps in the docbook renderer--it was making debugging too confusing for me.


Reply to this email directly or view it on GitHub:

https://github.com/AllenDowney/plastex-oreilly/issues/4#issuecomment-7232591