7
votes
1answer
69 views

Generate automatic revision's numbering tabular

Situation I have to make a cover template for a document. At the end of the page, I have to add the revision number with other useful info like this example: \begin{tabular}{lccl} Revision 0 ...
4
votes
3answers
150 views

Build table elements using a macro

1. Small example Consider the following two tables: \documentclass{article} \usepackage{multirow} \usepackage{hyperref} \begin{document} \begin{tabular}{c | c c | c} \multirow{4}{*}{First} & ...
5
votes
3answers
146 views

\newcommand for tabular entries using keyval

I am trying to define a command for tabular entries using keyval. \documentclass{article} \usepackage{keyval} \makeatletter \define@key{tabularEntryKeys}{a}[\dots]{#1 & } ...
4
votes
3answers
75 views

using a macro to define the body of a tabular / & separator problem

I'd like to create a macro that can create and fill a multiline tabular with 4 entries per line from something like \bidding{3H,4S,5C,X,XX,-} where the number of entries is of course dynamic. I have ...
2
votes
1answer
67 views

Height of a tabular cell & bounding boxes

Is it possible to calculate the height of a tabular cell to be reused as a value for vertical offset of the bounding box, similarly to how Hy@raisedlink takes you one line above of where the actual ...
9
votes
2answers
109 views

Error when using defs inside a macro to write a row in a table

For the following MWE \documentclass{article} \newcommand{\cmd}[5]{% \def\tA{#1}% \def\tB{#2}% \def\tC{#3}% \def\tD{#4}% \def\tE{#5}% \tA & \tB & \tC & \tD & \tE \\ } ...
7
votes
3answers
149 views

How to horizontally align rotated text in a table?

I am trying to horizontally align text that has been rotated in a table. I want the rotated "Lorem Ipsum" and the rotated "Lorem Ipsum & Lorem Ipsum" text to be horizontally centered in the cell. ...
4
votes
3answers
60 views

cellspacebreak macro

(I am rolling my own little system to take my LaTeX file and convert it to reasonable HTML and Epub. I have run into the following problem.) I would like to keep my tabulars very simple. There are ...
5
votes
0answers
62 views

Convert sequence to table [duplicate]

I'm trying to write a macro that converts a sequence to a table. The following code works fine: \documentclass{article} \usepackage{expl3} \begin{document} \noindent \ExplSyntaxOn \seq_new:N ...
3
votes
1answer
62 views

Command to increase spacing in table

WHen I needed to increase vertical space in a matrix I found this great custom command: \makeatletter \renewcommand*\env@matrix[1][\arraystretch]{% \edef\arraystretch{#1}% \hskip -\arraycolsep ...
2
votes
1answer
180 views

Dynamic table column generation

I'm trying hard in finding a way to streamline my table generation. As you can see in the attached code, the problem is related with the code "\@for \el:=#1\do{\textbf{\el} &}", where "&" ...
2
votes
1answer
63 views

Trouble including graphics from csv file into Pgftable, commands are dissapearing (local maybe?)

I've been trying to add eps graphics with the filename in a csv file. Take a look at the CSV to get an idea of what I mean: ...
2
votes
1answer
320 views

Dynamically format labels/columns of a LaTeX table generated in R/knitr/xtable

I have some tables coming from the statistical package R that I want to export in LaTeX markup. I would like to make every column large as the longest word of its label (assuming for simplicity the ...
3
votes
0answers
41 views

Preserving the value of a macro outside the local scope [duplicate]

I'm writing a (supposedly) simple financial tracking program using tikz and the fp package. Within a tabular environment I compute a value using \pgfmathparse{adding some numbers}\pgfmathresult. ...
6
votes
1answer
119 views

Custom environment vs macro inside a tabular

In a document I'm writing I have a nested tabular structure that I want to capture as a macro for reuse. I'd like to define the nesting using a new environment but it doesn't seem to work. I have ...
6
votes
2answers
96 views

Macro with local variables expanding over several tab-points

I finally developed from egreg's answer in my previous question ( Defining a macro with three optional arguments in the form \newmacro{a}{b}[c]{d}[e][f] and \newmacro{a}{b}[c]{d}*[f] ) While my ...
4
votes
0answers
26 views

Format first row of table differently [duplicate]

I have a need to format the first row of my table differently from the rest, and read this answer, which was very useful. So I tried to encapsulate the \multicolumn{1}{c}{#2} into a macro: ...
3
votes
1answer
160 views

Macro to apply tabcolsep to a table from external file

I am using R to produce my tables via xtable, but I am not using Sweave to write my document. Instead I am using TexStudio and if possible would like to stick with it. Therefore I am using \input to ...
2
votes
1answer
66 views

Formatting and newcommand issues

Following from my problems from here - Formatting resume header! I wanted to make the code simpler by adding the tabular part under a method so I tried \newcommand Here is the code ...
3
votes
1answer
66 views

Formatting locally the \hline command in a table

Is it possible to alter the \hline command in a table to mimic commands like \dotfill? I would like to be able to change the way the \hline command looks without loading another package like arydshln. ...
0
votes
0answers
34 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. ...
1
vote
1answer
59 views

Add custom caption to LOT file

In my publishing company we have our own template with custom \tcaption command which make caption above the table with company's standards (and I don't use table environment). However this command ...
0
votes
0answers
35 views

Employing options of the figure or table environment via \newcommand

I am writing a large document in which I would like to employ the options of figure environments via \newcommand{\figposa}{H} \newcommand{\figposb}{T} \newcommand{\figposc}{B} ...
10
votes
3answers
131 views

Looping Through a Nested List

I have a hunk of data like so: { { {AA},{AB}, ... {AZ} }, { {BA}, {BB}, ... {BZ} }, ... ... { {ZA}, {ZB}, ... {ZZ} } } defined in a macro called \clebschdata. Each term XX is a list of eleven ...
11
votes
2answers
160 views

Trouble Defining a LaTeX Command

I am trying to define a table of direct sums of {\chi_i}in LaTeX, meaning that the entries will be things of the form: 5 \chi_2 \bigoplus \chi_4 \bigoplus 2 \chi_7 for given data like ...
4
votes
1answer
97 views

Generating lists and tables of items from commands in the document

I would like to define objects all over my document and later evaluate certain components from these objects. Example: \documentclass{minimal} \newcommand{\requirement}[3]{#1, #2, #3} ...
7
votes
1answer
127 views

I'm confused about how expansion is happening here

I was really pleased that I could come up with a means of building the contents of a tabular environment using \foreach \x in {...} {...} structure. But I was curious about what exactly it would take ...
3
votes
0answers
37 views

Read single value from a table [duplicate]

I will use in many places in my LaTeX document a specific value given in, say, the row 2 and column 1 from a table. Is it possible to make a macro for it, such as \read{2}{1} ? Here is an simple ...
4
votes
2answers
92 views

Keyword command parameters with table (tabular)

I am trying to make a command with named (key-value) parameters to produce a table row. The reason is that table has more than 9 columns (command parameters) that will have position changed, be ...
3
votes
1answer
61 views

Table entry optimization

I am looking to get a better way of creating the following table: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} ...
5
votes
3answers
120 views

How to execute codes inside a macro?

I use Michael Wichura's old Table macros (see http://www.pctex.com/addons.html) in several places, and I need to access them from within another macro. The problem (I think) is that some of the ...
4
votes
2answers
117 views

Parsing rows (`\\`) and tab characters (`&`)

I have a use for parsing what would look like tabular input data, except that it isn't part of a tabular environment, but rather the argument to a macro. So I developed two macros, \readTABrow which ...
7
votes
3answers
172 views

Defining tabular rows with macros using `\ifnum` leads to `Incomplete \ifnum`

I am trying to define tabular rows using a macro which shall perform an conditional definition of the tabular row according to a given parameter. Please consider the following MWE: ...
1
vote
1answer
276 views

Newcommand for table

I have to use certain table format again and again, so I decided to create a new command for better tex file readability. Table as such works but when I put a working table header then it gives me a ...
4
votes
3answers
535 views

Misplaced \omit and \multicolumn in \IfEqCase

I have the following code with a command that creates rows for a tabular: \documentclass[letterpaper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{xstring} \newcommand*{\condrow}[2]{ ...
7
votes
1answer
125 views

How do I use commands within tabular definition?

Using commands within tabular definition result in error ! Missing $ inserted. In this case, it is the \, that causes problems when calling the custom command. Same commands work fine outside tabular ...
2
votes
0answers
143 views

Put ampersand (&) inside conditional [closed]

I'm trying to make a command that formats the alternatives of a test. Can I put an ampersand after each alternative? (I call my tabular command out of this command, and I want to put each alternative ...
4
votes
1answer
178 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 ...
1
vote
0answers
101 views

Abbreviated syntax for CALS package

The cals package allows to create the tables with design capabilities which are available in Microsoft Word. This package is not based on tabular and has more bulky syntax than tabular. I'm try to ...
5
votes
1answer
129 views

How to implement the macros style with mixed chars and floats in a csv file?

I would like to implement macros to generate multiple tables in a document. Some inspiration comes from here: usage-of-longtable-or-equivalent-and-pgfplotstabletypeset The input csv file and ...
2
votes
1answer
201 views

xstring StrSubstitute and table

I got a problem with xstring \StrSubstitute in combination with a table. I would like to replace newline (\\) in a variable with the \newline command to generate a second line in a paragraphed table ...
2
votes
1answer
131 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
111 views

Using \color in a paragraph column inside a tabular environment results in a line break [duplicate]

Some of my documents are compiled into multiple outputs. Some Versions contain certain parts, while other versions contain only a placeholder. For this purpose I have a macro \markup that colors its ...
6
votes
1answer
59 views

Macro limited in scope to the tabular cell in which it is invoked?

How do I reuse cell delimiter of a tabular environment (usually ampersand) for delimiting a macro parameter? Like this (which unfortunately doesn't work): \def\mymacro#1&{#1} ... ...
7
votes
3answers
176 views

Adjusting command behavior based on argument type

I have a following command in my latex document: \newcommand{\ApplyGradient}[1]{ \pgfmathsetmacro{\PercentColor}{100.0*(#1+0.2)/1.3} \textcolor{black!\PercentColor}{#1}} ...
1
vote
2answers
174 views

How to apply a macro to each row of a table

This is similar to the question about cells, but with whole rows, and hopefully will help me to implement an answer to this question. Given a macro \RowMacro, how can I define the mytable environment ...
7
votes
2answers
93 views

Setting an “attribute” for Theorem to be accessed later

I am writing a math paper with a large number of theorems. I'm looking to have a table summarizing my results, and I'd love it if the table could be generated automatically from my paper. I' looking ...
4
votes
1answer
319 views

LaTeX not recognizing \end found in a \newcommand

I'm trying to both start and end a table with \newcommand. I'd like to switch to using \EndTableSetupFourColumns (as it removes several warnings and is easier to understand for other readers) but for ...
4
votes
2answers
229 views

Increasing the length between rows in a table

I have defined a new command to increase the length between rows in a table: \newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}} For example \documentclass[a4paper, 11pt]{article} ...
6
votes
2answers
163 views

Complex parsing of arguments in new environments

I am trying to build an invoice generation system in LaTeX which will be easy and maintainable. Right now we are using longtable and a preprocessing layer. I would like to change this to a .sty and ...