Discussion:
hl
(too old to reply)
db
2023-01-05 10:47:27 UTC
Permalink
In a LaTeX document, I can highlight bits of text using the
package color,soul and \hl{...} in the body. But this doesn't
work for citations, equations and maybe other things. How do I
hjghlight these?
--
Dieter Britz
Peter Flynn
2023-01-05 23:28:36 UTC
Permalink
Post by db
In a LaTeX document, I can highlight bits of text using the
package color, soul and \hl{...} in the body. But this doesn't
work for citations, equations and maybe other things. How do I
hjghlight these?
By "highlight" do you mean "change font" or "change color" or something
else?

If you use the xcolor package, you can specify a color for links, so
citations would change to that color.

I don't understand what highlighting an equation is meant to do? Make it
a different color?

Peter
db
2023-01-06 07:50:48 UTC
Permalink
Post by Peter Flynn
Post by db
In a LaTeX document, I can highlight bits of text using the
package color, soul and \hl{...} in the body. But this doesn't
work for citations, equations and maybe other things. How do I
hjghlight these?
By "highlight" do you mean "change font" or "change color" or something
else?
If you use the xcolor package, you can specify a color for links, so
citations would change to that color.
I don't understand what highlighting an equation is meant to do? Make it
a different color?
Peter
The package color,soul enables the markup \hl{...} which superimposes
a colour onto the text, in my case yellow, except for citations and
equations and probably other things. When you resubmit an article
to a journal after getting critical remarks from reviewers, you are
asked to provide a version with changes highlighted in this way, and
that might include equations.
--
Dieter Britz
Peter Flynn
2023-01-06 09:30:53 UTC
Permalink
Post by db
Post by Peter Flynn
Post by db
In a LaTeX document, I can highlight bits of text using the
package color, soul and \hl{...} in the body. But this doesn't
work for citations, equations and maybe other things. How do I
hjghlight these?
By "highlight" do you mean "change font" or "change color" or
something else?
If you use the xcolor package, you can specify a color for links, so
citations would change to that color.
I don't understand what highlighting an equation is meant to do? Make
it a different color?
Peter
The package color,soul enables the markup \hl{...} which superimposes
a colour onto the text, in my case yellow,
OK.
Post by db
except for citations and equations and probably other things.
Yes, \hl is only intended for static text, not more commands inside it.
Post by db
When you resubmit an article to a journal after getting critical
remarks from reviewers, you are asked to provide a version with
changes highlighted in this way, and that might include equations.
Ah, OK. You don't need soul for this, as xcolor already provides most of
what you want. The trick with equations (or anything bigger than a few
words) is to capture it into a box first, then highlight the box.

============================ test.tex ==========================
\documentclass{article}
\usepackage{xcolor,soul}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{test.bib}
\newsavebox{\HLbox}
\newenvironment{HL}{%
\setbox\HLbox=\vbox\bgroup\advance\hsize by-2\parindent}{%
\egroup\colorbox{yellow}{\box\HLbox}}
\fboxsep1pt
\begin{document}
This is some \hl{text} that was changed
\colorbox{yellow}{\parencite{latexguide}} and an inline equation
\colorbox{yellow}{\(E=mc^2\)}.

and displayed equations

\begin{HL}
\[E=mc^2\]
\end{HL}

\printbibliography
\end{document}
========================= test.bib ==============================
@book{latexguide,
author = {Marc {van Dongen}},
title = {{\LaTeX{} and Friends}},
publisher = {Springer},
address = {Berlin},
uri = {http://www.springer.com/us/book/9783642238154},
year = {2012},
isbn = {978-3-642-23815-4}}
=================================================================

Peter
Phillip Helbig (undress to reply)
2023-01-06 11:10:42 UTC
Permalink
Post by Peter Flynn
Post by db
Post by Peter Flynn
Post by db
In a LaTeX document, I can highlight bits of text using the
package color, soul and \hl{...} in the body. But this doesn't
work for citations, equations and maybe other things. How do I
hjghlight these?
By "highlight" do you mean "change font" or "change color" or
something else?
If you use the xcolor package, you can specify a color for links, so
citations would change to that color.
I don't understand what highlighting an equation is meant to do? Make
it a different color?
except for citations and equations and probably other things.
Yes, \hl is only intended for static text, not more commands inside it.
Post by db
When you resubmit an article to a journal after getting critical
remarks from reviewers, you are asked to provide a version with
changes highlighted in this way, and that might include equations.
Ah, OK. You don't need soul for this, as xcolor already provides most of
what you want. The trick with equations (or anything bigger than a few
words) is to capture it into a box first, then highlight the box.
In such cases, it makes sense to define a command to do the
highlighting, put the text to be highlighted into the argument of that
command, regenerate the paper, then, for your final version, redefine
the command to do nothing, rather than removing it from the text.
Dr Eberhard W Lisse
2023-01-06 16:09:16 UTC
Permalink
Why reinvent the wheel?

would latexdiff work?

el
Post by Phillip Helbig (undress to reply)
Post by Peter Flynn
Post by db
Post by Peter Flynn
Post by db
In a LaTeX document, I can highlight bits of text using the
package color, soul and \hl{...} in the body. But this doesn't
work for citations, equations and maybe other things. How do I
hjghlight these?
By "highlight" do you mean "change font" or "change color" or
something else?
If you use the xcolor package, you can specify a color for links, so
citations would change to that color.
I don't understand what highlighting an equation is meant to do? Make
it a different color?
except for citations and equations and probably other things.
Yes, \hl is only intended for static text, not more commands inside it.
Post by db
When you resubmit an article to a journal after getting critical
remarks from reviewers, you are asked to provide a version with
changes highlighted in this way, and that might include equations.
Ah, OK. You don't need soul for this, as xcolor already provides most of
what you want. The trick with equations (or anything bigger than a few
words) is to capture it into a box first, then highlight the box.
In such cases, it makes sense to define a command to do the
highlighting, put the text to be highlighted into the argument of that
command, regenerate the paper, then, for your final version, redefine
the command to do nothing, rather than removing it from the text.
db
2023-01-07 14:49:25 UTC
Permalink
Post by Dr Eberhard W Lisse
Why reinvent the wheel?
would latexdiff work?
That looks worth trying out, which I will.

Dieter
Post by Dr Eberhard W Lisse
el
Post by Phillip Helbig (undress to reply)
Post by Peter Flynn
Post by db
Post by Peter Flynn
Post by db
In a LaTeX document, I can highlight bits of text using the
package color, soul and \hl{...} in the body. But this doesn't
work for citations, equations and maybe other things. How do I
hjghlight these?
By "highlight" do you mean "change font" or "change color" or
something else?
If you use the xcolor package, you can specify a color for links, so
citations would change to that color.
I don't understand what highlighting an equation is meant to do? Make
it a different color?
except for citations and equations and probably other things.
Yes, \hl is only intended for static text, not more commands inside it.
Post by db
When you resubmit an article to a journal after getting critical
remarks from reviewers, you are asked to provide a version with
changes highlighted in this way, and that might include equations.
Ah, OK. You don't need soul for this, as xcolor already provides most of
what you want. The trick with equations (or anything bigger than a few
words) is to capture it into a box first, then highlight the box.
In such cases, it makes sense to define a command to do the
highlighting, put the text to be highlighted into the argument of that
command, regenerate the paper, then, for your final version, redefine
the command to do nothing, rather than removing it from the text.
--
Dieter Britz
Loading...