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

Links inside fig.cap garbled with LaTeX #60

Open
jweisber opened this issue Aug 23, 2018 · 0 comments
Open

Links inside fig.cap garbled with LaTeX #60

jweisber opened this issue Aug 23, 2018 · 0 comments

Comments

@jweisber
Copy link

Thanks for the terrific package—and for the whole knitrverse!

I wonder if there's a bug that affects links placed inside fig.cap when working with LaTeX (tufte_handout or tufte_book). Here's a MWE:

---
title: "Minimal Working Example"
output: tufte::tufte_handout  # but tufte::tufte_html is fine
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse venenatis fringilla libero at tristique. 

```{r fig.cap="A plot of the famous [cars data set](https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/cars.html)."}
plot(cars)
```

Aliquam ut enim sodales, semper libero nec, bibendum velit. Pellentesque ultrices magna justo, in faucibus orci consequat sit amet.

This gives me the result:

screen shot 2018-08-22 at 8 27 44 pm

Whereas substituting tufte::tufte_html seems to work as expected.

Digging into the generated .tex file, it looks like the problem is the link just hasn't been converted from markdown to LaTeX:

\begin{figure}
\includegraphics{MWE_files/figure-latex/unnamed-chunk-1-1} \caption[A plot of the famous [cars data set](https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/cars.html)]{A plot of the famous [cars data set](https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/cars.html).}\label{fig:unnamed-chunk-1}
\end{figure}
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

No branches or pull requests

1 participant