TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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 want to apply \lstinline to one of the columns. I don't like idea to put it in every cell manually.

I am trying to do

        \begin{tabular}{| >{\lstinline}l | l |}
Имя класса & Назначение\\ \hline
Base & Базовый класс с функциями-утилитами \\ \hline

But pdflatex just hangs on these lines.

share|improve this question
What is it that you want to do, since there might be other ways of accomplishing what you're after. – Werner Jun 14 '12 at 3:09
@Werner I want words in one column to be styled as listing. I can write \lstinline$class_name$ in every column (at least I can use regular expressions to do that automatically) but I hope there are easier ways to do this. – efpies Jun 14 '12 at 3:13
Is there a reason why this needs to be inside a tabular environment? – Werner Jun 14 '12 at 3:41
@Werner Yes. This should be a placed in a table. – efpies Jun 14 '12 at 4:11
Did you figure out a way to solve this problem? I would like to do exactly the same thing... – Robert Jun 3 at 9:07

You may try the collcell package, which allows you to define a column type that applies a macro to the content of each cell of columns of that type. Its applicability might depend on what exactly you want to achieve with \lstinline -- refer to the manual e.g. for the verb option.





        \begin{tabular}{| E | F |}
        Text & Text \\\hline
        Text & Text \\\hline

share|improve this answer

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.