4

I am looking for a way to beautifully typeset an OO class like :

classname 
{
     properties:
         prop1 : integer
         prop2 : Node

     methods:
         someMethod()
}

With the look & feel of algorithm2e algorithms. (i.e. not code-looking like listings).

Is there any package already doing this or should I roll my own way ?

Thanks!

closed as unclear what you're asking by jub0bs, ChrisS, user31729, Jesse, Malipivo May 25 '14 at 9:47

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Using algorithm2e is really unwarranted, here. After all, your class is not an algorithm. listings is a more natural choice and is perfectly capable of beautifully typesetting it. Why insist on using algorithm2e instead of listings? – jub0bs May 23 '14 at 18:07
  • I don't insist on using algorithm2e, but I want it to look like something more "theoretical" than something inside listings (because my algorithms are typeset using alg2e). For instance, bold font for keywords, no typewriter-style fonts... – Jean-Michaël Celerier May 23 '14 at 18:12
  • By "theoretical", do you mean that you're explaining the syntax of class definition to your readers? – jub0bs May 23 '14 at 18:13
  • No, I mean that it's not in an existing programming language, it's only pseudo-code. – Jean-Michaël Celerier May 23 '14 at 18:21
  • Here's one possibility: tex.stackexchange.com/questions/172981/…. The other way is to use a verbatim-type environment but make the font \rmfamily instead of \ttfamily. – Steven B. Segletes May 24 '14 at 2:29