Equivalent to LaTeX \ and \ ref labels in HTML

I have a FAQ in HTML ( example ) in which questions relate to each other a lot. This means that whenever we insert / delete / rearrange questions, the numbering changes. LaTeX solves this very elegantly with \ label and \ ref - you give the elements simple tags, and LaTeX is worried about converting to numbers in the final document.

How do people deal with this in HTML?

ADDED: Please note that this is not a problem if you do not really need to reference the elements by number, in which case you can set the tag

<a name="foo">

and then link to it using

<a href="#foo">some non-numerical way to refer to foo</a>.

But I assume that "foo" has some auto-generated number, for example, from a list <ol>, and I want to use this number to reference and link to it.

+3
source share
5 answers

Here is how I decided to solve it using php script:

http://yootles.com/genfaq

This is about as convenient as \ label and \ ref in LaTeX and even automatically generates an index of questions. And I put it on an etherpad instance, which is convenient when several people contribute answers to frequently asked questions.

0
source

There is nothing like this in HTML.

, , , HTML- , HTML TOC ( , HTML- , , DOM ECMAScript <a>) HTML , , XML-, - ? - LaT & Epsilon; & Chi;.

+6

, , CSS. , id name .

+2

\label {key} < a name= "key" / > . , < a href= "# key" > Link </a> .

+1

PrinceXML can do it, but more on that. I believe that server-side scripts are best.

+1
source

Source: https://habr.com/ru/post/1715261/


All Articles