3
votes
1answer
36 views

tabular and lstlistings - When importing code in column 2, paragraph in column 1 moves down

A problem surfaces when formatting my ten-page long document and I'm going to try to post all the code that relates to the issue, but know that I'm fairly new to LaTeX so I may not realise some parts ...
4
votes
2answers
111 views

Making an unfilled circle including a number in a table

I wonder is it possible to highlight a number enclosing with an unfilled circle next to a line in a listing or table like the image below? \documentclass[english,a4paper,12pt]{report} ...
4
votes
2answers
70 views

Missing \endgroup inserted error in a table

I am getting 'Missing \endgroup inserted morekeywords={class,run}]' on line 16 while running the tex. I am using TexStudio. How can I solve that problem? \documentclass{article} ...
4
votes
2answers
73 views

Showing two listings in a table side-by-side [duplicate]

I wonder is there any possibility to show two different listings in one table side by side? Here is my code that only show one listening but how can I embed it in a table and another one? EDIT: Even ...
2
votes
1answer
32 views

Splitting a code listing inside a longtable

Is there a way to have code listings split across multiple pages when included inside a longtable? For example, the following code: \documentclass{article} \usepackage{listings} ...
3
votes
1answer
108 views

Environment for two columns with lstlistings

In order to reduce copy-pasting, I want to create an environment that will produce a two-column table with headers and two listings in different languages, like below: \begin{tabular}{l l} Python ...
6
votes
2answers
276 views

How to put source code in a LaTeX table?

I am comparing source in a paper and I would like to put them in a table, so the differences are easily spotted. I used the following LaTeX code: \begin{tabular}{ | l | l | l |} Option 1 & ...
7
votes
1answer
95 views

Wrong border position on tabular when using lstlisting

I have encountered a problem while using tabular environment. The following code \documentclass [12pt,a4paper,oneside]{report} \usepackage {listings} \usepackage {fontspec} \usepackage {enumitem} ...
5
votes
1answer
459 views

lstlisting in a tabular enviroment

I am following Adding C++ code in Latex for adding C++ code to the document. What I have is a table with the following format: \documentclass[12pt,a4paper,final]{report} \usepackage[utf8]{inputenc} ...
2
votes
2answers
283 views

Including HTML code side by side in Latex [duplicate]

I want to write HTML codes of two pages side by side in LaTeX like as follows: <html> <html> <head> <head> </head> </head> <body> <body> ... ...
5
votes
1answer
195 views

8 column table with lstinputlisting in LaTeX

I'd like to create a multicolumn table (up to 8 columns) to insert my code via \lstinputlisting{source.c}. But it seems to me that more then 6 columns aren't possibile even tough space is available. ...
5
votes
1answer
296 views

Why doesn't \lstinline work in table column?

\documentclass[14pt]{extarticle} \usepackage{xcolor} \definecolor{deepblue}{rgb}{0,0,0.5} \definecolor{deepred}{rgb}{0.6,0,0} \definecolor{deepgreen}{rgb}{0,0.5,0} \usepackage{listings} ...
2
votes
2answers
380 views

Multiline listing within multicolumn row

I have a problem putting a listing (using lstlisting package) within a table. The problem is that I want to put a multiline listing in a row taking 2 columns. The following minimal example shows ...
1
vote
1answer
474 views

How to write program text in table

I have to write a table with two columns and in each column I have to place small C code snippets. Using the \code{} in each column seems to be very tedious because I have to write \code{} in each ...
1
vote
1answer
102 views

Order of `float` and `caption` packages in preamble

I am using float and caption packages in my document, and also packages like tabularx, listings, algorithm... that (as far as I know) define floating elements or elements that have captions ...
4
votes
1answer
236 views

Can I use \lstinline for table column?

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{table} \begin{center} \begin{tabular}{| >{\lstinline}l | ...
3
votes
1answer
4k views

\usepackage{caption} breaks references to tables

I'm formatting the listings captions as follows: \usepackage{caption} \DeclareCaptionFont{white}{\color{white}} \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}} ...
7
votes
2answers
2k views

\lstinline!Foo! vs \lstinline{Foo}

I wonder what is the difference or correct usage of \lstinline!...! and \lstinline{...}? I like better {} because I feel there it's more consistent with other commands but for example in below ...
0
votes
0answers
43 views

I cannot get an image and `lstlisting` aligned in a table [duplicate]

Possible Duplicate: How to align picture top left in a table? I want to display an image and some lines of monospaced text with line breaks (as far as I know, lstlisting is the only ...
4
votes
1answer
492 views

lstlisting produces empty row when used inside a tabular

Is there any way I can get rid of the empty new row produced by lstlisting inside a tabular? Here's a minimum working example: \documentclass[11pt]{article} \usepackage{listings} \lstset{ ...
5
votes
1answer
2k views

Listing with line numbers inside a table

I typeset a lot of listings (using the listings package) inside (array-based) tabular environments. This works like a charm, however, breaks when I pass the numbers= option to the listing: ...
3
votes
1answer
2k views

Multiline listing in a table environment

I'm trying to simulate an effect that is very easy to do in WYSIWYG environments, namely having a table with some cells containing somewhat complex multi-line entities. For instance, consider the ...