lua-ul 在分页符前导致彩色线

lua-ul 在分页符前导致彩色线

老实说,我不知道如何重现这种情况,但我有以下示例,它会导致线条着色不正确 - 就在页面从第 1 页分页到第 2 页之前:

\documentclass[a4paper,11pt,english]{article}
\usepackage[margin=2.5cm]{geometry} % for margins on a A4paper
\usepackage[tracking=true,factor=1100,stretch=10,shrink=10]{microtype} % have some better layout of individual chars
\usepackage{fontspec}
\usepackage[shorthands=off,bidi=basic]{babel}
\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
\setmainfont{Liberation Sans}
\usepackage{xcolor} % for highlighting AND background images-color!!!

\usepackage{setspace} % use for line spacing (#399) [ since the factor between font size and baselineskip might become tricky]
\onehalfspacing % line spacing = 1.5 (#399) 
\usepackage{parskip} % #643: No indent for paragraphs but additional space between them

\usepackage{luacolor,lua-ul} %for usage of style attributes - background color
\definecolor{RGB2}{RGB}{35, 111, 161}
\definecolor{HTML3}{HTML}{bfedd2}
\definecolor{HTML4}{HTML}{ecf0f1}
\definecolor{HTML1}{HTML}{236fa1}
\definecolor{HTML5}{HTML}{34495e}

\begin{document}

Normal Text, 
{\huge{}with 18pt text}

Missing semicolon in 
{\huge{}style attribute with 18pt text}

Normal Text, 
{\tiny{}with 6pt text}

Normal Text, 
{\scriptsize{}with 8pt text}

Normal Text, 
{\footnotesize{}with 9pt text}

Normal Text, 
{\small{}with 10pt text}

Normal Text, 
{\normalsize{}with 11pt text}

Normal Text, 
{\large{}with 12pt text}

Normal Text, 
{\Large{}with 14pt text}

Normal Text, 
{\LARGE{}with 17pt text}

Normal Text, 
{\huge{}with 20pt text}

Normal Text, 
{\Huge{}with 25pt text}

Background Text, 
\highLight[{[RGB]{224, 62, 45}}]{in red color 

with line break} and regular text afterwards
Background Text,
\highLight[{[RGB]{224, 62, 45}}]{in red color 

with line break}and regular text afterwards but 
\bgroup{}\bfseries{}NO\egroup{} spaces

Background Text,
\highLight[{[HTML]{e03e2d}}]{in red color HEX values 

with line break}and regular text afterwards but 
\bgroup{}\bfseries{}NO\egroup{} spaces

Colored Text,
{\color{HTML1}{}in blue color HEX values 

with line break}and regular text afterwards but 
\bgroup{}\bfseries{}NO\egroup{} spaces

Colored Text,
{\color{RGB2}{}in blue color RGB values 

with line break} and regular text afterwards but 
\bgroup{}\bfseries{}NO\egroup{} spaces

Colored Text, 
{\color{RGB2}{} in blue color RGB values 

with line break}and regular text (and duplicated text color)

Colored enlarged Text, 
{\color{RGB2}{} in 

{\huge{}blue} color RGB values 

with line break}and regular text (and duplicated text color)

Beie\bgroup{}\bfseries{}lste\egroup{}xt

incorrect colored line % <-------------------- !!!!

Test z

\highLight[{[HTML]{7e8c8d}}]{ \&amp;\&lt;}

\end{document}

在此处输入图片描述

有办法解决这个问题吗?使用 luaHBTex 1.12.0、lua-ulV0.1.0 运行。

答案1

更新

这是一个错误,已在 的新版本中修复lua-ul。以下解决方法不再需要。

旧答案

这是一个lua-ul错误,但在修复之前你可以添加

\output\expandafter{\expandafter\LuaULResetUnderline\expandafter*\the\output}

在您的序言中解决这个问题:

\documentclass[a4paper,11pt,english]{article}
\usepackage[margin=2.5cm]{geometry} % for margins on a A4paper
\usepackage[tracking=true,factor=1100,stretch=10,shrink=10]{microtype} % have some better layout of individual chars
\usepackage{fontspec}
\usepackage[shorthands=off,bidi=basic]{babel}
\defaultfontfeatures{Ligatures=TeX} % to have the automatics ligatures of TeX
\setmainfont{Liberation Sans}
\usepackage{xcolor} % for highlighting AND background images-color!!!

\usepackage{setspace} % use for line spacing (#399) [ since the factor between font size and baselineskip might become tricky]
\onehalfspacing % line spacing = 1.5 (#399) 
\usepackage{parskip} % #643: No indent for paragraphs but additional space between them

\usepackage{luacolor,lua-ul} %for usage of style attributes - background color
\output\expandafter{\expandafter\LuaULResetUnderline\expandafter*\the\output}
\definecolor{RGB2}{RGB}{35, 111, 161}
\definecolor{HTML3}{HTML}{bfedd2}
\definecolor{HTML4}{HTML}{ecf0f1}
\definecolor{HTML1}{HTML}{236fa1}
\definecolor{HTML5}{HTML}{34495e}

\begin{document}
\showoutput

Normal Text, 
{\huge{}with 18pt text}

Missing semicolon in 
{\huge{}style attribute with 18pt text}

Normal Text, 
{\tiny{}with 6pt text}

Normal Text, 
{\scriptsize{}with 8pt text}

Normal Text, 
{\footnotesize{}with 9pt text}

Normal Text, 
{\small{}with 10pt text}

Normal Text, 
{\normalsize{}with 11pt text}

Normal Text, 
{\large{}with 12pt text}

Normal Text, 
{\Large{}with 14pt text}

Normal Text, 
{\LARGE{}with 17pt text}

Normal Text, 
{\huge{}with 20pt text}

Normal Text, 
{\Huge{}with 25pt text}

Background Text, 
\highLight[{[RGB]{224, 62, 45}}]{in red color 

with line break} and regular text afterwards
Background Text,
\highLight[{[RGB]{224, 62, 45}}]{in red color 

with line break}and regular text afterwards but 
\bgroup{}\bfseries{}NO\egroup{} spaces

Background Text,
\highLight[{[HTML]{e03e2d}}]{in red color HEX values 

with line break}and regular text afterwards but 
\bgroup{}\bfseries{}NO\egroup{} spaces

Colored Text,
{\color{HTML1}{}in blue color HEX values 

with line break}and regular text afterwards but 
\bgroup{}\bfseries{}NO\egroup{} spaces

Colored Text,
{\color{RGB2}{}in blue color RGB values 

with line break} and regular text afterwards but 
\bgroup{}\bfseries{}NO\egroup{} spaces

Colored Text, 
{\color{RGB2}{} in blue color RGB values 

with line break}and regular text (and duplicated text color)

Colored enlarged Text, 
{\color{RGB2}{} in 

{\huge{}blue} color RGB values 

with line break}and regular text (and duplicated text color)

Beie\bgroup{}\bfseries{}lste\egroup{}xt

incorrect colored line % <-------------------- !!!!

Test z\tracingall

\highLight[{[HTML]{7e8c8d}}]{ \&amp;\&lt;}

\end{document}

在此处输入图片描述

相关内容