TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't manage to add linenumbers left of the boxes. Can anybody help me?





\textbf{def} mapper (key, value):

\hspace{7mm}\textbf{for} word \textbf{in} value.split():

\hspace{14mm}\textbf{yield} word, 1\\

\textbf{def} reducer (key , values):

\hspace{7mm}\textbf{yield} key, sum(values)\\

\textbf{if} name == "main":

\hspace{7mm}\textbf{import} dumbo

\hspace{7mm}dumbo.run (mapper, reducer, combiner=reducer )





share|improve this question
I think this should probably be retitled? Not sure to what, though... perhaps "how to do line-numbered code listings?" – SamB Dec 25 '10 at 18:21
Btw, @user2678, I would suggest you fill in some sort of mnemonic in your profile -- whether it be some form of your name or just a pseudonym -- which make you look more like a particular person and less like some random luser. (Registering an account was a good start, though.) – SamB Dec 25 '10 at 18:30
up vote 4 down vote accepted


def mapper (key, value):
  for word in value.split():
    yield word, 1
def reducer (key , values):
  yield key, sum(values)
  if name == "main":
    import dumbo
    dumbo.run (mapper, reducer, combiner=reducer )

share|improve this answer
Thanks a lot :D – Drareeg Dec 25 '10 at 18:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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