高亮文本之间的空白

高亮文本之间的空白

在这里,我使用 soul 包突出显示文本时遇到了挑战,突出显示行之间出现空白。应该关闭它,请提出任何解决此问题的选项:

注意:问题区域以红色标记在此处输入图片描述

梅威瑟:

\documentclass{book}

\RequirePackage{xcolor,soul}

\definecolor{bluelight}{cmyk}{0.15,0.01,0.01,0.0}
\definecolor{pinklight}{cmyk}{0.12,0.15,0.0,0.0}
\definecolor{greenlight}{cmyk}{0.10,0.01,0.29,0.0}

\def\bluehighlight#1{\protect\sethlcolor{bluelight}\hl{#1}}
\def\greenhighlight#1{\protect\sethlcolor{greenlight}\hl{#1}}
\def\pinkhighlight#1{\protect\sethlcolor{pinklight}\hl{#1}}


\begin{document}
\section{Overview}
Numerous videos
and interactivities are embedded just
where you need them, at the point of

\subsection{Links with our times}
When a new suburb is established today, roads and footpaths are built,
services such as water and electricity are connected, and underground
pipes are installed to take away sewage and
stormwater. All these facilities are
usually in place before any homes are built,
and even the construction of the
houses is governed by strict building regulations.
The situation was very
different two hundred years ago.

\bluehighlight{The biomedical model relies heavily on technology and trained
professionals to treat illnesses such as cardiovascular disease.}$^1$
\greenhighlight{These resources are expensive to establish and maintain.}$^2$ \pinkhighlight{The
biomedical model does not focus on people without cardiovascular
disease so healthy groups are not the health system making it dif
difficult to decrease Medicare benefits paid to treat these diseases.}$^3$
\bluehighlight{The social model of health aims to reduce the differences in
factors that result in higher rates of cardiovascular disease among
particular groups.}$^4$ This can be achieved by empowering individuals
and communities with the onset of cardiovascular disease, such
as tobacco smoking and obesity. \greenhighlight{This can reduce the prevalence
of cardiovascular disease, which in turn reduces the amount of
Medicare funding required to treat it.}$^5$

\end{document}

答案1

一个ulem基于的解决方案(因为我认为自定义它更容易,但它会破坏自动连字):

\documentclass{book}

\usepackage{xcolor}
\usepackage[normalem]{ulem}

\definecolor{bluelight}{cmyk}{0.15,0.01,0.01,0.0}
\definecolor{pinklight}{cmyk}{0.12,0.15,0.0,0.0}
\definecolor{greenlight}{cmyk}{0.10,0.01,0.29,0.0}

\newcommand*\highlightht{2.8ex}
\newcommand*\highlightdp{-.8ex}
\newcommand*\highlightwd{0.2ex}
\def\bluehighlight{\highlightcommon{bluelight}}
\def\greenhighlight{\highlightcommon{greenlight}}
\def\pinkhighlight{\highlightcommon{pinklight}}
\newcommand\highlightcommon[1]
  {%
    \bgroup
    \markoverwith
      {\textcolor{#1}{\smash{\rule[\highlightdp]{\highlightwd}{\highlightht}}}}%
    \ULon
  }


\begin{document}
\section{Overview}
Numerous videos
and interactivities are embedded just
where you need them, at the point of

\subsection{Links with our times}
When a new suburb is established today, roads and footpaths are built,
services such as water and electricity are connected, and underground
pipes are installed to take away sewage and
stormwater. All these facilities are
usually in place before any homes are built,
and even the construction of the
houses is governed by strict building regulations.
The situation was very
different two hundred years ago.

\bluehighlight{The biomedical model relies heavily on technology and trained
professionals to treat illnesses such as cardiovascular disease.}$^1$
\greenhighlight{These resources are expensive to establish and maintain.}$^2$ \pinkhighlight{The
biomedical model does not focus on people without cardiovascular
disease so healthy groups are not the health system making it dif
difficult to decrease Medicare benefits paid to treat these diseases.}$^3$
\bluehighlight{The social model of health aims to reduce the differences in
factors that result in higher rates of cardiovascular disease among
particular groups.}$^4$ This can be achieved by empowering individuals
and communities with the onset of cardiovascular disease, such
as tobacco smoking and obesity. \greenhighlight{This can reduce the prevalence
of cardiovascular disease, which in turn reduces the amount of
Medicare funding required to treat it.}$^5$

\end{document}

在此处输入图片描述

相关内容