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

How to display an inner reference as initial text in a verbatim block? #378

Open
piiskop opened this issue Jul 27, 2022 · 1 comment
Open

Comments

@piiskop
Copy link

piiskop commented Jul 27, 2022

i'm writing a manual and struggling with the reference part. i have a reference like:

(ref:a-reference) whatever

i want to show as verbatim how to use it:

```{verbatim}
I'm referring to (ref:a-reference).

```

The output should be:

I'm referring to (ref:a-reference).

Instead, the output is:

I'm referring to whatever.

This is because (ref:...) will be evaluated before the verbatim block and the value of that will be put into, not the string itself. Actually, as it's a verbatim block, there must only be the initial, not evaluated string. How to do that?

@cderv
Copy link
Collaborator

cderv commented Aug 22, 2022

bookdown currently only ignore replacement when the reference is in a verbatim inline code

I'm referring to `(ref:a-reference)`.

In any other case, the text reference will be replaced. This would be a feature request in bookdown if this is possible.

However, not as easy as the mechanism does not parse the text as block but by line so the context of the verbatim code block is not known by the text reference feature.

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

2 participants