[Tex/LaTex] A package with macros for programming languages names

packages

Is there any package with predefined macros for common programming languages' names? I mean, macros that help writing things like C++, C#, F# etc. in a nice way, the same way as for example \TeX? I have already written some of my own macros to do that but surely someone else has already thought about that and have prepared such useful macros in a package.

EDIT:
Here are macros that I use myself. Might be useful for someone else.

\newcommand{\CPP}{C\nolinebreak[4]\hspace{-.05em}\raisebox{.3ex}{\small++}\xspace}
\newcommand{\CS}{C\nolinebreak[4]\hspace{-.05em}\raisebox{.2ex}{\small\#}\xspace}
\newcommand{\FS}{F\nolinebreak[4]\hspace{-.05em}\raisebox{.2ex}{\small\#}\xspace}

Best Answer

As the answers to Prettiest way to typeset "C++" (cplusplus)? show, there is no general consensus on how to typeset those fancy names. There's no package for them either.

Thus you're better using your definitions, probably written in a more context independent way; for instance your

\newcommand{\CPP}{C\nolinebreak[4]\hspace{-.05em}\raisebox{.3ex}{\small++}\xspace}

will give wrong results if used in a section title that's typeset at a larger size, because \small is hard coded:

enter image description here

You can do better with the relsize package or, as the scaling you require is not very big, with \scalebox:

\documentclass{article}
\usepackage{xspace,graphicx}
\newcommand{\CPP}{C\kern-.05em \raisebox{.3ex}{\scalebox{.9}{++}}\xspace}

\begin{document}

{\Large\texttt{\string\Large} size: \CPP\par}

\texttt{normal} size: \CPP\par

{\small\texttt{\string\small} size: \CPP\par}

\end{document}

As you can see in the following image, the font size is respected.

enter image description here

Using \kern-.05em instead of \hspace{-.05em} ensures that no break point is inserted between the C and the two plus signs. Alternatively

\newcommand{\CPP}{\mbox{C\hspace{-.05em}\raisebox{.3ex}{\scalebox{.9}{++}}}\xspace}

will do the same.

You can do similarly for \CS and \FS

Related Question