2

I need to describe keywords in a TeX document. It should look similar like the keyword section of the C# specification:

enter image description here

I need some advice on how I can achieve this. Is this a transparent table? Can I use the syntax package here?

  • 2
    The font style is \sffamily (or, if fixed spacing is required, \ttfamily). A left-aligned tabular environment should be able to achieve it simply. – Steven B. Segletes Jan 12 '17 at 14:24
  • Works great! Can you turn your comment into an answer - I will accept it then... – Vertexwahn Jan 12 '17 at 14:41
2

As noted in my comment, I used \sffamily for the keyword style, and tabular to array the keywords. If a fixed-width font is required, then \ttfamily can be used in lieu of \sffamily.

\documentclass{article}
\begin{document}
\textit{keyword::} one of

{\centering\sffamily\tabcolsep=2.5ex\relax
\begin{tabular}{lllll}
abstract & as & base& bool& break\\
byte & case & catch & char & checked\\
class & const & continue & decimal & default\\
delegate & do & double & delse & enum\\
...&&&&\\
unsafe & ushort & using & virtual & void\\
volatile & while&&&
\end{tabular}\par}\smallskip

\noindent The following identifiers have special meaning in the syntactic grammar but they
are not keywords: \textsf{add} (\S17.7), \textsf{alias} (\S16.3),...
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.