Skip to content
This repository was archived by the owner on Sep 28, 2023. It is now read-only.
This repository was archived by the owner on Sep 28, 2023. It is now read-only.

Roadmap for higher-level utils? Perhaps start a separate package? #121

@leftaroundabout

Description

@leftaroundabout

Although the fact that HaTeX uses Haskell syntax already is a significant advantage for writing documents in it (as opposed to in LaTeX itself), “raw HaTeX” also has a few issues that keep bugging me:

Math is unsafe

For one thing, LaTeX makes a pretty rigid distinction between math mode and normal mode, but in HaTeX both are the same type. On one hand, you might say it's futile to “make LaTeX type-safe” because of the self-modifying nature, OTOH, whereas the vast majority of LaTeX documents don't really use any such syntax-modifying features, very many of them do use math mode.

In math mode, HaTeX is rather awkward, being not parenthesisation-aware. I'm personally quite happy with my TeXMyMath package, however this makes heavy use of unicode which I suspect not many users are keen on.

Citations are cumbersome

The LaTeX workflow for citations is to keep a .bib file that contains extensive information on every source you wish to quote – necessarily at least all the info that should appear in the rendered document – and then use keys into that .bib file in the document. Of course there are bibliography tools that can help creating these .bib files, but it's still always either a lot of duplication or your documents aren't standalone.
Nowadays, there is with DOI a clearly established standard for how documents can uniquely and minimally identified, so what I'd like is to only include the DOI directly in my document, and have all the details done automatically in the background for me.

I wrote a monad transformer for this and it works in a sense – in each document, you just need to specify the DOI, though you still need to refer to a master .bib file. Which kind of defeats the point. And even so, it incurs a dependency on a parser for .bib files, which aren't part of LaTeX per se.

Doing it properly would require much heavier dependencies – network access, and/or configuration management to retrieve and/or store the info of what a DOI refers to.

What package does this command belong to?

HaTeX doubles the effort of including packages: you need a Haskell import clause to get access to the commands, and then you still also need to put the usepackage into the document preamble. The latter sometimes requires a particular order of package-imports, because many LaTeX styles use pretty adventurous monkeypatching.

It would be much nicer if each command in HaTeX “knew” what package it belongs to, and a document could assemble its own preamble simply based on what commands it contains. This too would be possible with a monad transformer, but it would require some non-obvious decisions:

  • How would we identify packages?
  • How to know that e.g. breqn needs to be included after amsmath?
  • Should the information be stored in the syntax tree? (Probably not)

The question is, how best to move forward. Suggestions as separate comments...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions