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

4
  • 1
    You can use TikZ for this. Something like \tikz\node[draw,rounded corners]{Python}; Commented Dec 31, 2019 at 6:24
  • 1
    But I believe this is an XY problem, you might want to draw a diagram or something like that. Commented Dec 31, 2019 at 6:26
  • 1
    There is the menukeys package, try \documentclass{article} \usepackage{menukeys} \begin{document} \keys{Python} \end{document}. But I agree with @Fractal that you might be better off if you just used TikZ. Commented Dec 31, 2019 at 6:55
  • 2
    Does this answer your question? How to add a small rounded rectangle around a word inline Commented Dec 31, 2019 at 10:07

2 Answers 2

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

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.