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

Use package luaxml for default LaTeX renderer prototypes #532

Merged
merged 5 commits into from
Nov 21, 2024
Merged

Conversation

Witiko
Copy link
Owner

@Witiko Witiko commented Nov 21, 2024

Tasks

  • Use LuaXML in default LaTeX renderer prototypes for content blocks, raw blocks, and inline raw spans.
  • In TeX4ht, output the HTML code as-is instead of going through LuaXML.
  • Update CHANGES.md.

Closes #469.

@Witiko Witiko added latex Related to the LaTeX interface and implementation defaults Related to default option values and renderer prototypes tug 2024 Related to the TUG 2024 conference labels Nov 21, 2024
@Witiko Witiko added this to the 3.9.0 milestone Nov 21, 2024
@Witiko Witiko self-assigned this Nov 21, 2024
@Witiko
Copy link
Owner Author

Witiko commented Nov 21, 2024

@michal-h21: With the code from this PR, I can typeset the following document example.tex:

\documentclass{article}
\usepackage[content_blocks, raw_attribute]{markdown}
\begin{filecontents}[overwrite, nosearch, noheader]{example_input.html}
<b>foo</b> <i>bar</i>
\end{filecontents}
\begin{document}
\begin{markdown}

Raw text span: `<b>foo</b> <i>bar</i>`{=html}

Raw code block:

``` {=html}
<b>foo</b> <i>bar</i>
```

Content block:

 /example_input.html

\end{markdown}
\end{document}

Processing the document with LuaLaTeX using the command lualatex example produces the following output:

image

Processing the document with TeX4ht using the command make4ht example fn-in produces the following output:

<!DOCTYPE html> 
<html lang='en-US' xml:lang='en-US'> 
<head><title></title> 
<meta charset='utf-8' /> 
<meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' /> 
<meta content='width=device-width,initial-scale=1' name='viewport' /> 
<link href='example.css' rel='stylesheet' type='text/css' /> 
<meta content='example.tex' name='src' /> 
</head><body>
<!-- l. 2 --><p class='noindent'>Raw text span: <b>foo</b> <i>bar</i>
</p><!-- l. 3 --><p class='indent'>   Raw code block:
</p><p><b>foo</b> <i>bar</i>
</p><!-- l. 5 --><p class='indent'>   Content block:
</p><p><b>foo</b> <i>bar</i>

    
</p></body> 
</html>

image

I will appreciate your code review by the end of the next week. Otherwise, we should be ready for a release.

Copy link

@michal-h21 michal-h21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that the code works, I don't see any errors or problems

@Witiko Witiko marked this pull request as ready for review November 21, 2024 21:49
@Witiko Witiko merged commit bf72f36 into main Nov 21, 2024
12 checks passed
@Witiko Witiko deleted the feat/luaxml branch November 21, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defaults Related to default option values and renderer prototypes latex Related to the LaTeX interface and implementation tug 2024 Related to the TUG 2024 conference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Rmodepdf and LuaXML to display block HTML elements
2 participants