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 in-line variable insertion with an {embed} role and ![](#embed) syntax #1107

Open
choldgraf opened this issue Apr 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@choldgraf
Copy link
Collaborator

Currently, inserting a variable or a cell output with {embed} inserts a block-level output even if the embed syntax is written in-line with text around it.

It would be useful if users can embed variables in-line with text so that they can insert things like individual numbers, ideally with some formatting capabilities as well.

One implementation pathway

One idea would be to do the following:

  1. Define an {embed} role that assumes the output is in-line rather than block-level. We'd need to figure out how to attach the breadcrumbs (maybe a footnote or margin note?) back to the original notebook.
  2. Modify the image embed short-hand (![](#embed)) to choose the role or the directive based on whether it's surrounded by text or a standalone block-level item.

Reference

Example

An example from #800:

From @ rmnldwg

E.g., when I write a manuscript like this

## Methods

We included ![](#num-patients) patients in our study. Their mean age was ![](#mean-age) years.

an I have the corresponding notebook cells, then I see this:

image

But I would like to include these numbers like so:

image

@choldgraf choldgraf added the enhancement New feature or request label Apr 16, 2024
@choldgraf choldgraf changed the title Allow in-line variable insertion with {embed} syntax Allow in-line variable insertion with an {embed} role and ![](#embed) syntax Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant