Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a diagram in which I need to indicate the difference between symbolic mathematics and English words (potentially to someone who doesn't know about it):

enter image description here

Colour works beautifully for making this distinction. Unfortunately, for the version that is going to go in a book, I can't use colour and have been told not to use greyscale (which was my first fallback). I've tried bold, but it looks pretty horrible and doesn't highlight the distinction terribly well:

enter image description here

(Also bold is bad because sometimes it has mathematical significance.)

Underlining just looks really horrible: enter image description here

I would be very grateful for any alternative suggestions on how to visually highlight symbolic material.

Source in case it's useful:

\documentclass{article}
\usepackage{xcolor}
\usepackage{framed}
\begin{document}

\definecolor{textual-colour}{rgb}{0,0,0}
\definecolor{symbolic-colour}{rgb}{0.2,0.2,0.9}
\newcommand{\marktextual}[1]{{\color{textual-colour}#1}}
\newcommand{\marksymbolic}[1]{{\color{symbolic-colour}#1}}

\begin{framed}
\marktextual{{If}  \marksymbolic{$K \leq G$} {and} {there} {are} {inclusions} \marksymbolic{$gKg^{-1}\leq K$}  {for} {every} \marksymbolic{$g\in G$}, {then} \marksymbolic{$K \triangleleft G$}: {replacing} \marksymbolic{$g$} {by} \marksymbolic{$g^{-1}$}, {we} {have} {the} {inclusion} \marksymbolic{$g^{-1}Kg\leq K$}, {and} {this} {gives} {the} {reverse} {inclusion} \marksymbolic{$K\leq gKg^{-1}$}.}
\smallskip

\marktextual{{The} {kernel} \marksymbolic{$K$} {of} {a} {homomorphism} \marksymbolic{$f:G\rightarrow H$} {is} {a} {normal}  {subgroup}: {if} \marksymbolic{$a\in K$}, {then} \marksymbolic{$f(a)=1$}; {if} \marksymbolic{$g\in G$}, {then} \marksymbolic{$f(gag^{-1}) = f(g)f(a)f(g^{-1}) =  f(g)f(g^{-1}) = 1$}, {and} {so} \marksymbolic{$gag^{-1}\in K$}. {Hence}, \marksymbolic{$gKg^{-1}\leq K$}  {for} {all} \marksymbolic{$g\in G$}, {and} {so} \marksymbolic{$K \triangleleft G$}. {Conversely}, {we} {shall} {see} {later} {that} {every} {normal} {subgroup} {is} {the} {kernel} {of} {some} {homomorphism}.}
\end{framed}\end{document}

Edit: while I was trying to keep this short, from the comments it looks like a little more explanation of the context is necessary. The text of the book says:

"At first sight, the most striking feature of mathematical language is the way in which it mixes material that looks as if it is drawn from a natural language with material built up out of idiosyncratically mathematical symbols. The distinction is illustrated in Figure 2.1."

Figure 2.1 looks like this:

enter image description here

share|improve this question
4  
For centuries math formulas have not been emphasized in any particular way other than using italics for the letters. –  egreg Jan 2 '13 at 18:07
    
@egreg: I've written a book on the language of mathematics and I'm trying to explain the difference between symbolic material and words to someone who doesn't necessarily know any maths. Italicisation isn't enough, because e.g. the various operators aren't clearly indicated as being symbolic. –  Mohan Jan 2 '13 at 18:07
    
Sorry, but I don't get it. Would this be only for some small examples? –  egreg Jan 2 '13 at 18:09
2  
@Mohan Perhaps a light grey background? –  egreg Jan 2 '13 at 18:14
2  
What about using other fonts? For example, sans serif math fonts or tt math fonts or even Euler fonts. –  Sigur Jan 2 '13 at 18:52

3 Answers 3

up vote 16 down vote accepted
+250

A solution with hf-tikz (requires two compilation runs):

\documentclass[a4paper]{article}  
\usepackage{framed}
\usepackage[customcolors]{hf-tikz}
\hfsetbordercolor{white}
\definecolor{vlgray}{rgb}{0.87 0.87 0.87}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref}

\newcounter{highlight}
\newcommand{\highlight}[1]{%
\stepcounter{highlight}\tikzmarkin{\thehighlight}(0.04,-0.1)(-0.04,0.3)#1\tikzmarkend{\thehighlight}%
}

\newcommand{\exampletext}{%
  If \highlight{$K \leq G$} and there are inclusions \highlight{$gKg^{-1}\leq K$} 
  for every \highlight{$g\in G$}, then \highlight{$K \triangleleft G$}: replacing 
  \highlight{$g$} by \highlight{$g^{-1}$}, we have the inclusion 
  \highlight{$g^{-1}Kg\leq K$}, and this gives the reverse inclusion 
  \highlight{$K\leq gKg^{-1}$}.

  The kernel \highlight{$K$} of a homomorphism \highlight{$f:G\rightarrow H$} is a 
  normal  subgroup: if \highlight{$a\in K$}, then \highlight{$f(a)=1$}; if 
  \highlight{$g\in G$}, then 
  \highlight{$f(gag^{-1}) = f(g)f(a)f(g^{-1}) =$}\penalty\relpenalty
  \highlight{$ f(g)f(g^{-1}) = 1$},
  and so \highlight{$gag^{-1}\in K$}. Hence, \highlight{$gKg^{-1}\leq K$} for all 
  \highlight{$g\in G$}, and so \highlight{$K \triangleleft G$}. Conversely, 
  we shall see later that every normal subgroup is the kernel of some homomorphism.}

\begin{document}
\hfsetfillcolor{white}
\begin{framed}
\exampletext
\end{framed}

\hfsetfillcolor{vlgray}
\begin{framed}
\exampletext
\end{framed}

Applied to \href{http://tex.stackexchange.com/questions/88977/putting-a-coloured-background-behind-text-without-adding-whitespace}{Putting a coloured background behind text without adding whitespace}:

Lorem ipsum \highlight{dolor} sit amet, \highlight{consectetuer} adipiscing elit, sed diam 

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam

\end{document}

The result:

enter image description here

share|improve this answer
    
The second use is a bit inappropriate, thus I didn't answered directly to that question. –  Claudio Fiandrino Jan 4 '13 at 8:41

Without using color for the formulas or a gray background, I don't see any good way for distinguishing between text and formulas. Boxing the formulas seems out of the question because it's really too heavy; underlining is, as you say, horrible.

A way out might be to present the same paragraphs typeset twice: one with blanks in place of the formulas, so by comparing the two images one can see what you're referring to.

\documentclass{article}
\usepackage{framed,calc}

\newcommand{\exampletext}{%
  If \marksymbolic{$K \leq G$} and there are inclusions \marksymbolic{$gKg^{-1}\leq K$} 
  for every \marksymbolic{$g\in G$}, then \marksymbolic{$K \triangleleft G$}: replacing 
  \marksymbolic{$g$} by \marksymbolic{$g^{-1}$}, we have the inclusion 
  \marksymbolic{$g^{-1}Kg\leq K$}, and this gives the reverse inclusion 
  \marksymbolic{$K\leq gKg^{-1}$}.

  The kernel \marksymbolic{$K$} of a homomorphism \marksymbolic{$f:G\rightarrow H$} is a 
  normal  subgroup: if \marksymbolic{$a\in K$}, then \marksymbolic{$f(a)=1$}; if 
  \marksymbolic{$g\in G$}, then 
  \marksymbolic{$f(gag^{-1}) = f(g)f(a)f(g^{-1}) =$}\penalty\relpenalty
  \marksymbolic{$ f(g)f(g^{-1}) = 1$},
  and so \marksymbolic{$gag^{-1}\in K$}. Hence, \marksymbolic{$gKg^{-1}\leq K$} for all 
  \marksymbolic{$g\in G$}, and so \marksymbolic{$K \triangleleft G$}. Conversely, 
  we shall see later that every normal subgroup is the kernel of some homomorphism.}

\begin{document}
\begin{framed}
\providecommand{\marksymbolic}[1]{\makebox[\widthof{#1}]{\hrulefill}}
\exampletext
\end{framed}

\begin{framed}
\providecommand{\marksymbolic}[1]{\mbox{#1}}
\exampletext
\end{framed}

\end{document}

enter image description here

Here is the same with

\providecommand{\marksymbolic}[1]{{\fboxsep=0pt\colorbox[gray]{0.9}{#1}}}

enter image description here

share|improve this answer
    
In case anyone else tries this: the reducedstrut from tex.stackexchange.com/questions/74459/… makes the the height of the great boxes a little more consistent. –  Mohan Jan 3 '13 at 18:04

The advise of "not to use greyscale" probably can be extended to the background, and personally I think so many gray boxes breaks the reading flow.

My proposal is use a clearly different fonts for the math and text modes, if needed, adjusting the size of math mode to look similar to text mode. Although one might think a higher size would highlight also the math mode, may be is only less readable. For example, for me with lxfonts look better the small font size:

MWE

\documentclass{article}
\usepackage{xcolor}
\usepackage{lxfonts} 
\renewcommand\rmdefault{cmr} 
\usepackage{framed}
\begin{document}
\newcommand{\marktextual}[1]{#1}
\newcommand{\marksymbolic}[1]{{\small#1}}

\begin{framed}
\marktextual{{If}  \marksymbolic{$K \leq G$} {and} {there} {are} {inclusions} \marksymbolic{$gKg^{-1}\leq K$}  {for} {every} \marksymbolic{$g\in G$}, {then} \marksymbolic{$K \triangleleft G$}: {replacing} \marksymbolic{$g$} {by} \marksymbolic{$g^{-1}$}, {we} {have} {the} {inclusion} \marksymbolic{$g^{-1}Kg\leq K$}, {and} {this} {gives} {the} {reverse} {inclusion} \marksymbolic{$K\leq gKg^{-1}$}.}
\smallskip

\marktextual{{The} {kernel} \marksymbolic{$K$} {of} {a} {homomorphism} \marksymbolic{$f:G\rightarrow H$} {is} {a} {normal}  {subgroup}: {if} \marksymbolic{$a\in K$}, {then} \marksymbolic{$f(a)=1$}; {if} \marksymbolic{$g\in G$}, {then} \marksymbolic{$f(gag^{-1}) = f(g)f(a)f(g^{-1}) =  f(g)f(g^{-1}) = 1$}, {and} {so} \marksymbolic{$gag^{-1}\in K$}. {Hence}, \marksymbolic{$gKg^{-1}\leq K$}  {for} {all} \marksymbolic{$g\in G$}, {and} {so} \marksymbolic{$K \triangleleft G$}. {Conversely}, {we} {shall} {see} {later} {that} {every} {normal} {subgroup} {is} {the} {kernel} {of} {some} {homomorphism}.}
\end{framed}\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.