LyX ⇒ Changing equation number colour
-
- Posts: 4
- Joined: Thu Sep 10, 2015 10:59 am
Changing equation number colour
*I explain to the reader early on that I use these notes for discussions that are too long for footnotes, but need to be differently coloured to indicate the sentences immediately after them follow from those immediately before. For example, "it can be shown that X; grey proof of X; one corollary of X is..."
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: Changing equation number colour
Can you give us some example code how you're creating these multi line equations? Maybe some minimal LyX document? You could attach it to your next post.
Regards
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Changing equation number colour
-
- Posts: 4
- Joined: Thu Sep 10, 2015 10:59 am
Re: Changing equation number colour
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Changing equation number colour
-
- Posts: 4
- Joined: Thu Sep 10, 2015 10:59 am
Changing equation number colour
Code: Select all
%% LyX 2.1.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[british]{report}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{color}
\definecolor{note_fontcolor}{rgb}{0.800781, 0.800781, 0.800781}
\usepackage{babel}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
{hyperref}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% The greyedout annotation environment
\newenvironment{lyxgreyedout}
{\textcolor{note_fontcolor}\bgroup\ignorespaces}
{\ignorespacesafterend\egroup}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{xcolor}
\renewcommand\theequation{\arabic{section}.\arabic{equation}}
\renewcommand{\[}{\begin{equation}}
\renewcommand{\]}{\end{equation}}
\makeatother
\begin{document}
\section{A minimal example in the report standard class}
First I work with ``normal'' black text. This is an equation:
\[
a=b.
\]
Here are two equations:
\begin{eqnarray}
c & = & d,\\
e & = & f.
\end{eqnarray}
\begin{lyxgreyedout}
My problem has always been that the following equation numbers are
black, whereas I would prefer them to be the colour of this greyedout
environment:
\begin{eqnarray}
i & = & j,\\
k & = & l.
\end{eqnarray}
I wrote this minimal example to try to illustrate that, despite that
problem, single-line equation environments had grey numbers. For whatever
reason, now even they have black numbers, viz.
\[
g=h.
\]
How can I make equation numbers grey in greyedout environments?%
\end{lyxgreyedout}
\end{document}
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Changing equation number colour
eqnarray
environment has several issues, it is recommended not to use it. Using amsmath (or rather mathtools for some extra features) you can use align
for the very same functunality.Code: Select all
\documentclass[british]{report}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{xcolor}%note the x
%\definecolor{note_fontcolor}{rgb}{0.800781, 0.800781, 0.800781}
\colorlet{note_fontcolor}{gray}
\usepackage{babel}
\newenvironment{lyxgreyedout}
{\textcolor{note_fontcolor}\bgroup\ignorespaces}
{\ignorespacesafterend\egroup}
\usepackage{xcolor}
\renewcommand\theequation{\arabic{section}.\arabic{equation}}
\renewcommand{\[}{\begin{equation}}%really really not recommended
\renewcommand{\]}{\end{equation}}
\usepackage{mathtools}
\begin{document}
\section{A minimal example in the report standard class}
First I work with ``normal'' black text. This is an equation:
\[
a=b.
\]
Here are two equations:
\begin{align}
c &= d,\\
e &= f.
\end{align}
\begin{lyxgreyedout}
My problem has always been that the following equation numbers are
black, whereas I would prefer them to be the colour of this greyedout
environment:
\begin{align}
i &= j,\\
k &= l.
\end{align}
I wrote this minimal example to try to illustrate that, despite that
problem, single-line equation environments had grey numbers. For whatever
reason, now even they have black numbers, viz.
\[
g=h.
\]
How can I make equation numbers grey in greyedout environments?%
\end{lyxgreyedout}
\end{document}
btw: Redefining
\[
isn't really a good idea. It works, but it is really against convention.-
- Posts: 4
- Joined: Thu Sep 10, 2015 10:59 am