Is there an easy way to do the dots of an o-umlaut in a different color than the o? I've already tried using the textcolor function in the color package, but I suspect that's the wrong way to go. I know I could just manually rotate and position some colored dots over an o, but I'm hoping someone has already implemented this sort of functionality in a package I just don't know about yet.
- 343
-
I assume there is some reason you want to do this: it may have a bearing on the answer, so would be handy to know. – Joseph Wright Mar 25 '14 at 20:48
-
1@JosephWright It's a design choice, mostly. I've designed a logo that has that color scheme, and being able to mimic it in typography would be nice. Also, I'm just really curious whether this has been done! – Kyle. Mar 25 '14 at 20:53
-
2Related: Coloring combining characters without changing color of a base character and Writing Biblical Hebrew texts with different coloring for consonants, vowel and accent signs. – J. C. Salomon Mar 30 '14 at 02:51
3 Answers
I come bearing cumlauts. If one looks closely, however, a slight size differential in dots is noted. One could remedy that if one were willing to spend the cycles to \scalebox the periods slightly smaller.
UPDATE: The MWE has been updated to highlight both the ability of the macro to work at different font sizes and to better reflect the obvious temperament of the readership.
\documentclass{article}
\usepackage{stackengine}
\usepackage{xcolor}
\newcommand\cumlaut[2][black]{\stackon[.33ex]{#2}{\textcolor{#1}{\kern-.04ex.\kern-.2ex.}}}
\begin{document}
\"o\"e\"a vs. \cumlaut[yellow]{u} \large\cumlaut[yellow]{u}
\Large\cumlaut[red]{o}\cumlaut[green]{e}\large\cumlaut[blue]{a}%
\normalsize\cumlaut[cyan!50]{a}\scriptsize\cumlaut[cyan!20]{a}
\end{document}

- 237,551
-
5"Cumlauts"? Seriously? I mean, there might be children interested in LaTeX! I don't think their parents would approve of your German cumsounds. – Christian Mar 25 '14 at 23:40
-
4@Christian It's a concatenation of "color" and "umlaut"! I thought it was clever, and give it my full endorsement! – Kyle. Mar 26 '14 at 00:25
-
3
-
1@cfr I guess that's why
\rlapand\llapwere never augmented with a "center" lap. Who would want it? – Steven B. Segletes Mar 26 '14 at 00:59 -
1http://tex.stackexchange.com/questions/278/can-i-use-clap-rlap-and-llap-in-math-mode? – cfr Mar 26 '14 at 01:39
-
2@Kyle I will just close by emphasizing that the macro name is one word, not two. – Steven B. Segletes Mar 26 '14 at 10:09
-
2Just to be clear, I wasn't serious. I'm all for colorful language in code. – Christian Mar 26 '14 at 11:25
-
1@Christian But the request was for colourful output! :-) ("Coutput"?) – David Richerby Mar 26 '14 at 17:33
-
3@DavidRicherby If you manage to find anything dirty in the word "coutput" then you've got much better association skills than I do. All I can think of is C++ which doesn't fulfill any definition of "sexy" that I can think of ;) – Christian Mar 26 '14 at 20:03
-
3@Christian I am reminded of the patient who sees all sorts of sexual imagery in the Rorschach ink blots with which he is being evaluated. The psychiatric evaluator diagnoses him with an acute sexual dysfunction of some sort. The patient is incensed, blurting out "why, don't blame me...you're the one who brought the dirty pictures." – Steven B. Segletes Mar 26 '14 at 20:39
-
1@StevenB.Segletes "Acute sexual dys..." Ok, what are you trying to tell me here? ;) – Christian Mar 26 '14 at 21:05
You can overlap the accented letter and the non-accented one using \rlap:
\documentclass{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{mathtools}
\let\umlaut\"
\newcommand\colorum[2]{\leavevmode{\rlap{\textcolor{#1}{\umlaut#2}}#2}}
\def\"{\colorum{red}}
\begin{document}
ab\"ab\colorum{blue}ob
AB\"AB\colorum{blue}OB
\end{document}
I re-defined \" to default to red, but it can be easily modified of course. In PDF viewers zoomed-out, the color seems to "leak behind the letter", zoomed-in and printed looks fine.
- 51,322
-
I wrote a similar answer, but was slower, so it's almost redundant. You do need the hspace thing I did before the rlap though (or something similar), because otherwise unlauts at the beginning of a paragraph doesn't work. – pst Mar 26 '14 at 00:21
-
One idea is to print a coloured "ö" and then a black "o" on top of it. An advantage with that approach is that you don't have to handtune the position of the dots. They will appear in the right place, even with an italic or cursive font.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{color}
\newcommand\twocolour[2]{\hspace*{0pt}\rlap{\textcolor{red}{#1}}#2}
\DeclareUnicodeCharacter{00D8}{\twocolour{\O}{O}}
\DeclareUnicodeCharacter{00F8}{\twocolour{\o}{o}}
\let\origdiaeresis\"
\renewcommand\"[1]{\twocolour{\origdiaeresis #1}{#1}}
\newcommand\test{\par
`Möbelträgerfüße' is a German word with some umlauts.
København is Copenhagen.
How about ``f\twocolour{i}{\i}sh'' (without the ligature in
``fish'').
}
\begin{document}
\LARGE
\test
\textit{\test}
\textsl{\test}
\end{document}
More accents and more special characters can be added if "needed".
- 4,674
