[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-11 Thread Michal Hoftich
Follow-up Comment #16, bug #617 (project tex4ht):

Ah, so the mystery is solved :)

Thanks.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-10 Thread VítStarýNovotný
Follow-up Comment #15, bug #617 (project tex4ht):

That's because the syntax `\begin{markdown}[...] \end{markdown}` is new in
Markdown 3. In Markdown 1 and 2, you would use the old example files that use
`\begin{markdown*}{...} \end{markdown*}` instead.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-10 Thread Michal Hoftich
Follow-up Comment #14, bug #617 (project tex4ht):

Something needs to be wrong on my side. I've noticed, that even the hybrid
option doesn't work with the markdown environment. Both with make4ht and
LuaLaTeX. But, if I use the \markdownSetup command to make these options
global, they work. 

So the following example works, but not if I remove the \markdownSetup
command:

%%%
\documentclass{book}
\usepackage{lmodern}
\usepackage{booktabs}
% Load the Markdown package and set its options.
\usepackage[
]{markdown}
\markdownSetup{
  hybrid,html
}
\begin{document}

\begin{markdown}[hybrid]
  hello \TeX, what's goind on?
\end{markdown}

\begin{markdown}[html,hybrid]
Here is some HTML code mixed *with Markdown*. In \TeX, the HTML code
will be silently ignored, whereas in \TeX 4ht, the HTML code will be passed
through to the output:


  
Emil
Tobias
Linus
  
  
16
14
10
  

\end{markdown}
\end{document}
%%%



___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-10 Thread VítStarýNovotný
Follow-up Comment #13, bug #617 (project tex4ht):

> I guess this version doesn't support inline HTML?

It does. I tried to reproduce your issue as follows:

$ # fetch the examples as they were in Markdown 2.23.0
$ git clone https://github.com/Witiko/markdown.git
$ cd markdown
$ git checkout 2.23.0
$ # typeset `latex-pdftex.pdf` with Markdown 2.23.0 from the current TeX Live
$ docker run -v "$PWD"/examples:/workdir -w /workdir --rm
texlive/texlive:latest make latex-pdftex.pdf  
$ grep 'markdown renderer' markdown/examples/latex-pdftex.log
Package: markdown 2023-04-27 v2.23.0-0-g0b22f91 markdown renderer

The last two paragraph in my document `latex-pdftex.pdf` that I typeset with
Markdown 2.23.0 look the same as in the screenshot from my previous post using
Markdown 3.3.0. In other words, I can't reproduce your issue.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-10 Thread Michal Hoftich
Follow-up Comment #12, bug #617 (project tex4ht):

I used the default installation of the Markdown package in my TeX Live, it
says "Package: markdown 2023-04-27 v2.23.0-0-g0b22f91 markdown renderer", so
it seems pretty old, but probably correct, as it is the same as the latest
release on CTAN. I guess this version doesn't support inline HTML?

I've missed that the example is meant for PDFLaTeX, so I used LuaLaTeX, which
led to the missing accented characters. They are here when I switch engines.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-10 Thread VítStarýNovotný
Follow-up Comment #11, bug #617 (project tex4ht):

Thank you for the bug report. Sadly, I can't reproduce your issue with the
current version Markdown package. Here is what I did:

$ git clone https://github.com/Witiko/markdown.git
$ docker run -v "$PWD"/markdown/examples:/workdir -w /workdir --rm
witiko/markdown make latex-pdftex.pdf
$ grep 'markdown renderer' markdown/examples/latex-pdftex.log
Package: markdown 2024-01-06 v3.3.0-20-g412f09b7 markdown renderer

See the attached screenshot that shows the last two paragraphs in my document
`latex-pdftex.pdf`. Unlike your screenshot, my screenshot contains all the
characters "ěščřžýáíé" and neither the verbatim text `\TeX` nor
verbatim HTML tags. How did you create the document from your screenshot?

