bugtex4ht - Bugs: bug #647, Sections create empty paragraphs...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #647: Sections create empty paragraphs in ODT

Submitted by:  Jürgen Spitzmüller <jspitzm>
Submitted on:  Wed Feb 5 07:36:10 2025  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Thu Feb 6 16:13:20 2025, comment #12:

Exccellent. Then this can be closed.

Jürgen Spitzmüller <jspitzm>
Thu Feb 6 16:12:30 2025, comment #11:

Once the fix is in TeX distributions, you don't need to use the config file. It usually takes just a few days with TeX Live.

Michal Hoftich <michal_h21>
Project Member
Thu Feb 6 16:08:03 2025, comment #10:

Does this mean that one needs to explictly call this cfg file? I think the empty paragraphs shouldn't be there in the first place.

Jürgen Spitzmüller <jspitzm>
Thu Feb 6 16:05:20 2025, comment #9:

Great! I've added it to TeX4ht sources, so I guess we can close this now.

Michal Hoftich <michal_h21>
Project Member
Thu Feb 6 16:04:06 2025, comment #8:

Yes, this works.

Jürgen Spitzmüller <jspitzm>
Thu Feb 6 14:33:40 2025, comment #7:

Well, this is significant difference. KOMA redefines \@startsection, so it needs a special configuration too. Here is the updated .cfg file:

\Preamble{xhtml}

\makeatletter
\catcode`\:=11
\def\@startsection#1{\ifvmode\HCode{}\IgnorePar\fi\@ifstar{\Configure{secType}{like#1}}%
{\Configure{secType}{#1}}%
\:Sc1\:startsection{#1}}%

\newcommand*\scr:startsection[6]{\ifvmode\HCode{}\IgnorePar\fi\o:scr@startsection:{#1}{#2}{#3}{#4}{#5}{#6}}
\HLet\scr@startsection\scr:startsection
\catcode`\:=12
\makeatother
\begin{document}
\EndPreamble

Michal Hoftich <michal_h21>
Project Member
Thu Feb 6 06:56:05 2025, comment #6:

The crucial difference is that it uses KOMA (scrartcl), which has a specific section handling.

Jürgen Spitzmüller <jspitzm>
Wed Feb 5 12:58:22 2025, comment #5:

Does it fail with an error, or just extra paragraphs are added? Can you try to make a new MWE?

Michal Hoftich <michal_h21>
Project Member
Wed Feb 5 12:06:10 2025, comment #4:

It does in fact work with the simple sample file I posted here. It does not work with the much more complex real world example I currently edit. No idea why that might be.

Jürgen Spitzmüller <jspitzm>
Wed Feb 5 11:52:31 2025, comment #3:

I think you are doing it right. So you still get the extra paragraphs?

Michal Hoftich <michal_h21>
Project Member
Wed Feb 5 11:46:30 2025, comment #2:

The solution does not seem to work for me, but I might have done it wrong (saved the content to a file rempar.cfg and used that via make4ht -c rempar.cfg [and the other options]).

Jürgen Spitzmüller <jspitzm>
Wed Feb 5 09:44:04 2025, comment #1:

Thanks for the report. Some code at the beginning of paragraphs seems to be inserting spurious paragraphs. I cannot identify where, I am not even sure whether LaTeX or TeX4ht inserts it. Anyway, this configuration file should remove this extra paragraph:

\Preamble{xhtml}

\makeatletter
\catcode`\:=11
\def\@startsection#1{\ifvmode\HCode{}\IgnorePar\fi\@ifstar{\Configure{secType}{like#1}}%
{\Configure{secType}{#1}}%
\:Sc1\:startsection{#1}}%
\catcode`\:=12
\makeatother
\begin{document}
\EndPreamble

Michal Hoftich <michal_h21>
Project Member
Wed Feb 5 07:36:10 2025, original submission:

Each \section but the first one in the document seems to create an empty paragraph before the section itself. See attached sample. I think this shouldn't be there.

Jürgen Spitzmüller <jspitzm>

 

Attached Files
file #548:  sample.tex added by jspitzm (390B - text/x-tex)
file #549:  sample.odt added by jspitzm (7kB - application/vnd.oasis.opendocument.text)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by michal_h21 (Posted a comment)
  • -unavailable- added by jspitzm (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    3 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Feb 6 16:13:45 2025michal_h21Open/ClosedOpen=>Closed
    Wed Feb 5 07:36:10 2025jspitzmAttached File-=>Added sample.tex, #548
      Attached File-=>Added sample.odt, #549
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray