Re: Footnotes on line and not raised

2024-03-11 Thread Colin Baxter


Dear Christian and Juan,

Thank you very much for your contributions. These are great and exactly
what I want. I'll probably go with an export filter. 

Thank you

Best Wishes,

Colin Baxter.



Re: Footnotes on line and not raised

2024-03-11 Thread Christian Moe
Hi,

The footnote definitions are easy to fix with CSS since they are wrapped
in divs with the .footdef class.

#+begin_src css
  .footdef sup { vertical-align: baseline; font-size: 100%; }
#+end_src

But as you point out, the footnote references, are not as
straigthforward given the  structure -- at least
if you need other superscripts.

If you're not very concerned about cross-browser support, you can use
the :has() selector. Works fine in an up-to-date Firefox, but that's all
I'll promise.

#+begin_src css
  sup:has(.footref) { vertical-align: baseline; font-size: 100%; }
#+end_src

Otherwise, I think you'll need an export filter. Here's one that simply
sets the .footref class on the SUP element as well:

#+begin_src elisp
  (defun my-html-filter-footnotes (footnote backend info)
"Export footnote references with a class definition on the SUP
  element to make them more amenable to CSS."
(when (org-export-derived-backend-p backend 'html)
  (replace-regexp-in-string
   "" "" footnote)))

  (add-to-list 'org-export-filter-footnote-reference-functions
   'my-html-filter-footnotes)
#+end_src

Now it's easy to style the footnote reference with

#+begin_src css
  sup.footref { vertical-align: baseline; font-size: 100%; }
#+end_src

One could perhaps make the case that Org ought to do this by default.

Yours,
Christian

Colin Baxter writes:

> I use footnotes as [fn:1], etc. in an org-mode file which I then export
> to html. In the output, I see the footnotes raised slightly above the
> line. I do not want this. Instead, I would like the footnotes to be on
> the line. Is this possible?
>
> I have read the doc strings associated with the variables
> `org-footnote-define-inline' and `org-footnote-auto-adjust', but,
> frankly, I am none the wiser.
>
> Best Wishes,
>
> Colin Baxter.



Re: Footnotes on line and not raised

2024-03-11 Thread Juan Manuel Macías
Colin Baxter writes:

> Perhaps it's not possible because I see that .footref in css support is
> always .

You can modify  a little so that it does not alter the paragraph
line spacing so much. In this example, with a value of 0em, it is
positioned on the baseline:

#+HTML_HEAD:  sup {vertical-align: baseline;position: relative;bottom: 
0em;} 

Another slightly dirtier way is with an export filter in your document.
The sub tag is removed and the reference number is enclosed in square
brackets, separated by a space from the previous word:

#+BIND: org-export-filter-footnote-reference-functions (footnote-sup-filter)
#+begin_src emacs-lisp :exports results :results none
  (defun footnote-sup-filter (text backend info)
(when (org-export-derived-backend-p backend 'html)
(replace-regexp-in-string "" "" text)
#+end_src

screenshot:

https://i.ibb.co/CBRnfXG/pantallazo-79248380551244229p8.png

Best regards,

Juan Manuel 

-- 
Juan Manuel Macías -- Composición tipográfica, tratamiento de datos, diseño 
editorial y ortotipografía




Re: Footnotes on line and not raised

2024-03-11 Thread Colin Baxter


Perhaps it's not possible because I see that .footref in css support is
always .