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

Maybe expand LaTex.pm #375

Open
Mechtilde opened this issue Jul 29, 2022 · 1 comment
Open

Maybe expand LaTex.pm #375

Mechtilde opened this issue Jul 29, 2022 · 1 comment
Labels
fmt:TeX Bugs related to the TeX and LaTeX formats help wanted

Comments

@Mechtilde
Copy link

Hello,

I have an enhancement for the LaTeX format plugin.

I often use a plugin in for LaTeX to do literate programming "NoWeb"
(e.g https://salsa.debian.org/ddp-team/dpb)
Here I put an example.

in Noweb (File: Part3.nw, line 81-89)
you see the start of a code chunk and at line 89(@) the end of the code chunk

<>=
##############

Here it starts

BuildApp

##############

This is the end, my friend

@

The text in between shouldn't be translatable.

In the TeX File I generate it shows like

\nwfilename{Part3.nw}\nwbegincode{1}\sublabel{NW4L0rMe-2dfaZH-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4L0rMe-2dfaZH-1}}}\moddef{MainProgram~{\nwtagstyle{}\subpageref{NW4L0rMe-2dfaZH-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\{NW4L0rMe-2uaRFM-1}}\nwenddeflinemarkup
##############

Here it starts

BuildApp

##############

This is the end, my friend

\nwused{\{NW4L0rMe-2uaRFM-1}}\nwendcode{}\nwbegindocs{2}\nwdocspar

As far as I know and use it. all other things are the same as in LaTeX. So I hope it is possible to extend the LaTeX plugin for NoWeb.

Kind regards

@mquinson
Copy link
Owner

If you plan to implement it, I'd be glad to assist you and guide you in the po4a source code. Writing a new module is not difficult in general, but the trick here is that the LaTeX module is one of the hardest one because it's able of interpreting most TeX commands to find the content to translate and appropriate configuration.

Maybe we should think of a composite module, that parses this format, constitute a LaTeX fragment, and feeds it to the existing po4a-latex module. I suspect that it would be easier than extending the latex module directly, but I may well be wrong: I didn't dive in that part of the code for at least a decade.

The bad news is I'm in maintenance mode for po4a since several years: I will not find the time to implement such thing myself, so it probably won't happen if you don't implement it yourself. Sorry about it.

@mquinson mquinson added the fmt:TeX Bugs related to the TeX and LaTeX formats label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fmt:TeX Bugs related to the TeX and LaTeX formats help wanted
Projects
None yet
Development

No branches or pull requests

2 participants