Closed HJAllen closed 9 years ago
Title
is for captions. Try figurePrefix
.
Or maybe I misunderstood your problem.
Not sure on RStudio-knitr, and how it handles things, but in order for pandoc-crossref to number your figures, you have to attach identifier to them, i.e. this ![Figure](image.png)
would be "just a figure", without number, while this ![Figure](image.png){#fig:fig1}
would be a numbered figure.
You can omit label, i.e. just have ![Figure](image.png){#fig:}
, but that would mess with \listoffigures
, since it's build based on figure labels (which I should probably fix somewhere down the line)
Thanks for the quick response. To be clear, I want the reference in the text for the figure to be 'Figure x.' The figure is an image inserted as
![Organization Chart](HABOrgChart.jpg) {#fig:orgStruct}
and the reference in the text is [@fig:orgStruct]
the figures are numbered properly.
The YAML header is:
---
title: "Title"
output:
word_document:
pandoc_args:
- --filter
- pandoc-crossref
- --filter
- pandoc-word-newpage
fig_width: 5
fig_height: 5
reference_docx: style_v1.docx
pdf_document:
includes:
in_header: header.tex
pandoc_args:
- --filter
- pandoc-crossref
html_document:
keep_md: yes
pandoc_args:
- --filter
- pandoc-crossref
- --filter
- pandoc-word-newpage
csl: /workspace/cyanoHAB/environmental-toxicology-and-chemistry.csl
bibliography: HAB.bib
figurePrefix: 'Figure'
tablePrefix: 'Table'
---
I'm not entirely sure if knitr passes metadata to pandoc unmangled, but that should work from where I stand. Could you check with just pandoc, e.g. pandoc -s -t markdown -F pandoc-crossref input.md
?
I generated a markdown file from RStudio with
render(input="./doc_v3.Rmd",
output_format="md_document",
output_file="./doc_v3.md")
then ran
pandoc -s -t markdown -F pandoc-crossref doc_v3.md
and where i expected a figure reference
organizational structure is presented in [<span class="citeproc-no-output">**???**</span>].
the header of output shows figPrefix as 'fig.'
---
chapDelim: '.'
crossrefYaml: 'pandoc-crossref.yaml'
eqnPrefix:
- 'eq.'
- 'eqns.'
figPrefix:
- 'fig.'
- 'figs.'
figureTemplate: $$figureTitle$$ $$i$$$$titleDelim$$ $$t$$
figureTitle: Figure
listingTemplate: $$listingTitle$$ $$i$$$$titleDelim$$ $$t$$
listingTitle: Listing
lofTitle: |
List of Figures
===============
lolTitle: |
List of Listings
================
lotTitle: |
List of Tables
==============
lstPrefix:
- 'lst.'
- 'lsts.'
rangeDelim: '-'
tableTemplate: $$tableTitle$$ $$i$$$$titleDelim$$ $$t$$
tableTitle: Table
tblPrefix:
- 'tbl.'
- 'tbls.'
titleDelim: ':'
...
Oohhh. Right. Sorry. It's not figurePrefix
, but figPrefix
.
I've got confused with my own spftware. Embarassing.
that did it. Thanks. If it makes you feel better, I could have read a bit closer...
Anyway, glad to have it resolved. Thank you for using pandoc-crossref!
Thank you for your efforts! It has made my workflow so much easier and allows me to keep docx users happy.
I have updated to the latest version but still get figure labels as
fig 1.
I have added to the yaml header
using RStudio-knitr-pandoc writing output to word .docx
Thanks,
Joel