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

Adding footnotes #16

Open
bake opened this issue Jan 6, 2019 · 6 comments
Open

Adding footnotes #16

bake opened this issue Jan 6, 2019 · 6 comments

Comments

@bake
Copy link

bake commented Jan 6, 2019

Hi, I like to use footnotes on my pages. I wrote a very simple plugin that accomplishes this by adding arguments to a call of \footnote to a package global slice and rendering it when \footnotemark is called. This is probably not the best way to do it.

Do you think a feature like this should be added to baselit?

@vito
Copy link
Owner

vito commented Jan 9, 2019

Neat! Yeah, this could be a good idea for baselit.

Maybe the footnotes could be kept as state on the *Plugin object instead?

@bake
Copy link
Author

bake commented Jan 9, 2019

To be honest, I don't know why I didn't set it inside the struct. The repo is updated, thank you. There still is the problem of duplicate references when using multiple \footnotemark on a single page (which might not happen often).

For example, both footnotes will get an index 0:

\footnote{Foo.}
\footnotemark

\footnote{Bar.}
\footnotemark

Do you have an idea where the current index should be stored (if at all)?

@bake bake closed this as completed Jan 9, 2019
@bake bake reopened this Jan 9, 2019
@vito
Copy link
Owner

vito commented Jan 15, 2019

(Sorry for the delay!)

For my understanding, do you see this to mainly be a problem when multiple sections are rendered inline into one page?

Maybe the footnotes should include the section tag in their anchor - i.e. #fn-section-title-1?

@bake
Copy link
Author

bake commented Jan 18, 2019

Exactly, I think your solution should work. I'll give it a try when I'm back home.

@bake
Copy link
Author

bake commented Feb 1, 2019

Sorry, this took longer than expected.

I am not sure how to access previous footnotes from within baselit. The plugin-approach seems a lot simpler.

I suspect it would work similar to the toc, but reading upward and printing the sections titles querying the footnotes in all subsections.

A new \footnote then should look in its parent sections until it finds a previous \footnote and increment the found id or it finds a \footnotemark, in which case its id should start at 0 or 1.

@vito
Copy link
Owner

vito commented Feb 6, 2019

@bakerolls No worries! I think a separate plugin is fine especially since there's state involved.

I think if you put the section's tag in the footnote anchor the IDs don't really matter, since they'll always be relative to the section tag. Does that make sense?

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