# A package with macros for programming languages names?

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}

-
For C++: tex.stackexchange.com/questions/4302/prettiest-way-to-typeset-c – yo' Jan 6 '13 at 22:19
@tohecz thanks, though I knew about that discussion. In fact, the question came to my mind when I read that. – AlefSin Jan 6 '13 at 22:23
Instead of using \nolinebreak, put the whole code in \hbox{...} – yo' Jan 6 '13 at 22:35
for TeX Logos there's hologo or metalogo – bloodworks Jan 6 '13 at 22:40
@tohecz Better \mbox, as \hbox doesn't start a paragraph if found in vertical mode. – egreg Jan 8 '13 at 8:43

As the answers to Prettiest way to typeset "C++"? 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:

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.

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

-
Thanks for your answer. Yes, I also realized that there is no standard way to typeset the names for these languages. I liked your solution as mine was definitely broken. – AlefSin Jan 8 '13 at 11:13