(file #532)
___

Additional Item Attachment:

File name: scrot.png  Size:37 KB


___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-10 Thread Michal Hoftich
Follow-up Comment #10, bug #617 (project tex4ht):

Yes, exactly. I see HTML tags in both PDF and HTML outputs. 

(file #530, file #531)
___

Additional Item Attachment:

File name: markdown-html.png  Size:37 KB
File name: markdown-pdf.png   Size:74 KB


___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-10 Thread VítStarýNovotný
Follow-up Comment #9, bug #617 (project tex4ht):

Do you mean the following snippet?

```
\begin{markdown}[html, hybrid]
Here is some HTML code mixed *with Markdown*. In \TeX, the HTML code
will be silently ignored, whereas in \TeX 4ht, the HTML code will be passed
through to the output:


  
Emil
Tobias
Linus
  
  
16
14
10
  

\end{markdown}
```

I don't see it inserted verbatim. Instead, I see a table, see the attached
screenshot.

(file #529)
___

Additional Item Attachment:

File name: scrot.png  Size:18 KB


___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-10 Thread Michal Hoftich
Follow-up Comment #8, bug #617 (project tex4ht):

BTW is it OK that the last code snippet in the TeX file, which contains HTML
tags, is inserted verbatim in the output? I thought that HTML tags should be
passed to the HTML output without escaping.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-10 Thread Michal Hoftich
Follow-up Comment #7, bug #617 (project tex4ht):

Yeah, it seems fine. I will update the TeX4ht sources then.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-09 Thread VítStarýNovotný
Follow-up Comment #6, bug #617 (project tex4ht):

Thanks. Your newly uploaded file fancyvrb.4ht seems to work fine, see also the
attached screenshot of the output for the example document of the Markdown
package.

(file #528)
___

Additional Item Attachment:

File name: scrot.png  Size:134 KB


___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-09 Thread Michal Hoftich
Follow-up Comment #5, bug #617 (project tex4ht):

Thanks for the report. I think this was caused by a fix for another issue:
https://github.com/michal-h21/make4ht/issues/141 

I've made a version of `\FVC@Verb` macro which works both with your example
and with the code from the Minted issue. The reason why we need to disable
\a:fancyvrb is that it causes discarding of all output that follows. This
happens because we need to get rid of some spurious characters and spaces that
would otherwise cause blank lines in HTML. So all of this is a bit hacky. 

See the newly uploaded fancyvrb.4ht file. If it works fine, I will update
TeX4ht sources.

(file #527)
___

Additional Item Attachment:

File name: fancyvrb.4ht   Size:5 KB


___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2024-01-09 Thread VítStarýNovotný
Follow-up Comment #4, bug #617 (project tex4ht):

With the Docker image `texlive/texlive:latest` from the last Sunday, I am
seeing the following errors [1] during the compilation of the example document
for make4ht [2]:

$ make4ht --shell-escape latex-tex4ht.tex fn-in
[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: latex-tex4ht.tex
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex:
/usr/local/texlive/2023/texmf-dist/tex/generic/tex4ht/fancyvrb.4ht  97  
 Illegal
parameter number in definition of \FVC@Verb.
[ERROR]   htlatex:
/usr/local/texlive/2023/texmf-dist/tex/generic/tex4ht/fancyvrb.4ht  98  
 Illegal
parameter number in definition of \FVC@Verb.
[ERROR]   htlatex:
/usr/local/texlive/2023/texmf-dist/tex/generic/tex4ht/fancyvrb.4ht  98  
 Illegal
parameter number in definition of \FVC@Verb.

 [1]:
https://github.com/Witiko/markdown/actions/runs/7459249826/job/20294884745
 [2]: https://github.com/Witiko/markdown/blob/main/examples/latex-pdftex.tex

I have not yet had the time to investigate the cause but it seems possibly
related to the fix from this ticket.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2023-12-12 Thread Michal Hoftich
Follow-up Comment #3, bug #617 (project tex4ht):

Hi Vítek, 

thanks for the confirmation. I've added this code to TeX4ht sources, so it
should be available in TeX Live soon.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2023-12-12 Thread VítStarýNovotný
Follow-up Comment #2, bug #617 (project tex4ht):

Hi Michal,

thanks for the speedy response. Your workaround works for me. 

Adding your config into a file `example.cfg` and running the commands `make4ht
-c example.cfg example-01.tex` and `make4ht -c example.cfg example-02.tex`
produces two HTML files with the following diff:

```
7,8c7,8
<  
<  
---
>  
> 
```

In other words, both the `Verbatim` LaTeX environment and the `\VerbatimInput`
LaTeX command produce the same HTML output and it is the correct one:

```
foo 
bar 
baz
```

>From where I stand, your workaround seems as a good candidate for adding to
the TeX4ht sources.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2023-12-11 Thread Michal Hoftich
Follow-up Comment #1, bug #617 (project tex4ht):

Hi Vítek, 

thanks for the report. I am pretty sure that \VerbatimInput worked in the
past, as I used it occasionally. I cannot find the place where spurious
newlines come from, so we need to use a work around - insert special TeX4ht
instructions to ignore characters and space. You can try this configuration
file:

\Preamble{xhtml}
\catcode`\:=11
\Configure{fancyvrb}
   {\IgnorePar \EndP \gHAdvance\fancyvrbNo by 1
\gHAssign\fancyvrb:cnt0
\HCode{}\ht:special{t4ht@[}}
   {x\EndP\ht:special{t4ht@]}\HCode{}}
   {\ht:special{t4ht@]}\gHAdvance\fancyvrb:cnt by 1
\ifnum \fancyvrb:cnt>1
\HCode{\Hnewline}\fi} {}
   {}{\ht:special{t4ht@[}}
\catcode`\:=12
\begin{document}
\EndPreamble


It seems to work for both Verbatim environment and \VerbatimInput. If it works
for you too, I will update TeX4ht sources.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



Re: [tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2023-12-11 Thread Nasser M. Abbasi




### Discussion

It seems that the issue stems from the lack of support for the
`\VerbatimInput` command in TeX4ht. However, the `\VerbatimCommand` is used to
input verbatim text in the LaTeX definitions of the Markdown package for TeX
and cannot be easily substituted with the `Verbatim` environment. A fix or a
workaround would be appreciated.


I can confirm the extra \n in the HTML version of the \VerbatimInput between
the lines.

But do you have to use \VerbatimInput? I have not myself used Verbatim
for years now, in pdf nor in HTML. I switched to listings
package for everything now. inline input and from file.

It works very well in pdf and HTML with tex4ht.

May be there is a way to renewcommand that \VerbatimCommand you
mentioned to use listings instead?

--Nasser





[tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2023-12-11 Thread VítStarýNovotný
URL:
  

 Summary: The fancyvrb LaTeX package produces blank lines with
the `\VerbatimInput` command
 Project: tex4ht
Submitted by: witiko
Submitted on: Mon Dec 11 16:36:17 2023
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

I am having an issue with undesirable double-spacing with the `fancyvrb` LaTeX
package and the TeX4ht typesetting system. Below, I outline the steps to
reproduce the problem and show the expected and actual outcome.

### Steps to reproduce

I create the following LaTeX document in a file named `example-01.tex`:

```
\documentclass{article}
\usepackage{fancyvrb}
\usepackage{hyperref}
\begin{document}
\begin{Verbatim}
foo
bar
baz
\end{Verbatim}
\end{document}
```

I also create the following LaTeX document in a file named `example-02.tex`:

```
\documentclass{article}
\begin{filecontents}[overwrite, nosearch, noheader]{example.foo}
foo
bar
baz
\end{filecontents}
\usepackage{fancyvrb}
\usepackage{hyperref}
\begin{document}
\VerbatimInput{example.foo}
\end{document}
```

Then, I typeset both documents in TeX4ht using the `make4ht example-01.tex`
and `make4ht example-02.tex` commands.

### Expected outcome

Identical HTML documents in files `example-01.html` and `example-02.html` are
produced and contain a code block with three lines of code.

### Actual outcome

Whereas the HTML document `example-01.html` contains a code block with three
lines of code, the code block in the HTML document `example-02.html` contains
an extra blank line after every line of code from the original LaTeX document
and totals six lines of code.

To show the difference between the two documents, here is the output of the
unix command `diff example-01.html example-02.html`:

```
7,8c7,8
<  
<  
---
>  
>  
10,12c10,16

> foo
>  
> bar
>  
> baz
>
```

### Discussion

It seems that the issue stems from the lack of support for the
`\VerbatimInput` command in TeX4ht. However, the `\VerbatimCommand` is used to
input verbatim text in the LaTeX definitions of the Markdown package for TeX
and cannot be easily substituted with the `Verbatim` environment. A fix or a
workaround would be appreciated.




___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/