Questions with this tag are about the uses, and also problems with using, the `soul` package for letterspacing, underlining, overstriking and highlighting, perhaps also using colour.

learn more… | top users | synonyms

23
votes
7answers
11k views

Highlight text in code listing while also keeping syntax highlighting

I’m using the listings package for code listings. Now I try to highlight some part of the code using \hl from the soul package. Here’s an example of a resulting query where the injected part of a SQL ...
32
votes
6answers
1k views

Underline just words, not the space between them

I need to typeset a sentence such that just the words are underlined, and not the space between the words. Using the \underline will include the spaces between the words. I could do it with something ...
0
votes
0answers
44 views

LaTeX Template shows up reconstruction failed with soul package

This is my first time here. I recently downloaded a cool template online and when I try using it, I jeep getting this error message saying "reconstruction failed with soul package". I searched for ...
0
votes
0answers
31 views

How to highlight accented characters in pdflatex?

I tried using soul package and hl{word inside with an accent such as é} but they simply can't be rendered in pdflatex. I tried lualatex or xetex and it worked, BUT on the downside a lot of other ...
3
votes
0answers
44 views

Line breaks in underlined citations

I've been looking for a solution to automatically highlight citations to the works of a specific author using biblatex, but the question is still unanswered and I'm lacking time at the moment to ...
1
vote
1answer
23 views

strikeout Cyrillic text with latex

I am trying to use the soul package to strike out Cyrillic letters. Instead of the letters being stroked out weird characters are shown. \documentclass[12pt]{article} \special{papersize=3in,5in} ...
5
votes
1answer
37 views

make soul highlight span lines

The \hl command from the soul package highlights spans of text with a backround color when color is loaded. When used on longer spans of text, some inter-line spacing remains uncolored, which is ...
2
votes
1answer
31 views

cleveref and ulem/soul compatibility

I'm trying to use uwave and cleveref together: \documentclass{article} \usepackage{ulem} \usepackage{cleveref} \begin{document} \uwave{\cref{sec:A}} \section{A} \label{sec:A} \end{document} After ...
1
vote
1answer
71 views

using soul to highlight only text and math while skip any other macro

I try to highlight large paragraph of text, where there are various other macros such as \cite, \SI, \ref, etc. in between. If I do something like the following: \hl{the duration is \SI{4}{\second} ...
14
votes
2answers
9k views

How to make \hl (highlighting) to automatically place incompatible commands in \mbox?

The soul package provides a useful command \hl for highlighting text. However, \cite, \ref, and some other commands (maybe equations too) must be placed within an \mbox in order for \hl to work ...
4
votes
0answers
38 views

Kerning issue in soul \hl with \emph

The text is little squashed when using \hl with \emph, but only with particular words which makes me think this is a kerning issue? \documentclass{article} \usepackage{color} \usepackage{soul} ...
5
votes
1answer
216 views

How to reliably switch the highlighting color with soul?

In my document I need to use different colors for highlighting text. The soul package provides yellow coloring by default. The color can be switched with the \sethlcolor command. However, this does ...
4
votes
1answer
166 views

Streamline use of Highlight in text and equations

I have been highlighting certain parts of text in order to make it easier for me to search through a long document to find parts that need expanded on or some sort of work is left to do; however, I've ...
4
votes
1answer
59 views

Soul package and input encoding

I have the following code: \documentclass{article} \usepackage[english,greek]{babel} \usepackage[utf8]{inputenc} \usepackage{kerkis} \usepackage{color,soul} \setul{0.1cm}{0.2ex} \setulcolor{red} ...
0
votes
1answer
170 views

using the soul package with equations

I use the soul package to highlight some changes in my documents for review purposes. However I can't get it to work with equations (or other environments for that matter). Basically I create a ...
2
votes
1answer
92 views

Extra spaces problem when using soul package combined with cite package to highlight citation

When I use the soul package combined with the cite package to highlight some text that contains tilde and citation (e.g. \hl{Ref.~\cite{xyz}}, I get unwanted extra space between the word "Ref." and ...
0
votes
0answers
82 views

Box highlighting of text with rounded corners (soul-based)

Here it is an excellent solution from Gonzalo Medina. Could somebody help me to make it with nice small rounded courners?
7
votes
2answers
115 views

How to use inter letter space for justified alignment?

I have a long sanskrit compound taking up almost a line, but leaving a small space at the right margin empty, too small for the first syllable of the next word, thus breaking the justified alignment. ...
0
votes
0answers
41 views

Equations (align) with SOUL and CHANGES [closed]

Is it also possible to add markups for equations (created with align) by use of soul and changes package? The used Code is: \usepackage{soul} \soulregister\align7 % für highlighten von \align ...
2
votes
0answers
89 views

Changes package - highlight and strikethrough

I am working with the changes and soul package. Highlighting DELETED passages works well with \sethcolor and hl command: \setdeletedmarkup{\sethlcolor{green}{\hl{#1}}} Is it possible to combine the ...
0
votes
0answers
27 views

Use of ednotes and soul together - not working!

I am new to LaTeX and I have a problem with using ednotes and soul together. I want a text to be spaced, but also to add a note to it. \documentclass[10pt,a4paper]{book} ...
2
votes
1answer
102 views

cross out the text in the section title

It seems that \st{} for crossing out a text (strike through) doesn't work on the section title. For example, this \documentclass{article} \usepackage{soul,color} \begin{document} ...
3
votes
4answers
457 views

How to continue thick underline beyond text?

Here's my code: \documentclass[12pt]{article} \usepackage{soul} \begin{document} \setul{}{2pt} \ul{\Huge\textbf{Some text}} \underline{\Huge\textbf{Some text \hspace{1in}}} \ul{\Huge\textbf{Some ...
2
votes
1answer
106 views

Color highlighting with soul package does not work well with ligatures

The picture below says it all. Color highlighting with the soul package prevents a correct rendering of the ff ligature. Is there a way to fix this? \documentclass{article} \usepackage{color, soul} ...
2
votes
0answers
172 views

Highlighting words with special characters using \hl (soul)

I am using xelatex, polyglossia and the document is in UTF-8 encoding. I use the soul package to highlight words (using soulutf8 makes no difference). The problem is really weird, so I will go ...
4
votes
1answer
92 views

Why highlighting math with soul doesn't combine with l2tabu option for the nag package?

I have found that highlighting mathematical formulas with soul package does not work if the nag package is used with l2tabu option. A minimal (not) working example is: \documentclass{book} ...
2
votes
0answers
149 views

soul for text highlighting, microtype for letterspacing, and xspace: incompatibility

I am trying to use soul for highlighting text and microtype for letter spacing (and other things). But I cannot get the two to work together nicely when I include xspace (I use this mainly for ...
1
vote
0answers
104 views

soul package for wavy underline with bidi does not compile

I am using the soul+tikz code provided by Gonzalo Medina in Red squiggly imitation to get a wavy underline All works well until I include the raqgged2e and bidi packages. At compile time I get ! ...
2
votes
1answer
81 views

How to customize the highlight height with soul

Is it possible to customize the height of the highlighting with the soul package? \documentclass{article} \usepackage{soul} \usepackage{xcolor} \begin{document} \hl{game} \end{document} I would ...
20
votes
3answers
1k views

French accents in \hl from soul package

I'd like to use the \hl command from the soul package in a French text. However, it does not work whenever the part to highlight contains French accents (e.g.: \hl{é}). I could use \'e instead of é ...
7
votes
1answer
136 views

soulutf8 strips characters from compound words

I use soulutf8 for underlining in my LaTeX document. However, it seems to be stripping characters from the end of compound words, e.g.: \ul{$n$-rozměrný} results in n-rozměrn However, if I ...
6
votes
1answer
136 views

ragged2e breaks soul package \textbf{} spacing

If you compile the XeLaTeX below you will see the output is not-as-expected for the bold part of the text i.e. it is: underline underline boldboldbold In other words the spacing of the bold elements ...
8
votes
1answer
730 views

math equation with underline has different heights

I struggle with some equations in my research paper. I want to underline some variable, because they are complex, but if I use \underline the line is not at the same level in my example: ...
9
votes
1answer
373 views

Mixing underline and strike-out

Word allows for all kinds of font formatting: The above example combines strike-through/strike-out (like this) and underlining. I'd like to be able to do the same, but neither ulem nor soul allows ...
1
vote
0answers
116 views

Soul package and spacing problems

Similar problems with soul package can be found here and here. But since my problem is simpler than those (even related with spacing) I guess that it could have a simpler solution. The problem ...
10
votes
2answers
440 views

Follow-up: Underline + strike-through using soul

This is a follow-up question to Mixing underline and strike-out. This time, I'm specifically interested in an implementation using soul (that doesn't require multiple compilations to stabilize). I ...
3
votes
3answers
294 views

How to improve this text highlighting?

I want to highlight some letters which represent an amino acid sequence of a protein using different colors. The below code works fine, but the highlighted box is not fitting exactly the letters, as ...
6
votes
2answers
400 views

Changing fontsize within soul underline

This question is related to How to create a newcommand for fontsize?. I would like to change the fontsize within \ul of the soul package. For example: ...
1
vote
1answer
179 views

Soul letterspacing in memoir sections with \setsecheadstyle

I realize I have asked almost the same question earlier. There, the answer involved xparse or titlesec. Titlesec however gets into conflicts with memoir's pagestyles (running header settings, ...
3
votes
2answers
280 views

Page citation in soul

I'm using the soul package. This works: \ul{lorem ipsum} This doesn't work: \ul{lorem \cite{foo} ipsum} This does work: \ul{lorem {\cite{foo}} ipsum} Neither of these works: \ul{lorem ...
47
votes
2answers
16k views

Why does underlined text not get wrapped once it hits the end of a line ?

Sometimes I want to underline some text, and it extends past the end of a line. Why does \underline{} not automatically wrap my text for me ? Also, how can I underline text so that it will still ...
12
votes
1answer
1k views

Why is it that coloring in soul in beamer is not visible

\documentclass{beamer} \usepackage{soul,color} \begin{document} \begin{frame} \hl{Hello World} \end{frame} \end{document} I process this with pdflatex and I do not see the expected highlight. ...
2
votes
1answer
103 views

Using multiple { and }

It seems that using multiple {{{ and }}} causes some problem to the latex document. Assume this line \usepackage{color,soul} \begin{document} something \hl{I am referring to \cite{publi}} is good. ...
2
votes
0answers
66 views

No room for a new \dimen despite of loading etex [duplicate]

After upgrading to TeX Live 2013 one of my books does not compile any longer. I do load etex, but still have not enough room. What can I do? Back in 1994 I had a colleague who hacked the LaTeX source ...
3
votes
1answer
156 views

Strikethrough Cyrillic text in XeTeX preserving hyphenation

I was looking for the way to create a strikeout text in XeTeX. After some googling I found two packages that supposedly could do that: ulem and soul. However, it turned out that both of them have some ...
5
votes
1answer
1k views

Underline text with background (soul and ulem nesting)

I'm using soul's \hl to set background for the paragraph parts and ulem's \uline to underline text. The problem is what I cant underline text for text with background. Initial doc: ...
13
votes
2answers
271 views

Soul's underline misses text produced by a macro

The macro ul provided by soul works great, allowing linebreaks within an underlined text block. It even supports macros - if they were registered with soulregister. But if these registered macros ...
2
votes
1answer
212 views

Using latexdiff to highlight changes: alternatives for soul?

I am using latexdiff to create a pdf that highlights changes between two .tex along with hg diff latex, so as to use with Mercurial. However, the problem is that the the strikethrough formatting ...
9
votes
2answers
699 views

Extending underline up to the right side

I need to create command that underlines some given text that takes several lines. And the underline of the last line should be extended up to the right side of page. When I need just to underline ...
0
votes
0answers
27 views

Highlighting SI: “invalid-token-in-number” [duplicate]

I need to highlight some parts of code containing both text and numbers using the siunitxpackage but I get an invalid-token-in-number, the token being a number! Here's my mwe: ...