How to make tags in Overleaf
Tags: overleaf, latex, resume, webdev
Published: 2023-06-28 05:39:02

Recently, I have been updating my resume and decided to add technical skills as tags to increase readability. By the end of this post, you will learn how to draw tag-looking boxes around text in Overleaf, as shown in the picture below.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/66q3p1mwv0h45svxpa69.png)

#### Step 1: Import required packages.

In order to create colorful boxes, we will use the `tcolorbox` package. If you want to know more about this package, you can check the reference [here](https://ctan.org/pkg/tcolorbox?lang=en).

Import the package in the beginning of your document as follows: 

```
\usepackage{tcolorbox}
\begin{document} ...
```
#### Step 2: Define the colorbox for your document

To keep all "tags" consistent throughout the document and avoid defining them every time, you can set the dimensions as well as the color for your colorbox at the beginning of your document:

```
\usepackage{tcolorbox}
\tcbset{on line, boxsep=1pt, left=0pt,right=3pt,top=0pt,bottom=0pt,colframe=red, colback=red}
\begin{document} ...
```
If we break down this line: 
`on line` keeps your colorboxes inline with the rest of the text;
`left`,`right`,`top`, `bottom` are inner margins set to each side of the box;
`boxsep` adds an inner margin to all sides;
`colframe` defines the color of the box border;
`colback` defines the color of the box background;


#### Step 3: Use the color box inside your text.

```
Created interfaces using \tcbox{Figma}.
```
The result would be as follows because it has a red border as well as a red background, and an additional 3px margin on the right:
![one red tag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xl1dzznsy8xfnukbe8v8.png)

#### Step 4: Add custom colors for tags.

To add a personal touch to your document, you can add custom colors and use them in your boxes. To do so, add a custom color at the beginning of your document:

```
\definecolor{babyblue}{rgb}{0.82, 0.96, 0.936} 
\usepackage{tcolorbox}
\tcbset{on line, boxsep=1pt, left=0pt,right=3pt,top=0pt,bottom=0pt,colframe=babyblue, colback=babyblue}
\begin{document} ...
```
In the example above, I added a color called _babyblue_ using the unit RGB color system and replaced the `colframe` and `colback` colors with it.

#### Step 5: Add specific tags
If you want to highlight a specific colorbox by defining colors or other properties only for that instance, you can do so by adding properties inline. For example, if you want to color a specific box with a different color, you can use the following:
`I can use \tcbox{HTML} and \tcbox[colframe=green, colback=green]{CSS}.`

Result: 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ltm62jpzumm1oozm975t.png)

By repeating the same process, you can define various tags with different custom colors:

```
\textbf{Skills}\\
\tcbox{Tag1} \tcbox{Tag2} \tcbox[colframe=almond, colback=almond]{Language1} 
\tcbox[colframe=almond, colback=almond]{Language2} \tcbox[colframe=yellow, colback=yellow]{Technology1}
\tcbox[colframe=yellow, colback=yellow]{Technology2}
```
Result: 
![Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j6yn8c3fmsam3ysiba5c.png)

I hope this will be useful for your project ~.~

References:
- [How to define an inner margin for a tcolorbox?](https://tex.stackexchange.com/questions/222152/how-to-define-an-inner-margin-for-a-tcolorbox)
- [Drawing coloured boxes using tcolorbox](https://www.overleaf.com/latex/examples/drawing-coloured-boxes-using-tcolorbox/pvknncpjyfbp)