-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Built-in support for indices? #6415
Comments
Are you talking about LaTeX indices, or...? I'm not very familiar with those.. What exactly is the feature request? A change to pandoc's latex output, or...? |
Indices are are crucial feature of print books (and are very helpful for digital books, too). This is an example in HTML (produced via my Lua filter): https://exploringjs.com/impatient-js/ch_index.html
Include the functionality in Pandoc that I have implemented via my filter:
One needs to support two “commands”:
|
Thanks for the explanations. Seems somewhat related to #813... ? |
Very loosely. So far, I have always put index terms into the top level of a section, never inside tables, figures, or headers. |
A few more details – the idea of creating an index is as follows:
Step 2 is crucial and shouldn’t have to be done manually (=error-prone tedious work). An index is similar to a table of contents in that it also provides quick access to content (but via topic, not via heading). This is especially important for print books where you don’t have full text search. Most non-fiction print books have indices. If they don’t, people complain on Amazon. 😀 |
@rauschma now when Pandoc's Lua API includes lpeg/re it would make sense to use an re pattern to parse Footnotes
|
It would really be great if Pandoc supported indices, for all of the reasons outlined above. In pretty much any non-fiction work of non-trivial length where readers might want to look up a topic, it is useful to have an index. |
It's a can of worms though, since different languages have different sorting rules. Hopefully there is a Haskell library similar to Unicode::Collate/Unicode::Collate::Locale or Sort::ArbBiLex. I have ported the latter to MoonScript/Lua myself but I'd be loth to ask for either to be ported to Haskell as I'm unable to do it myself. Also how would the index work? In a PDF/ebook you would want to refer to page numbers and link to the pages. In (a) webpage(s) you would want to link to locations which might be in another file, and in that case what should the link text look like? Moreover with HTML output you would want the index to look different depending on whether you output a single web page, multiple web pages, PDF or ebook. In some cases you would probably want to reference sections or paragraphs, which probably would mean that you would want to have section/paragraph numbers already sorted out.1 That's a lot of configuration and at the end of the day you might be better off using some external tool to build the index, in conjunction with either a filter or something builtin which produces the input to the external tool, a bit like makeindex works even if you wouldn't use makeindex itself due to its limitations. Footnotes
|
It's certainly got plenty of cases that need to be considered, but it's not really a can of worms. Many of the problems to be solved are pretty orthogonal to each other. It seems like the key things that are needed are:
Each of these chunks is distinct and their interfaces are pretty easy to define, so we should be able to take any can of worms, separate the worms, straighten them out and line them up neatly! |
There is my unicode-collation, which we use for proper sorting in citeproc. |
Maybe it got sense implementing this with three new Pandoc options? something like:
Referenceglossaries LaTeX package: makeidx LaTeX package: makeindex LaTeX package: |
mkindex
, you can’t use Pandoc anymore and have to manage LaTeX yourself (e.g. vialatexmk
).The text was updated successfully, but these errors were encountered: