Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow colformat_md to offset citation note number #50

Closed
wants to merge 13 commits into from
Closed

Conversation

atusy
Copy link
Owner

@atusy atusy commented Mar 11, 2021

  • Fix order of citations
    • Currently, automatic citations is done via YAML metadata block, but it has higher priority than body text.
---
output:
  html_document:
    keep_md: true
bibliography: example.bib
csl: https://raw.githubusercontent.com/citation-style-language/styles/master/vancouver.csl
---

@example1

```{r, echo=FALSE}
writeLines(
  sprintf(
    "@Book{example%s, author = {author%s}, title = {title}, year = {2021},}\n",
    1:3, 1:3
  ),
  "example.bib"
)
library(ftExtra)
data.frame(x = "@example2") %>%
  as_flextable() %>%
  colformat_md(.cite_offset = 1)
```

@example3

image

@atusy
Copy link
Owner Author

atusy commented Mar 11, 2021

Another problem is the assumption that citations in the table do not appear earlier in the body, which is not always true.
I think this current strategy is not enough powerful despite of dirty hacks...
I close this PR and possibly reconsider in the future...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant