1
vote
1answer
30 views

Semantic table markup with environments inside {tabular}

I run into issues trying to markup tables semantically in LaTeX. Background Either standard \hline together with \firsthline and \lasthline from array.sty (I think) or \midrule, \toprule and ...
4
votes
0answers
82 views

Using a package only for certain tables

I am using the tabularx environment since it the X component of the columns is very useful and necessary for the tables I want to produce. However, a single one of my tables is longer that a page, and ...
3
votes
1answer
109 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 ...
5
votes
1answer
60 views

Bottom hline in a tabularx wrapper environment

I want to define a wrapper environment for a table where one of the columns stretches to fill the available width. I'm using the tabularx package and its X column for that. As mentioned here and in ...
0
votes
0answers
33 views

Putting itemize environment in a tabular environment [duplicate]

I have a macro that makes an itemize environment. When I tried to use the macro in a tabular environment, I have this error message. ERROR: LaTeX Error: Something's wrong--perhaps a missing \item. ...
0
votes
0answers
21 views

tabularx in newenvironment: Illegal pream-token [duplicate]

The following example gives: ! Package array Error: Illegal pream-token (\AtEndOfPackage): `c' used. What is wrong? \documentclass{article} \usepackage{tabularx} \newenvironment{mytab}{ ...
4
votes
1answer
75 views

Specify color of the first row in table (in “newenvironment”)

I am using an specific style for my tabulars and I am looking to specify automatically the color of the text in the first row. Currently I must specify manually the color of the text of each cell in ...
0
votes
0answers
30 views

Fixing LaTeX errors “Environment table undefined.” [duplicate]

I have written the following TeX program in KWrite editor to make a table. \begin{table}[t] \centering \caption{test table} \begin{tabular}{c c c} \hline one &\ two & \three\[0.5ex] hline 1 ...
4
votes
1answer
166 views

Making a class to generate colored tables with a predefined layout

This is a follow-up question in which I asked how to define classes with \newcommands into \newenvironments, and I had some good answers to this particular issue. However, the problem that I have ...
4
votes
2answers
240 views

Little indentation despite \noindent after tabu custom-environment

this question is about a (to me) mysterious little indent (looks like an ordinary blank...) after a custom-environment using the tabu-environment. Please compile this MWE: \documentclass[a4paper, ...
4
votes
1answer
86 views

Customized tabular environment

we've quite often have to write tables in our CI layout (colors, borders, fonts, etc). At the moment we use the standard tabular environment with lots of extra instructions (in the environment ...
4
votes
1answer
51 views

Sorted output inside a tabular

Currently I'm trying to create an environment with several different \item-like commands. I want the arguments of the different commands to be ordered by their type. Basically the usage of ...
4
votes
1answer
90 views

Identical instance of longtabu

Defining a class file, I would like to define a new environment, which is essentially a longtabu. The longtabu is defined to have a variable width left column, which I would like to be identical in ...
5
votes
3answers
212 views

Problem with newenvironment

I'm defining new environment and I'm trying to pass to it two arguments: \newenvironment{ctable}[2]% {% \begin{center}% \begin{tabular}{#1}% }% {% \end{tabular}% \captionof{table}{#2}% ...
2
votes
1answer
121 views

Using data from tabulary to typeset columns

While trying to write a better answer to this question, I've made several (probably quite bad) attempts to use the tabulary environment to typeset paragraphs to try to in some way be able to split a ...
3
votes
2answers
104 views

Centering a wide table that is defined inside a NewEnviron

I am trying to centre a table with a lot of content whose width is larger than the text width. The problem is that I am defining the table environment in the preamble so I can reuse it, and this seems ...
3
votes
3answers
7k views

Footnote in tabular environment

It seems as if footnotes would have only a problem with the table environment but in my minimal example non of those answers Footnotes in Tabulars? Footnote in table seem to work for the tabular ...
4
votes
3answers
194 views

Can't include a 'tabu' inside \newenvironment with cells in the postamble

I'm trying to include a tabu inside a new definition of an environment but it fails if the postamble (enddef) of the new environment includes tabu's contents, so cells. With tabular or tabular* works. ...
1
vote
1answer
4k views

LaTeX Error: Environment table undefined

When I try to compile a latex file, I get the following error: LaTeX Error: Environment table undefined. I think the line that is causing the problem is: \begin{table} Does anybody know how I can ...
3
votes
2answers
243 views

Defining a newenvironment with optional caption

I am trying to define a new table environment with optional caption. However, if I don't pass it the caption, I am still getting the "Table 1.1:" below the table. What am I missing here? Thanks. ...
2
votes
1answer
366 views

newenvironment tabularx and begin center

I try to create a custom env, based on a tabular. I try to make a \begin{center} before my tabular to remove identation at the beginning of the tabular, but he tells me "File ended while scanning ...
4
votes
1answer
717 views

Using tabularx in a custom environment - “misplaced \noalign”

Question Currently, I'm trying to shorten the creation of small tabularx-tables with pre-defined headers, but somehow, trying to use the tabularx-environment, even though I used the \tabularx and ...
8
votes
2answers
400 views

Patch tabular environment with colorbox

I'm trying to quickly add a colored background using colorbox to all tables as shown in this answer. While I could just update all the TeX by hand, I am trying to patch the tabular environment to ...
4
votes
2answers
153 views

I can't use & tabs in the `align` environment while using it inside a custom environment

I've got a custom environment made for problem sets, and it uses a tabular to align the question number and question body. When I try to use & to group parts of an equation together - like if I ...
8
votes
1answer
305 views

Custom environment with fancy text indentation

I am trying to typeset text by breaking it into smaller cameos, numbering each cameo, and putting a heading. See below for an example of how I want the typeset text to look. The code with which I ...
2
votes
1answer
319 views

Left aligned multi line equations and \newenvironment

I'm building a table of integrals, for my own use. I need simple things: equations must be left aligned, sometimes I need alignment on the equal symbol and to save space sometimes I need 2 equations ...
2
votes
1answer
321 views

Create Custom tabular

Is there a way to make something like tabular such that in a loop we get each column in a line and render them in a custom format. Like this \begin{custom_tabular} l1c1 & l1c2 & l1c3 \\ l2c1 ...
4
votes
1answer
109 views

Safeguard an environment against tabular mode

The semantics of a given environment require that it is typeset inside a minipage if it is used inside a tabular. If I add the minipage declaration for a positive check for "internal" mode in the ...
5
votes
2answers
522 views

Custom environments with multicolumn header

I tried to create an environment that creates a tabular frame around the content of the environment. For instance: \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{Team sheet} \\ \hline ...
2
votes
1answer
415 views

Tabular: set a line between each row in \newenvironment

I have created a particular table with 3 columns using \newenvironment. Now I want to put a line between each row and from the 2th to the 3th column. I know it is possible to add \cmidrule{2-3} at the ...
15
votes
2answers
2k views

How to create new table environment

I am working on a book that has many many such tables. Is there a way to create shortcut for the code shown below. I want to make table caption a variable, because in the MWE shown below except ...
2
votes
1answer
251 views

Custom environment to accept \item

How can I create an environment that takes items in a way similar to lists? Example: \begin{myEnv} \item{AAA}{BBB} \item{CCC}{DDD} \end{myEnv} I'd like the above do something like ...
8
votes
3answers
439 views

colortbl: new environments and how to apply \expandafter

This is a followup question from one asked by Andrew Howard. After some discussion, it became clear that colortbl has some issues with the names that can be used for a \newcolumntype. The result of ...
0
votes
2answers
288 views

Environment with customizable number of table columns

I want to make macros for drawing group of questions with same answers with customizable text, number of answers and design (column widths, alignment, etc.), like this: ...
8
votes
2answers
1k views

How to include tabularx/y in a new environment?

I am looking for a way to define a customizable environment for tables in my latex documents. This means: caption and label width of table customized column format (tabular preamble) While this ...
1
vote
1answer
354 views

Custom (or any) environment inside tabular adds unwanted vspace

I wanted to define my own version of a verbatim-like environment, that has some less line spacing and uses alltt instead of verbatim, so what I can use \(\cdots\) inside. What I tried was: ...
3
votes
1answer
481 views

Tabular environment within the \newenvironment

I'm writing a book, in which we refer the reader to the CD-ROM for the source code, and tell him the compiler and the result of running the program. Here's an example: Since this "template" is ...
4
votes
1answer
154 views

How to avoid duplication of longtable setup code

I have many longtable's in my document. Everything is the same across all the tables, except for the caption and the content (of course). How can I avoid duplicating the stuff required to set up ...
3
votes
1answer
600 views

Create environment inside another environment?

Why can't I define an environment, that encloses another tabularx environment inside it? For example, why can't I do this: \newenvironment{customTabular}{ % This is the begin code ...
3
votes
2answers
394 views

Can this command be converted to environment?

I have a command as follows: \newcommand{\Comment}[1]{&&&#1\tabularnewline\hline} And now I want to convert it to be an environment as follows: \newsavebox{\tempDescription} ...
2
votes
1answer
1k views

array package breaks references in a tabular environment

This is a follow-up question to my last question: Defining a new LaTeX environment for numbered two-column proofs Basically, I'm trying to define the following environment: \newcounter{proofc} ...
1
vote
1answer
1k views

bottomrule not working in a self-made environment

I have this environment for consistent tables in my LaTeX documents: \newenvironment{defaultTable}[2] { \@float{table}[h] \noindent \tabularx{\textwidth}{#1} \specialrule{0.5pt}{10pt}{0pt} ...
9
votes
4answers
1k views

Use column-separator & (ampersand) inside \newenvironment

I'd like to define a grammar environment which basically wraps a tabular environment. Inside the grammar environment I'd like to use an environment called production to insert rows. Example: ...
15
votes
3answers
2k views

Problem with redefining Tabular environment with the \renewenvironment ‎command‎

In a book I'm typesetting, I want the tabular environment to be in footnote size and the other body of the book to be in normalsize font. To do this, I've tried something like the following: ...
8
votes
2answers
2k views

tabularx inside a \newenvironment

There's something wrong with this code: \newenvironment{Tbl} {\begin{tabularx}{\textwidth}{|l|X|} \hline} {\end{tabularx}} but this is fine: \newenvironment{Tbl} {\begin{tabular}{|l|l|} \hline} ...