Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Align \newtcbox blogtag in a line in latex

Reference image

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

\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{\scriptsize \textcolor{mygray}{\textbullet {    }}{\MakeUppercase {Tag name 1}}}
\blogtag{\scriptsize \textcolor{mygray}{\textbullet { }}{\MakeUppercase {Help me}}}
\blogtag{\scriptsize \textcolor{mygray}{\textbullet { }}{\MakeUppercase{ Align this}}}
\blogtag{\scriptsize \textcolor{mygray}{\textbullet { }}{\MakeUppercase{ in a line}}}
\blogtag{\scriptsize \textcolor{mygray}{\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.

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading