The R block lst:DoFig generates the figure fig:DoFig:
Figure 1: Figure generated by R
curve(sin(x),from=-pi, to=pi)
Problem: whereas the HTML export labels the source listing as "Listing 1" and is correctly refers to 1, the PDF export labels it "Figure 2" (and points to it).