elyxer-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[eLyXer-users] elyxer.py bug


From: Kaye, Timothy S.
Subject: [eLyXer-users] elyxer.py bug
Date: Mon, 4 Feb 2013 15:44:31 +0000

Dear everyone,

I have found a bug in elyxer which I don't have the expertise to fix, and which Alex doesn't have the time to fix. It concerns the way that elyxer produces footnotes.

As you know, elyxer can produce marginal footnotes and hovering footnotes, both of which work fine. And then there are endnotes, which is where the problem lies (but only when used in conjunction with hovering footnotes).

What should happen is that, when the user clicks on a footnote number, s/he is taken to the footnote itself. Currently, what happens is that the screen scrolls only far enough to put the clicked number at the top of the page. (The function to return to the right place in the main text from the footnote works fine.)

I am attaching Alex's working example for you to see this, together with the latest version of elyxer.py that I have. (You might need to reduce the width of your browser to see it.) You need to type:
$ ./elyxer.py --footnotes hover,end,number footnotes-1-6.lyx output.html

If the endnote function is run alone, however, there there is no problem. See:
$ ./elyxer.py --footnotes end,number footnotes-1-6.lyx output.html

So the hover function is somehow interfering with the endnotes function. Unfortunately, I really need them both.

Alex identified the problem as being "the code for the hovering footnote:
  <a href="#0.3_footmarker-A" name="0.3_footnote-A">[A]</a>
it defines the anchor for the footnote and a link back to the marker."

The husband of a colleague, who knows some Python but not enough to fix the problem, has worked out what the fix needs to achieve. In the screenshot attached, the yellow highlight is the footnote link (which is supposed to link to the bottom of the page). The pink highlight is the hover footnote link which, instead of also linking to the bottom of the page, is linking back to the main footnote.

He suggests that we need to flip the words "note" and "marker" in the pink highlight to change this. Apparently, this means replacing every occurrence of:

<span class="HoverFoot"><span class="SupFootMarker"> <a class="Link" name="footnote-

with:

<span class="HoverFoot"><span class="SupFootMarker"> <a class="Link" name="footmarker-

He continues:

"You have to use that whole string starting with "HoverFoot" to ensure you're changing just the hovering footnote links and not the main ones. In the sample document, there are 9 footnotes so this find/replace should happen 9 times. Now to fix the second part (the anchor name) we need to replace:

href="">

with:

href="">

BUT ONLY FOR THE FIRST X OCCURRENCES where X is the number of footnotes. If you replace beyond that, you'll be breaking the links in the end footnotes at the bottom of the document.

And now both the regular and hover footnotes should properly jump to their corresponding footnote at the end of the document. My "fixed" sample output is attached."

Alex tells me that the development version of eLyXer at  https://github.com/alexfernandez/elyxer is much friendlier than the monolithic version that we all use but, as I say, neither my colleague's husband nor I have the expertise to fix this.

I am currently working on a project where I really need to have both hovering footnotes and endnotes working together as intended. Does anyone out there have the time and expertise to take a look, please? I really would be enormously grateful!

Thanks for reading to the end of this rather long email!

Tim

Dr. Tim Kaye
Professor of Law
Stetson University College of Law
1401 61st Street South
Gulfport
Florida 33707
USA
 
Tel: +1 (727) 562 7347
 
 

Attachment: elyxer.py
Description: elyxer.py

Attachment: footnotes-1-6.lyx
Description: footnotes-1-6.lyx

Attachment: image.png
Description: image.png

Footnotes Tests

Table of Contents

1 This is just some random section text used to insert some footnotes.[1][1]And this is one of those footnotes. And this is a margin note, also tested here.

Lorem ipsum dolor sit amet, consectetur adipisicing[2][2]adipisicing elit[3][3]elit, sed do eiusmod eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa [4][4]culpa qui officia [5][5]officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum[6][6]laborum, laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do tempor incididunt ut [7][7]ut labore[8][8]labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis Duis aute irure dolor in reprehenderit in voluptate velit[9][9]velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id id est laborum.

Nomenclature

eiusmod eiusmod indeed

References

Index

ullamco:

Footnotes

[1]And this is one of those footnotes.
[2]adipisicing
[3]elit
[4]culpa
[5]officia
[6]laborum, laborum
[7]ut
[8]labore
[9]velit

reply via email to

[Prev in Thread] Current Thread [Next in Thread]