175

I know this question has been answered very extensively. But not what I wanted or thought was the question based on the title. Therefore if others get in here looking for a possibility for colouring behind a word than this snippet is much easier: \colorbox{blue!30}{blue} or \textcolor{blue!30}{blue} resulting in: This is possible by only adding \...


37

The \ul command from the soul package has troubles with Umlauts -- the \uline command from the ulem package doesn't and therefore seems to be the better option for those not exclusively writing in English.


36

Best package for the job is manuscript \documentclass{article} \usepackage{manuscript,lipsum} \begin{document} \lipsum[1-3] \end{document}


34

Simply because I found it useful here is a modification of Stefans answer above that lets you control the depth, thickness and width of the underline. This might be useful, for example, with a larger or bolder font. The syntax is: \varul<width>[depth][thickness]{stuff} where: <width> is optional and given as a multiple of 1/100 em, e.g. <10&...


33

You can use the contour package for this. If you load it with the outline option, you'll get "proper" outlines (as opposed to several offset copies of your text). \documentclass{article} \usepackage[outline]{contour} \usepackage{amsmath} \contourlength{.4pt} \begin{document} \textcolor{yellow}{\contour{blue}{Some Words}} \end{document}


33

Declare \normalem at the appropriate point in the document body. (The correspondent macro to switch to "underlined" emphasis is \ULforem.) \documentclass{article} \usepackage{ulem} \begin{document} Some \emph{emphasised} text. \normalem Some \emph{emphasised} text. \ULforem Some \emph{emphasised} text. \end{document}


31

Here is a solution using contour and ulem packages. IMO this produces a very good looking underline, specialy for title underlining: \documentclass{article} \usepackage[outline]{contour} \usepackage{ulem} \normalem % use classical emph \newcommand \myul[4]{% \begingroup% \renewcommand \ULdepth {#1}% \renewcommand \ULthickness {#2}% \...


31

You can also use pgfornaments; a little example taken almost verbatim from the package page: \documentclass{article} \usepackage[object=vectorian]{pgfornament} \usetikzlibrary{shapes.geometric,calc} \begin{document} \begin{center} \begin{tikzpicture}[color=red!50!black,every node/.style={inner sep=0pt}] \node[minimum size=10cm,inner sep=0pt](vecbox){};...


30

I used libertineotf and XeLaTeX, but you can use, of course, any font. Just to get you started: MWE \PassOptionsToPackage{dvipsnames}{xcolor} \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{decorations.text} \usepackage{libertineotf} \begin{document} \begin{tikzpicture} \begin{scope} \draw[color=gray,fill=MidnightBlue] (0,0) circle (3.5cm); \...


29

Let's make soul work less: \documentclass{article} \usepackage{xparse,soul} \ExplSyntaxOn \NewDocumentCommand{\ulns}{m} { \seq_set_split:Nnn \l_tmpa_seq { ~ } { #1 } \seq_map_inline:Nn \l_tmpa_seq { \ul{##1}~ } \unskip } \ExplSyntaxOff \begin{document} \ulns{The quick brown fox jumped} over the lazy dog. \end{document} Basically, the argument is ...


28

You can use the mdframed package; a little example: \documentclass{article} \usepackage{mdframed} \usepackage{lipsum}% just to generate text for the example \newmdenv[ topline=false, bottomline=false, skipabove=\topsep, skipbelow=\topsep ]{siderules} \begin{document} \lipsum[4] \begin{siderules} \lipsum[1-5] \end{siderules} \lipsum[4] \end{...


27

Similar but slower. \documentclass[tikz]{standalone} \usetikzlibrary{decorations.text} \usepackage{fontspec,amssymb} \setmainfont{OptimusPrinceps} \definecolor{byublue}{RGB}{0 34 85} \newfontfamily\bolderfont{OptimusPrincepsSemiBold} \begin{document} \begin{tikzpicture} \begin{scope} \draw[color=gray,fill=byublue] (0,0) circle (3.5cm); \draw[color=gray,...


27

cancel is intended for indicating mathematic cancellation, and consequently only works in math mode; it also strikes out diagnoally. soul and ulem seem pretty similar. One basic semantic difference between them is that ulem per default changes the definition of \emph{...} to underline its argument instead of putting it in italics. This seems to aim at the ...


25

Another alternative is package pdfrender: It needs pdfTeX or LuaTeX in PDF mode. It works for Type 1 fonts by changing their rendering mode, thus PK fonts or rules are not supported. Paragraphs, line breaks and even page breaks are supported. Works with LaTeX or plain TeX based formats. Available both as switch \pdfrender and as macro \textpdfrender similar ...


25

Package soul provides an underlining macro \textul/\ul with the same depth. The following example copies the driver to \textulw/\ulw and leaves the spaces without underline: \documentclass{article} \usepackage{soul} \makeatletter \DeclareRobustCommand*{\textulw}{% \SOUL@ulwsetup \SOUL@ } \newcommand*{\SOUL@ulwsetup}{% \SOUL@setup \let\SOUL@preamble\...


25

With tcolorbox: \documentclass{article} \usepackage[many]{tcolorbox} \usepackage{xcolor} \usepackage{varwidth} \usepackage{environ} \usepackage{xparse} \newlength{\bubblewidth} \AtBeginDocument{\setlength{\bubblewidth}{.75\textwidth}} \definecolor{bubblegreen}{RGB}{103,184,104} \definecolor{bubblegray}{RGB}{241,240,240} \newcommand{\bubble}[4]{% \tcbox[ ...


24

\\ (which you should almost never use) is for leaving the line short. \linebreak (which you should almost never use) is the command to force a line and still justify the paragraph. \linebreak has an optional argument, such that \linebreak[3] (or 2) will only break if the break makes the result not too spaced out. Rather than force a linebreak it is better ...


22

An alternative is the memoir class with the option ms. By default, the emphasis is simply ignored in this way, but adding the ulem package the text with emphasis is underlined. You can also add the xcolor package to introduce some red text. At least at the end of typerwritter era was usual the two-color ink ribbons, and therefore was usual highlight some ...


22

This is what the \stackanchor macro does in the stackengine package. I show three instances, center, left, and right aligned. In the last instance, I set the stackgap between the items to 8pt, rather than the default (3pt). Note that the gap can be alternately achieved via \stackanchor[8pt]{top item}{bottom item}. The default stack sets the gap between ...


22

Here is a solution: \documentclass[tikz,margin=2mm]{standalone} \usetikzlibrary{fadings} \begin{document} \begin{tikzpicture} \def\mytext{Reflec\textcolor{red}{t}ion} \tikzset{mynode/.style={anchor=south,inner sep=0,font=\ttfamily\Huge}} \node[mynode]{\mytext}; \node[scope fading=south,opacity=0.4,yscale=-1,mynode]{\mytext}; \end{tikzpicture} \end{...


21

Too long for a comment. The second answer in that thread is a working example. If you want to change the color when using the soul package you can use the command \setstcolor: \documentclass{article} \usepackage{soul,xcolor} \begin{document} \setstcolor{red} \st{Some overstruck text} \end{document} The ulem package does not support coloring directly,...


20

Another solution found in the manual is to use the \usepackage option [normalem], i.e., \usepackage[normalem]{ulem}. This is probably a better solution if you are using the package ulem just for line struck through word or some other feature, but want to use \emph as italics. I know this is not exactly your case, but may be useful for someone else.


19

If I understand the question correctly, you can use TikZ together with the titlesec package to do the job; something along these lines: \documentclass{article} \usepackage{titlesec} \usepackage{tikz} \usepackage{lipsum} \titleformat{\section} {\normalfont\Large\bfseries} {\tikz[remember picture,overlay,baseline=-6pt] \node[fill=cyan!60!black,...


18

If you're prepared to use Xe(La)TeX, a number of Opentype fonts have a good selection of fleurons and other ornaments. Here, for example, is a fragment from one of my visiting cards: \newcommand{\ornament}[1]{% \fontspec{Zapfino Extra LT Pro} \fontsize{8pt}{10pt} \selectfont \XeTeXglyph #1 \normalfont}% ... \ornament{1620} which gets ...


18

You can use the titlesec package; the ulem package was used for the underlining: \documentclass{article} \usepackage[explicit]{titlesec} \usepackage{ulem} \usepackage{lipsum}% just to generate text for the example \setcounter{secnumdepth}{4} \titleformat{\paragraph}[runin] {\normalfont\normalsize\bfseries}{}{15pt}{\uline{\theparagraph\hspace*{1em}#1.}} \...


18

\uline parses its argument to divide the text into words. A parsed word is put into a box to measure its width and overlay it with the markings (line, double line, wave, ...). Therefore \unskip goes at start of a new word to the begin of a box. There is no space to remove. Thus it is without effect. Putting \unskip after \uline{...} is better because it ...


18

Here's an alternative solution with Tikz. Output Code \documentclass[margin=10pt]{standalone} \usepackage{tikz} \definecolor{backg}{RGB}{225,236,244} \definecolor{tagtxt}{RGB}{88,115,159} \newcommand\sotag[1]{% \tikz[baseline]{% \node[anchor=base, text=tagtxt, fill=backg, font=\sffamily, text depth=.5mm] {#1}; }% } \begin{document} Here ...


17

As you can see, there are indeed ways to make text "pretty" using TeX and friends but they are definitely not easy. (This is actually one of the reasons why my WordArt-loving colleagues find it hard to switch to LaTeX. I, however, no longer use them due to my own opinions about WordArt:) As mentioned in the comments above, you can use graphical packages like ...


Only top voted, non community-wiki answers of a minimum length are eligible