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

Link not displayed in PDF #7

Closed
ismayc opened this issue Oct 17, 2015 · 4 comments
Closed

Link not displayed in PDF #7

ismayc opened this issue Oct 17, 2015 · 4 comments

Comments

@ismayc
Copy link

ismayc commented Oct 17, 2015

I'm trying to use kfigr to produce links to figures/chunks, but when I Knit PDF using knitr only the figure/chunk number is shown and not the link to the figure. It works just fine when I Knit HTML, but I'd like to use this on a PDF.

@mkoohafkan
Copy link
Owner

Hi ismayc,

kfigr does not currently support PDF documents; if you look at the code, you can see that it writes HTML tags to do the anchoring/cross-referencing. I'm considering adding LaTeX/PDF support and it should be fairly straight-forward (just need a switch to detect the output format and write LaTeX instead of HTML), but it's hard to find the time---if you feel like contributing this functionality yourself it probably wouldn't actually be too tough.

If you are writing in markdown and going to PDF using rmarkdown, that's actually a pandoc issue rather than a kfigr issue. pandoc does a lot of non-standard things with markdown and is still under active development, so it's too large of a burden to support for pandoc in kfigr. You may want to check out the captioner package, which apparently supports pandoc (although I have not used it).

@ismayc
Copy link
Author

ismayc commented Oct 17, 2015

Thanks, @mkoohafkan! I think I'm going to try out the pandoc route: https://github.com/lierdakil/pandoc-crossref . I am using rmarkdown to PDF using a custom LaTeX template and was hoping to avoid messing around more with pandoc if possible, but I'll check it out.

@mkoohafkan
Copy link
Owner

If you are writing an Rnw file (dynamic document in LaTeX) you might want to consider just using Latex's built-in support for cross-referencing. You can embed a plot-producing code chunk inside a figure environment and anchor/cross-reference with \label and \ref, respectively. Good luck!

@ismayc
Copy link
Author

ismayc commented Oct 17, 2015

I'm writing Rmd files and then converting to either HTML or PDF based on an rticles template. I've done the Rnw and LaTeX stuff in the past, but would like to stay away from using LaTeX code as much as possible. Thanks for the well wishes and for this cool package! I'll certainly be using this with HTML documents I produce.

@ismayc ismayc closed this as completed Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants