How to add a small rounded rectangle around a word inline

Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
I want to add a box with a very light pink background and red border around a word but inline and within a sentence.
i.e. something like this (drawn with inkscape)

I know the mdframed package can be used for placing boxes around paragraphs, but it does not seem to work inline and also give colored boxes.
Possibly TikZ is a solution? From the little I know of TikZ, it can be used to draw pictures inline inside a sentence.
tikz-pgf boxes
add a comment |Â
up vote
4
down vote
favorite
I want to add a box with a very light pink background and red border around a word but inline and within a sentence.
i.e. something like this (drawn with inkscape)

I know the mdframed package can be used for placing boxes around paragraphs, but it does not seem to work inline and also give colored boxes.
Possibly TikZ is a solution? From the little I know of TikZ, it can be used to draw pictures inline inside a sentence.
tikz-pgf boxes
Seetcolorboxpackage documentation at the bottom of page 16.
â CarLaTeX
1 hour ago
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I want to add a box with a very light pink background and red border around a word but inline and within a sentence.
i.e. something like this (drawn with inkscape)

I know the mdframed package can be used for placing boxes around paragraphs, but it does not seem to work inline and also give colored boxes.
Possibly TikZ is a solution? From the little I know of TikZ, it can be used to draw pictures inline inside a sentence.
tikz-pgf boxes
I want to add a box with a very light pink background and red border around a word but inline and within a sentence.
i.e. something like this (drawn with inkscape)

I know the mdframed package can be used for placing boxes around paragraphs, but it does not seem to work inline and also give colored boxes.
Possibly TikZ is a solution? From the little I know of TikZ, it can be used to draw pictures inline inside a sentence.
tikz-pgf boxes
tikz-pgf boxes
edited 4 mins ago
asked 1 hour ago
smilingbuddha
6754915
6754915
Seetcolorboxpackage documentation at the bottom of page 16.
â CarLaTeX
1 hour ago
add a comment |Â
Seetcolorboxpackage documentation at the bottom of page 16.
â CarLaTeX
1 hour ago
See
tcolorbox package documentation at the bottom of page 16.â CarLaTeX
1 hour ago
See
tcolorbox package documentation at the bottom of page 16.â CarLaTeX
1 hour ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
Yes, it is possible with TikZ. You can do this in two ways:
- by including the code directly in the text.
- by creating a LaTeX command named
autourwhich contains theTikZcode.
Here is an example of two possibilities that have different parameters in order to visually show their effects.

documentclassarticle
usepackagetikz
newcommandautour[1]tikz[baseline=(X.base)]node [draw=red,fill=gray!40,semithick,rectangle,inner sep=2pt, rounded corners=3pt] (X) #1;
begindocument
Quick brown fox tikz[baseline=(X.base)]node [draw=black,fill=cyan!20,thick,rectangle,inner sep=3pt, rounded corners=4pt] (X) jumped; over the lazy dog.
bigskip
Quick brown fox autourjumped over the lazy dog.
enddocument
Works great! Thanks!
â smilingbuddha
5 mins ago
add a comment |Â
up vote
3
down vote
This is a bit similar to AndréC's answer but to point out that there so some extent tikzmarknode, which comes with the really cool tikzmark library, got reinvented. And tikzmark allows you to do much more, of course.
documentclassarticle
usepackagetikz
usetikzlibrarytikzmark
begindocument
The quick brown fox tikzmarknode[draw,inner sep=1pt,rounded corners,fill=cyan!30]Ajumped over the lazy dog.
bigskip
The quick brown fox tikzmarknode[draw,inner sep=1pt,rounded corners,fill=red!30]Bjumped over the lazy dog.
tikz[overlay,remember picture]draw[latex-latex] (B) to[bend left] (A);
enddocument

Wow cool! Thanks!
â smilingbuddha
4 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
Yes, it is possible with TikZ. You can do this in two ways:
- by including the code directly in the text.
- by creating a LaTeX command named
autourwhich contains theTikZcode.
Here is an example of two possibilities that have different parameters in order to visually show their effects.

documentclassarticle
usepackagetikz
newcommandautour[1]tikz[baseline=(X.base)]node [draw=red,fill=gray!40,semithick,rectangle,inner sep=2pt, rounded corners=3pt] (X) #1;
begindocument
Quick brown fox tikz[baseline=(X.base)]node [draw=black,fill=cyan!20,thick,rectangle,inner sep=3pt, rounded corners=4pt] (X) jumped; over the lazy dog.
bigskip
Quick brown fox autourjumped over the lazy dog.
enddocument
Works great! Thanks!
â smilingbuddha
5 mins ago
add a comment |Â
up vote
4
down vote
accepted
Yes, it is possible with TikZ. You can do this in two ways:
- by including the code directly in the text.
- by creating a LaTeX command named
autourwhich contains theTikZcode.
Here is an example of two possibilities that have different parameters in order to visually show their effects.

documentclassarticle
usepackagetikz
newcommandautour[1]tikz[baseline=(X.base)]node [draw=red,fill=gray!40,semithick,rectangle,inner sep=2pt, rounded corners=3pt] (X) #1;
begindocument
Quick brown fox tikz[baseline=(X.base)]node [draw=black,fill=cyan!20,thick,rectangle,inner sep=3pt, rounded corners=4pt] (X) jumped; over the lazy dog.
bigskip
Quick brown fox autourjumped over the lazy dog.
enddocument
Works great! Thanks!
â smilingbuddha
5 mins ago
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
Yes, it is possible with TikZ. You can do this in two ways:
- by including the code directly in the text.
- by creating a LaTeX command named
autourwhich contains theTikZcode.
Here is an example of two possibilities that have different parameters in order to visually show their effects.

documentclassarticle
usepackagetikz
newcommandautour[1]tikz[baseline=(X.base)]node [draw=red,fill=gray!40,semithick,rectangle,inner sep=2pt, rounded corners=3pt] (X) #1;
begindocument
Quick brown fox tikz[baseline=(X.base)]node [draw=black,fill=cyan!20,thick,rectangle,inner sep=3pt, rounded corners=4pt] (X) jumped; over the lazy dog.
bigskip
Quick brown fox autourjumped over the lazy dog.
enddocument
Yes, it is possible with TikZ. You can do this in two ways:
- by including the code directly in the text.
- by creating a LaTeX command named
autourwhich contains theTikZcode.
Here is an example of two possibilities that have different parameters in order to visually show their effects.

documentclassarticle
usepackagetikz
newcommandautour[1]tikz[baseline=(X.base)]node [draw=red,fill=gray!40,semithick,rectangle,inner sep=2pt, rounded corners=3pt] (X) #1;
begindocument
Quick brown fox tikz[baseline=(X.base)]node [draw=black,fill=cyan!20,thick,rectangle,inner sep=3pt, rounded corners=4pt] (X) jumped; over the lazy dog.
bigskip
Quick brown fox autourjumped over the lazy dog.
enddocument
answered 53 mins ago
AndréC
5,2821937
5,2821937
Works great! Thanks!
â smilingbuddha
5 mins ago
add a comment |Â
Works great! Thanks!
â smilingbuddha
5 mins ago
Works great! Thanks!
â smilingbuddha
5 mins ago
Works great! Thanks!
â smilingbuddha
5 mins ago
add a comment |Â
up vote
3
down vote
This is a bit similar to AndréC's answer but to point out that there so some extent tikzmarknode, which comes with the really cool tikzmark library, got reinvented. And tikzmark allows you to do much more, of course.
documentclassarticle
usepackagetikz
usetikzlibrarytikzmark
begindocument
The quick brown fox tikzmarknode[draw,inner sep=1pt,rounded corners,fill=cyan!30]Ajumped over the lazy dog.
bigskip
The quick brown fox tikzmarknode[draw,inner sep=1pt,rounded corners,fill=red!30]Bjumped over the lazy dog.
tikz[overlay,remember picture]draw[latex-latex] (B) to[bend left] (A);
enddocument

Wow cool! Thanks!
â smilingbuddha
4 mins ago
add a comment |Â
up vote
3
down vote
This is a bit similar to AndréC's answer but to point out that there so some extent tikzmarknode, which comes with the really cool tikzmark library, got reinvented. And tikzmark allows you to do much more, of course.
documentclassarticle
usepackagetikz
usetikzlibrarytikzmark
begindocument
The quick brown fox tikzmarknode[draw,inner sep=1pt,rounded corners,fill=cyan!30]Ajumped over the lazy dog.
bigskip
The quick brown fox tikzmarknode[draw,inner sep=1pt,rounded corners,fill=red!30]Bjumped over the lazy dog.
tikz[overlay,remember picture]draw[latex-latex] (B) to[bend left] (A);
enddocument

Wow cool! Thanks!
â smilingbuddha
4 mins ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
This is a bit similar to AndréC's answer but to point out that there so some extent tikzmarknode, which comes with the really cool tikzmark library, got reinvented. And tikzmark allows you to do much more, of course.
documentclassarticle
usepackagetikz
usetikzlibrarytikzmark
begindocument
The quick brown fox tikzmarknode[draw,inner sep=1pt,rounded corners,fill=cyan!30]Ajumped over the lazy dog.
bigskip
The quick brown fox tikzmarknode[draw,inner sep=1pt,rounded corners,fill=red!30]Bjumped over the lazy dog.
tikz[overlay,remember picture]draw[latex-latex] (B) to[bend left] (A);
enddocument

This is a bit similar to AndréC's answer but to point out that there so some extent tikzmarknode, which comes with the really cool tikzmark library, got reinvented. And tikzmark allows you to do much more, of course.
documentclassarticle
usepackagetikz
usetikzlibrarytikzmark
begindocument
The quick brown fox tikzmarknode[draw,inner sep=1pt,rounded corners,fill=cyan!30]Ajumped over the lazy dog.
bigskip
The quick brown fox tikzmarknode[draw,inner sep=1pt,rounded corners,fill=red!30]Bjumped over the lazy dog.
tikz[overlay,remember picture]draw[latex-latex] (B) to[bend left] (A);
enddocument

answered 11 mins ago
marmot
72.4k477153
72.4k477153
Wow cool! Thanks!
â smilingbuddha
4 mins ago
add a comment |Â
Wow cool! Thanks!
â smilingbuddha
4 mins ago
Wow cool! Thanks!
â smilingbuddha
4 mins ago
Wow cool! Thanks!
â smilingbuddha
4 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f458864%2fhow-to-add-a-small-rounded-rectangle-around-a-word-inline%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password

See
tcolorboxpackage documentation at the bottom of page 16.â CarLaTeX
1 hour ago