Align \newtcbox blogtag in a line in latex

Viewed 35

enter image description here

As you can see in this picture, the tags are moved a little upward. I want to align them with the other text.

Compilable code:

\documentclass[10pt]{article}
\usepackage[a4paper,bottom = 0.6in,left = 0.6in,right = 0.6in,top = 1cm]{geometry}
% \usepackage{graphicx}
\usepackage{titlesec}
\usepackage[T1]{fontenc}
\usepackage{tcolorbox}
\usepackage{color}
\usepackage{xcolor}
\newcommand*{\bluebullet}{\textcolor{blue}{\textbullet}}
\begin{document}
\textbf{Some internship} \textbar \space Some company name
\newtcbox{\blogtag}{nobeforeafter,boxrule=-0.3pt,arc=2pt,
boxsep=0pt,left=5pt,right=5pt,top=3pt,bottom=3pt}
\blogtag{\tiny \textcolor{gray}{\textbullet {    }}{\MakeUppercase {Tag name 1}}}
\blogtag{\tiny \textcolor{gray}{\textbullet { }}{\MakeUppercase {Help me}}}
\blogtag{\tiny \textcolor{gray}{\textbullet { }}{\MakeUppercase{ Align this}}}
\blogtag{\tiny \textcolor{gray}{\textbullet { }}{\MakeUppercase{ in a line}}}
\blogtag{\tiny \textcolor{gray}{\textbullet { }}{\MakeUppercase{ with the main text in same line}}}
\end{document}

I tried \vspace above this, but it moves the entire line. Need help in resolving this.

putting box align = base takes it much lower.

enter image description here

1 Answers

You can change the box align:

\documentclass{article}
\usepackage[most]{tcolorbox}

\begin{document}

\textbf{Some internship} \textbar \space Some company name
\newtcbox{\blogtag}{nobeforeafter,boxrule=-0.3pt,arc=2pt,
boxsep=0pt,left=5pt,right=5pt,top=3pt,bottom=3pt, colback={blue!20},box align=base}
\blogtag{\scriptsize \textcolor{gray}{\textbullet { }}{\MakeUppercase {Tag name 1}}}
\blogtag{\scriptsize \textcolor{gray}{\textbullet { }}{\MakeUppercase {Help me}}}
\blogtag{\scriptsize \textcolor{gray}{\textbullet { }}{\MakeUppercase{ Align this}}}
\blogtag{\scriptsize \textcolor{gray}{\textbullet { }}{\MakeUppercase{ in a line}}}
\blogtag{\scriptsize \textcolor{gray}{\textbullet { }}{\MakeUppercase{ with the main text in same line}}}


\end{document}

enter image description here

If you need more fine control, you can adjust the baseline manually:

\documentclass{article}
\usepackage[most]{tcolorbox}

\begin{document}

\textbf{Some internship} \textbar \space Some company name
\newtcbox{\blogtag}{nobeforeafter,boxrule=-0.3pt,arc=2pt,
boxsep=0pt,left=5pt,right=5pt,top=3pt,bottom=3pt, colback={blue!20},baseline=0.5mm}
\blogtag{\tiny \textcolor{gray}{\textbullet { }}{\MakeUppercase {Tag name 1}}}
\blogtag{\tiny \textcolor{gray}{\textbullet { }}{\MakeUppercase {Help me}}}
\blogtag{\tiny \textcolor{gray}{\textbullet { }}{\MakeUppercase{ Align this}}}
\blogtag{\tiny \textcolor{gray}{\textbullet { }}{\MakeUppercase{ in a line}}}
\blogtag{\tiny \textcolor{gray}{\textbullet { }}{\MakeUppercase{ with the main text in same line}}}

\end{document}

enter image description here

Related