1

this will be my first question here so sorry for asking such a noob question. How do you render the image(python text inside a rounded corner textbox) below using pure LaTeX?

enter image description here

Maki
  • 13

2 Answers2

4

If you don't need colour, a box from the simple fancybox package will do:

\documentclass{article}
\usepackage{fancybox} 

\begin{document}

\ovalbox{\quad\sffamily Python\quad}
\bigskip 

\Ovalbox{\quad\sffamily Python\quad}

\end{document} 

enter image description here

For more sophisticated needs, you have the mdframed or tcolorbox package.

Bernard
  • 271,350
2

Another solution using the TikZ package.

\documentclass{article}
\usepackage{tikz}
\newcommand\HappyNewYear[1]{\tikz[baseline=(x.base)]{
  \node[draw,rounded corners] (x) {#1};
}}
\begin{document}
\HappyNewYear{Python} is a programming language, but \HappyNewYear{snake} isn't.
\end{document}

enter image description here

fractal
  • 1,500