Skip to content
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

Reimplement LaTeX setup snippets using lthooks #93

Closed
Tracked by #120
Witiko opened this issue Aug 9, 2021 · 11 comments
Closed
Tracked by #120

Reimplement LaTeX setup snippets using lthooks #93

Witiko opened this issue Aug 9, 2021 · 11 comments
Labels
feature request latex Related to the LaTeX interface and implementation technical debt Related to code smells and refactoring tug 2021 Related to the TUG 2021 conference

Comments

@Witiko
Copy link
Owner

Witiko commented Aug 9, 2021

Since version 2.10.0, the Markdown package has allowed users to define and invoke snippets that have a local effect on the behavior of markdown elements. By reimplementing snippets using @FrankMittelbach's lthooks instead of general TeX commands, it will be easier for different packages to modify one snippet without stepping on each other's toes.

@Witiko Witiko added feature request latex Related to the LaTeX interface and implementation tug 2021 Related to the TUG 2021 conference labels Aug 9, 2021
@Witiko Witiko added this to the 2.11.0 milestone Aug 9, 2021
@Witiko
Copy link
Owner Author

Witiko commented Aug 9, 2021

We should also ensure that \begin and \end{markdown} and {markdown*} invoke the env/markdown{,*}/{before,after} hooks.

@Witiko Witiko added the technical debt Related to code smells and refactoring label Aug 24, 2021
@Witiko Witiko removed this from the 2.11.0 milestone Sep 11, 2021
@Witiko
Copy link
Owner Author

Witiko commented Sep 11, 2021

I am clearing the 2.11.0 milestone, since lthooks are only compatible with TeX Live 2021 and later. In order to support Overleaf, we will need to postpone using lthooks until TeX Live 2022 or 2023.

@Witiko
Copy link
Owner Author

Witiko commented Sep 11, 2021

After we start using lthooks, it may be benefitial to remove the compatibility code that works around the absence of lthooks.

@FrankMittelbach
Copy link

I am clearing the 2.11.0 milestone, since lthooks are only compatible with TeX Live 2021 and later. In order to support Overleaf, we will need to postpone using lthooks until TeX Live 2022 or 2023.

??? It was added to LaTeX 2020-10-01 (there are corrections in later release but the functionality should be there since then). Not sure what Overleaf is at at the moment.

@Witiko
Copy link
Owner Author

Witiko commented Sep 11, 2021

??? It was added to LaTeX 2020-10-01 (there are corrections in later release but the functionality should be there since then). Not sure what Overleaf is at at the moment.

@FrankMittelbach LaTeX hooks were unavailable in TeX Live 2020 on release and they are also unavailable in the TeX Live image that Overleaf is using at the moment (LaTeX 2020-02-02). Looking for a polyfill to \AddToHook{begindocument/end} left me empty-handed. The hook system looks neat, but it is not central to the Markdown package. If the onboarding cost is either losing TeX Live < 2021 or manually writing compatibility code, then that's a cost I'm not willing to pay at the moment and I'll postpone this issue.

@Witiko
Copy link
Owner Author

Witiko commented Sep 11, 2021

This is my mistake, really. When I created this issue, I assumed that there existed a package that served as a basis for the hook management system. As it turns out, a lot of the functionality is either a synthesis of several existing packages or brand new, which is exciting, but it also means that writing backwards-compatible code is difficult with the hooks.

@FrankMittelbach
Copy link

The concepts as such are brand new but when possible we reimplemented existing (more primitive hooks) with the new functionality. So yes, some of it can't be simply retrofitted except by rolling forward.

@Witiko
Copy link
Owner Author

Witiko commented Sep 11, 2021

I figured. We will probably start adding bits of \@ifl@t@r\fmtversion{2020-10-01}{ code with hooks }{ code without hooks } here and there, but will wait with the larger systems such as the setup snippets for a year or two.

@FrankMittelbach
Copy link

or perhaps even better:

\ifx\IfFormatAtLeastTF\@undefined  
  \def\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} 
\fi

at the top and then use that (as it is the official interface for it).

@Witiko
Copy link
Owner Author

Witiko commented Sep 12, 2021

@FrankMittelbach Ok, thank you. Added in d3bdffb.

@FrankMittelbach
Copy link

more readable, less strange @s but of course unfortunately introduced only a couple of releases back, so will take a few years before one can use it without this guard at the top of the file.

@Witiko Witiko added expl3 Related to the high-level programming language expl3 and removed expl3 Related to the high-level programming language expl3 labels Jun 7, 2022
@Witiko Witiko added this to the 3.0.0 milestone Nov 12, 2022
@Witiko Witiko removed the markdown3 label Apr 27, 2023
@Witiko Witiko removed this from the 3.0.0 milestone Apr 27, 2023
@Witiko Witiko closed this as completed May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request latex Related to the LaTeX interface and implementation technical debt Related to code smells and refactoring tug 2021 Related to the TUG 2021 conference
Projects
None yet
Development

No branches or pull requests

2 participants