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

rebber: footenotetext cannot be placed everywhere #400

Closed
pierre-24 opened this issue May 12, 2020 · 4 comments · Fixed by #413
Closed

rebber: footenotetext cannot be placed everywhere #400

pierre-24 opened this issue May 12, 2020 · 4 comments · Fixed by #413
Labels
semver/bugfix This is a minor backward-compatible fix status/verified This has been checked by a maintainer type/bug This is a problem

Comments

@pierre-24
Copy link
Member

pierre-24 commented May 12, 2020

This code actually works after translation in LaTeX:

# The elephant [^a]
[^a]: in the room

!![](https://www.drawingforall.net/wp-content/uploads/2015/03/4-apple-drawing.jpg)
Figure: this is a famous [^b] picture
[^b]: or not

This one don't

# The elephant [^ in the room]

!![](https://www.drawingforall.net/wp-content/uploads/2015/03/4-apple-drawing.jpg)
Figure: this is a famous [^ or not] picture

I'm a big fan of the [^ this is a footnote] feature, which is translated by rebber as

\textsuperscript{\ref{footnote:2}}\footnotetext[2]{\label{footnote:2} this is a footnote.}

Except I just discovered that this is problematic in (at least) two situations:

  • Inside titles # the elephant [^ in the room]
  • In figure (and probably other) captions: Figure: this is a famous [^ or not] picture.

Actually, the problem is only the \footnotetext{} part (which explains why the first code works and the second don't), so that node should be "delayed" right after the caption/figure in TeX, if possible ;)

.... except if @Karnaj has an idea on the latex side. The error is, for example,

Argument of \@caption has an extra }.

@StaloneLab StaloneLab added semver/bugfix This is a minor backward-compatible fix status/verified This has been checked by a maintainer type/bug This is a problem labels May 12, 2020
@StaloneLab StaloneLab added this to the next version milestone Jul 24, 2020
@StaloneLab
Copy link
Member

StaloneLab commented Jul 24, 2020

Hi,

I'm planning on correcting this in the upcoming version of ZMarkdown, could you please provide the expected result from your example above?

Also, please note that due to and update in our dependencies, the old syntax is unlikely to remain, and inline footnotes will become: ^[long footnote] instead of [^long footnote] (note the subtle change).

@StaloneLab
Copy link
Member

Okay, just noticed we do have something to prevent this behavior, but... it seems to be misused for footnoteDefinition.

The current system, which I can expand to the test case you give, gives the following result:

\levelOneTitle{hello\textsuperscript{\ref{footnote:1}}\footnotetext[1]{\label{footnote:1} footnote that i like}\protect}

Please note the \protect at the end which supposedly solves the bug.

@Karnaj
Copy link

Karnaj commented Jul 29, 2020

\levelOneTitle{hello\textsuperscript{\ref{footnote:1}}\protect\footnotetext[1]{\label{footnote:1} footnote that i like}}

(I'm also trying to use \footnotemark instead of \label and \ref (it will permit to have the link to the correct page)).

@StaloneLab
Copy link
Member

Fixed in upcoming version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/bugfix This is a minor backward-compatible fix status/verified This has been checked by a maintainer type/bug This is a problem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants