Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [highlighting]

{highlighting} is about highlighting document elements. Use this tag in addition to other tags specifying what should be highlighted.

1
vote
1answer
36 views

how can we highlight a long title?

I want to highlight my title with a certain color. My title is long and it lays in 3 lines. How can I create a colorbox for the title? \title{My Desired Title} conflicts with the command \hl.
2
votes
1answer
36 views

\hl with custom color and linebreak and math

I want to highly text which contains math in shades of grey with allowing for linebreaks. Based on this excellent post, I tried: \documentclass{article} \usepackage{xcolor} \usepackage{soul} \...
3
votes
2answers
56 views

Expand macro inside lstlisting and apply syntax highlighting

I'm wondering if there's a way to expand a macro inside a lstlisting environment which automatically applies syntax highlighting to the expanded text. For example, the listing in \documentclass{...
0
votes
0answers
42 views

Highlighting and un-highlighting several rows of a table at once in Beamer

I have the following table in beamer class \documentclass[svgnames]{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[french]{babel} \definecolor{MyBackground}{RGB}{255,253,...
0
votes
0answers
14 views

How to highlight C/C++ header file names with the listings package? [duplicate]

C/C++ header files can be given in two forms: <foo> or "foo". For example: #include <iostream> #include "myheader.hpp" By default, listings does not recognize the first form, and regards ...
1
vote
1answer
36 views

Change “et al” in bibliography in case that contain one specific author in there

I am trying to change the et~al. that appears in the bibliography in the case that inside the extra (et~al) authors there is an author that I am trying to make bold in the bibliography using the ...
0
votes
0answers
42 views

How to use \discretionary inside soul's \hl?

\documentclass{article} \usepackage{soul} \usepackage{color} \begin{document} Some \hl{te\discretionary{-}{-}{-}xt}. \end{document} The above does not compile due to Missing { inserted, Improper ...
2
votes
2answers
53 views

losing ligatures when switching font series or color in the middle of a word

For pedagogical purposes, I would like to highlight some characters in a word, through bold or red color or whatever will work. Because I use handwriting fonts (German Schulschriften wedn and French ...
0
votes
0answers
105 views

How to highlight text containing citation and figure referencing?

I am trying to highlight a text with reference. Without references, the below works fine. Could anyone know how to handle the highlighting the text containing citation and figure references? MWE is ...
0
votes
0answers
90 views

Multi-line text highlight with \cite

Basically want to mimic highlight function of Word or pdf. Need to highlight Need to be multi-line able to cite Not properly working MWE (taken from here and modified): \documentclass[5p,hidelinks]{...
3
votes
2answers
62 views

How to use the global definition of a variable in a command where that variable has already been defined?

I was trying to highlight some text, which contains \x, using the \hl command from the soul package, where \x is simply defined as \def\x{\mathbf{x}}. However, I've found that \x has already been ...
2
votes
1answer
58 views

Enable highlighting and auto-line-breaking for texttt{}

I'm using the following command to modify texttt{} so that it automatically breaks long lines (without inserting a hyphen), and it's very helpful when writing documents where I have to write lengthy ...
1
vote
0answers
60 views

How can I highlight text in the middle of sentences

I want to be able to present short code in the middle of a sentence. How can I highlight text in the middle of sentences in Latex so it they appear as code. Consider this example For this purpose ...
2
votes
0answers
24 views

How do I keep morekeywords from being highlighted in a comment?

Say I have the following listing style: \lstdefinestyle{custCpp}{ language=c++, keywordstyle={\bfseries}, % keyword color keywordstyle = [2]{\color{blue}\bfseries}, otherkeywords = {...
1
vote
1answer
67 views

How can I achieve writing text in latex thesis/report in highlighting block?

I want to highlight some text in a block just as we are able to do so in latex beamer template or as we can see notes section in many books which has a box highlighted and perhaps have different ...
0
votes
1answer
91 views

How to highlight deleted text in the PDF output generated by compiling latexdiff

For the purposes of showing corrections to a PhD thesis, I am using latexdiff to produce a PDF showing the difference between the original and the new version. My examiner has requested me to not ...
0
votes
1answer
61 views

How can I use `\uline` from the `ulem` package to underline text inside a `\colorbox`?

Screenshot: I have the following code: \uline{No underlining for \colorbox{lightgray}{everything} inside the colorbox.} Which looks like this: How can I get a continuous line for the text inside \...
2
votes
0answers
67 views

Dynamically Highlight Active Hypertarget

Is it possible to [dynamically] highlight the active hypertarget in a pdf document? I am using LaTeX (with the bookmark package) to create a pdf document (via dvips and ps2pdf) with many pages of ...
1
vote
0answers
39 views

Listing parenthesis highlighting [duplicate]

I'm using the listings package to insert code into the document. My research led me towards the literate option of listings to control operator highlighting. I have one issue - the right round bracket ...
1
vote
0answers
49 views

soulutf8 doesn't work with Cyrillic in XeLaTeX

I'm trying to highlight a text written in Russian using soulutf8 package. In the PDF file, rendered with XeLaTeX, instead of highlighted Russian letters, I've got nothing. With English symbols, it ...
4
votes
1answer
442 views

Highlight/color a part of text in block in beamer

I am using beamer in Latex to make a presentation. I use a block for definition like: \begin{block}{P1} \justifying Some text here \end{block} Let us say I wish to highlight a word "Some". By ...
1
vote
1answer
132 views

Highlighting part of equation with text underneath

I am trying to use this but change the text to be down and to be not divided but I did not know how to alter the code. Any help?
3
votes
1answer
207 views

Line break long verbatim text with highlighted background

I created an MWE-look-alike in the original document then 'background highlighted' (somehow 'highlight' means something else in verbatim) some text to show where/what to focus on. This MWE-look-alike ...
2
votes
1answer
108 views

White space between hightlight tex [duplicate]

Here I faced challenge in highlighted text using soul package, when highlighting white space occurs in between lines. It should be closed up, please suggest any option for fixing this issue: Note: ...
1
vote
1answer
50 views

soulutf8 highlight turn on/off

I have an issue with the soul package (and soulutf8). In order to easily turn on/off highlighting text (\hl{<text>}), I have defined a counter highlighter, that is either set to 0 (highlighting ...
4
votes
1answer
273 views

How do I highlight a term with an underbrace?

I would like to highlight my equation in this way: I'm using an align environment. Could you help me?
1
vote
2answers
520 views

Add grey background to inline text

I want to make several words with a grey background like this within normal text? Like with \colorbox{yellow}{\lstinline{some text here}} but grey instead of yellow. How to do that?
1
vote
0answers
57 views

Visually highlight portions of a document

I'm looking for a possibility to visually highlight entire portions of a document. It could be a paragraph or entire pages. Ideally by changing the background color, but it could also be a colored bar ...
6
votes
3answers
657 views

How to highlight a portion of Matlab Code

Consider following code posted for What can I use to typeset MATLAB code in my document? \documentclass{article} \usepackage[T1]{fontenc} \usepackage{bigfoot} % to allow verbatim in footnote \...
6
votes
4answers
242 views

Is there some way put boxes around matrix elements without too much effort?

I know this question has been asked before but the examples that they give are too complicated to replicate, for example. Is there some way to make boxes like these (dashes are not necessary but ...
0
votes
0answers
42 views

Context related code highlighting with t-vim

Notice that \inlinec{\n} represents only a single character. An escape sequence like \inlinec{\n} provides a general and extensible mechanism for representing hard-to-type or invisible characters. ...
4
votes
3answers
1k views

\hl command is underlining instead of highlighting

How can I highlight the dollar currency symbol? For some reason, the code below is underlining rather than highlighting when I try it. \documentclass{article} \usepackage{soul} \begin{document} \hl{\...
3
votes
2answers
121 views

How to highlight a line of text (with colored background) with animation in beamer?

There are several ways to highlight a line of text with colored background in beamer, for example, using framed or mdframed. How to animate this highlight, i.e., filling the background color from ...
1
vote
1answer
68 views

Higlight a desired “n-th” author in \fullcites in cleanthesis?

I have found different answers about highlighting authors in biblatex in the bibliography but not so much in specific citations. I have different \fullcite{Label} commands along a text where I show ...
0
votes
1answer
315 views

Highlight code in lstlisting

I would like to highlight code in a listlisting environment. I tried two techniques: using \usepackage{lstlinebgrd} and using \usepackage{color} (based on this conversation) but none really match what ...
1
vote
3answers
116 views

Highlighting certain parts of matrix without TikZ

I have a matrix, given in the following snippet: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{blkarray} \begin{document} \begin{equation} \begin{...
0
votes
0answers
51 views

How to highlight a math box in Lyx?

Is there a way to highlight a math box in Lyx? Something like this for example?
3
votes
0answers
256 views

Syntax highlighting of (Cisco) terminal

I want to highlight a complete terminal flow, mostly for the Cisco CLI, but Bash would be nice, too. As for now, the result achieved with the package lstlisting looks as follows: I achieved that with ...
6
votes
2answers
69 views

listings: highlight a prefixed keyword starting with a single quote

This is about Rust and their lifetime notation: \documentclass[crop,varwidth]{standalone} \usepackage{listings} \usepackage{xparse} \usepackage{expl3} \usepackage[svgnames]{xcolor} \def\noprint#1{} ...
0
votes
0answers
59 views

What can cause page counter to reset without using setcounter?

I have a document in which the displayed page number goes from 8 on the 8th page to 0 on the next page. Unfortunately I cannot provide the code because the document is confidential and when I replace ...
3
votes
1answer
352 views

How to highlight a `enumerate` environment in latex?

This is a continuation of this question. The following code works very well to highlight a paragraphs(and inline texts too). \makeatletter \newcommand{\hl}[1]{% \setbox\@tempboxa\hbox{#1}% \...
4
votes
2answers
255 views

How to highlight some inline text using parbox?

I have some paragraphs to highlight for later edit in my latex document. For that I use the following code \newcommand{\hl}[1]{\noindent\colorbox{pink}{\parbox{\dimexpr\linewidth-2\fboxsep} {#1}}} ...
1
vote
1answer
152 views

Equation in Beamer customized with beamerhighlight

I would like to replicate for this code: \documentclass[10pt]{beamer} %\usepackage{etex} \usepackage[utf8]{inputenc} \usepackage[TS1,T1]{fontenc} \usepackage{xspace} \usepackage{amsmath,amssymb} \...
4
votes
2answers
413 views

Highlight elements in the matrix in tikz

I have a matrix and need to highlight some elements in the matrix as in the example. Thanks \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{calc,arrows,automata,positioning} \usepackage{...
2
votes
1answer
222 views

Background colouring (highlighting) for maths formula in Lyx?

I want to highlight selected maths formulas in Lyx. Is there a simple way of doing this from the GUI ? I have tried selecting and right-clicking -> Text style , but that seems to change the font ...
8
votes
1answer
221 views

Words with swedish letters don't show in \hl{}

I want to highlight a Swedish word with \hl{en kassör}, but the word kassör just disappears and only en is highlighted. I use the pdfLaTex compiler in v2 Overleaf. I use the following code: \...
2
votes
1answer
360 views

Highlight parts of a text piecewise in beamer

I'm about to write a presentation with beamer and want to show a complete sentence first. After that I'd like to highlight one or more words in that sentence to explain them. My current approach is ...
3
votes
1answer
96 views

How to make a soul driver draw two lines at once (one above and one below text)

This is a follow up question from Box highlighting of text with rounded corners (soul-based). The desired end result is a sort of "circled text", as one would do if annotating a text with a pencil. I ...
8
votes
2answers
172 views

Environment to change background color of a portion of the page, vertically defined by the height of the contents of the environment?

I am trying to highlight some portions of a document. These portions can be paragraphs, images, equations and – quite importantly – list items. The highlighting should preferrably happen by a ...
0
votes
1answer
145 views

Highlight specific authors in the bibliography and citations declaring their names as commands using biblatex

I want to be able to define a list of authors in a command and highlight them in the bibliography or citations. I am using biblatex with my latex document (I have not been able to update my OS lately ...