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

Design a feature: the direct mapping of elements #92

Open
Witiko opened this issue Aug 8, 2021 · 0 comments
Open

Design a feature: the direct mapping of elements #92

Witiko opened this issue Aug 8, 2021 · 0 comments
Labels
feature request help wanted lua Related to the Lua interface and implementation plaintex Related to the plain TeX interface and implementation tug 2021 Related to the TUG 2021 conference

Comments

@Witiko
Copy link
Owner

Witiko commented Aug 8, 2021

The Markdown package has always relied on TeX's expansion processor: For example, the Lua parser converts the markdown text # What's on the Menu?, into the TeX code \markdownRendererHeadingOne{What's on the Menu?}, which TeX expands to \chapter{What's on the Menu?} and typesets.

However, we can't always rely on TeX's expansion processor: For example, the \begin{frame} command of the Beamer LaTeX package will read input until it has found a matching \end{frame} command. If \end{frame} is hidden behind expansion, it will not be found. Enabling the mapping of elements to arbitrary text in Lua instead of relying on TeX's expansion processor would make it possible to e.g. typeset presentation slides with the Beamer package without having to drop out of Markdown between frames:

\markdownSetup {
  directMapping = {
    headingOne = {
      \begin{frame}
      \frametitle{#1}
    },
    horizontalRule = {
      \end{frame}
    },
  }
}

The above configuration in LaTeX would cause the following Markdown input to produce a presentation slide with the title What's on the Menu? and a horrifying conclusion: Grandma

# What's on the Menu?
Grandma

***

Issues to hammer out include:

  • How to best implement attribute substitution (\frametitle{#1}) in Lua?
  • How to pass arbitrary direct mapping definitions from TeX to Lua with as little lossage as possible?
@Witiko Witiko added feature request help wanted lua Related to the Lua interface and implementation plaintex Related to the plain TeX interface and implementation tug 2021 Related to the TUG 2021 conference labels Aug 8, 2021
@Witiko Witiko changed the title Enable the direct mapping of elements Design the direct mapping of elements Apr 28, 2023
@Witiko Witiko changed the title Design the direct mapping of elements Design a feature: the direct mapping of elements Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request help wanted lua Related to the Lua interface and implementation plaintex Related to the plain TeX interface and implementation tug 2021 Related to the TUG 2021 conference
Projects
None yet
Development

No branches or pull requests

1 participant