-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Text references don't work with multiline lines #1430
Comments
@eliocamp: Do you mind linking the documentation you mentioned? I always assumed this was by design. Either way, I can definitely confirm the behaviour you describe for as long as I remember using text references. |
Here: https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#text-references it states that "The text can contain anything that Markdown supports, as long as it is one single paragraph." In markdown (at least the flavour used by bookdown) sentences belonging to the same paragraph can be each in its own line. You need two newlines to define a new paragraph. (You can see that in the bad example, the text reference is rendered as a single paragraph). Also, PDF output does work. This seems to be an issue for HTML (gitbook and epub) and word formats only. |
The issue is around here: Lines 807 to 821 in 52c31aa
At this point <p>(ref:caption) Here is a nice figure!
And this is a second sentence.</p> So Using Lines 80 to 82 in 52c31aa
|
Ok. It seems that That would just pass Lines 59 to 62 in 52c31aa
As a workaround, one can set pandoc_args:
- --wrap=none on the output format options in the YAML. Don't know how you feel about this. If you agree with the fix, I can sent a PR. |
I've got a similar issue when embedding |
@king-of-poppk please open a new issue with a reproducible example and we can have a look |
Text references don't seem to work if the text is split in multiple lines.
Example: Create a new bookdown project and go to
02-cross-refs.Rmd
in the sample book and change the first figure to this:As expected, text reference works and the caption is rendered where it should be:
Now add a new line:
The text reference is still a single paragraph so, according to the documentation, it should still work. However, the ouput doesn't show the correct caption:
This seems to be an issue for HTML (gitbook and epub) and word formats. PDF renders correctly.
The text was updated successfully, but these errors were encountered: