# Tag Info

1

The thead command, from makecell allows for a common formatting of its argument, line breaks and is by default vertically and horizontally centred. Demo of usage: \documentclass{article} \usepackage{array, makecell} \renewcommand\theadfont{\bfseries} \begin{document} \begin{tabular}{lll} \thead{text1 & & \\text2} & \thead{text} ...

1

I was pretty sure that this is a duplicate question, but any other question I found was way more complicated. In any case, the correct way to use \multicolumn is: \begin{tabular}{lll} \multicolumn{1}{c}{\textbf{text}} & \multicolumn{1}{c}{\textbf{text}} &\multicolumn{1}{c}{\textbf{text}}\\ a&b&c\\ 12346543432&1253156&lalala\\ ...

1

Use makecell for that, and its \thead command. In addition I loaded the mhchem and siunitx package. \documentclass{article} \usepackage{geometry} \usepackage{amsmath} \usepackage{array, booktabs, makecell} \usepackage{siunitx, mhchem} \newcommand\muL{\si{\micro\liter}} \begin{document} \begin{table}[h] \centering \small \tabcolsep=0.11cm ...

3

With help of package makecell and siunitx I redisign your table in form, which should be a starting point for your further effort in its formatting: \documentclass{article} \usepackage{booktabs,makecell} \renewcommand\theadfont{\normalfont} \usepackage{siunitx} \usepackage[margin=30mm,showframe]{geometry} \begin{document} \begin{table}[h] ...

0

This is a start, at least. I don't know that it will work well with the taller equations, but it's simple: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{tabular}{|ll|ll|} \hline \multicolumn{2}{|c|}{Mechanics} & \multicolumn{2}{c|}{Electricity and Magnetism} \\ $$v = v_0 + at$$ & $$a = \text{acceleration}$$ & \( V = IR ...

0

You need to construct the tabular in a column-wise fashion, rather than the default row-wise fashion: \documentclass{article} \usepackage[utf8]{inputenc} \begin{document} \ttfamily % Construct tabular by-row (default approach) \begin{tabular}{p{6cm}|p{6cm}} \normalfont \textbf{Entrada} & \normalfont \textbf{Saída} \\ \hline 3 3 1 & 15 ...

2

Tables 1 and 2 basically cannot fit at the bottom of the first page, and hence they must "float" to the next available space, which is on the following page. The only remedy -- other than to shorten the material on the first page -- is to insert an explicit \clearpage before the start of the fourth section. Some further comments -- strictly about the LaTeX ...

2

\clearpage will force a page break and flush any pending figures, as shown below. \documentclass{article} \usepackage{array,float} \newcolumntype{C}{p} \begin{document} \section*{Tables} \begin{table}[ht] \caption{Some table} % title of Table \centering \begin{tabular}{ C{2.5cm}} \textit{m} \\ [0.5ex] 0 \\ 1 \\ % inserting body of the table 2 \\ ...

3

The answer depends a bit on what "onehalfspacing" entails. If it's equivalent to \setstretch{1.5}, you should try \renewcommand\arraystretch{1.5}. If your tabular-like envrionments are located inside table environments, and if you're using the terminology of the setspace package and your main font size is 10pt, you should try ...

1

As mentioned in the comments to the question, defining a new command as \\\\ is impossible, because redefining \ conflicts with the existing meaning of \ used as an escape sequence. Even if \\\\ seems to be more convenient to type instead of \\[\normalbaselineskip], this is not a good coding practise (loss of readability). Use cases like adding more ...

6

This uses a new column type called E (like enumerate) and a counter called rowcounter which increases in each row, the first row is omitted here. The table column is left aligned, but r - type might be better! Please note that this will fail after 26 rows of course since the \alph output cannot handle counter values larger than 26. The \alphalph command ...

2

The solution given in the question you linked (How can I keep my TikZ overlay picture on the same page?) does work here, in the following sense: \begin{longtable}{p{3cm}p{3cm}} \toprule first column & second column\tikz [remember picture] \node (rightmark) {};\\ \midrule \endhead A & A \\ A & A \\ A & A \\ A ...

2

You can try nested tables so that the column with less content can be entered as separate small tables with more than one row. Each separate table may contain three rows against one cell in column B. Using an m-type column (from the array package) will force table cells to be vertically centered. \documentclass[12pt,a4paper]{article} ...

0

You have not provided any example so this is untested but \usepackage{article} \usepackage{rotating} \begin{document} .... \twocolumn \begin{sidewaystable} ... \end{sidewaystable} text..... \onecolumn more text...

1

You have not provided any usable example so this is untested but it looks like you do not need a table construct at all: %% List environment %%%%%%%%%%%%%%%% \newenvironment{entrylist}{\par\raggedright}{\par} \newcommand{\entry}[4]{% \makebox[2cm][l]{#1}parbox[t]{13cm}{% \textbf{#2}% \hfill% {\footnotesize\addfontfeature{Color=lightgray} ...

2

assuming every column has at least one non-circled number you could use \mycircled{1} defined via \newcommand\mycircled[1]{\makebox[0pt]{\circled{#1}}} Which hides the width of the circled entries. Otherwise you could replace 0pt by \digitwidth defined by \newlength\digitwidth \settowidth\digitwidth{1} To force a circled digit to be as wide as a ...

0

You can look at How to keep a constant baselineskip when using minipages (or \parboxes)? Don't use \rlap and \llap if you don't know how they work (and you don't, judging from the code): you'll incur in very unexpected behaviors. \documentclass[10pt, a4paper]{article} \usepackage{multicol} \newcommand{\ntab}[2]{% \par\noindent ...

2

Code for above table is: \documentclass{article} \usepackage{booktabs,makecell,rotating} \renewcommand\theadfont{\bfseries} \settowidth\rotheadsize{\theadfont pair} \usepackage[margin=25mm,showframe]{geometry} \begin{document} \begin{table}[h] \centering \begin{tabular}{r*{11}{l}} \toprule & ...

1

for single-line entries it's more natural to use l and let the table find the natural width of the content, also you need to allow the note in the foot to span more columns. Also landscape is an environment. \documentclass{article} \usepackage{longtable,pdflscape,booktabs} \begin{document} \begin{landscape} \begin{longtable}{lllp{2cm}p{4cm}lp{3.5cm}} ...

1

You can do it by specifying the font in the cells where you want boldface italic; also, common words in the header can better be placed just once: it happens that the sum of the natural width of the third and fourth columns is less than the width of “Line Arguments”, so the excess goes to the fourth column, causing misalignment. For making the header ...

2

Re Doubt 1: If you want to set math material in bold, use a directive such as \mathversion{bold}; \boldmath works too. \textbf is not correct here. Re Doubt 2: If you want all entries in a column of type S to be typeset in bold italics, it's a good idea to provide this information in the column definition, via a specification such as ...

1

By help of tables nesting and use m column type from package `array: \documentclass[letter]{article} \usepackage{array,booktabs,paralist}%enumitem \usepackage{lipsum} \begin{document} \begin{tabular}{c m{2in} m{2in}} \toprule & \hfil \textbf{ColName1} & \hfil \textbf{ColName2} \\ \midrule \textbf{RowName1} & ...

1

I accepted @Mico's answer as best because his provided me a template to get exactly what I wanted with very little added work. In particular, I tinkered with the colors, the vertical alignment of the row heads, and created a nice little legend thing with minipage. \documentclass{article} \usepackage[table,svgnames]{xcolor} ...

3

Here's an attempt to replicate the table in the screenshot you posted. A comment: Given that you want to use colors, I would do away with all interior lines of the table. (I've already omitted all exterior lines.) \documentclass{article} \usepackage[table,svgnames]{xcolor} \begin{document} \begin{table}[ht] \arrayrulecolor{white} \centering ...

2


7

You've set the column type for the second column to S even though there are no numbers to be aligned on decimal points in that column. Some entries in that column -- such as "Male" and "Black" -- thus show up in math italics; other entries, such as "Quintile 3", have been encased in curly braces and are therefore treated as centered text by the syntax rules ...

2

A p column is essentially identical to a \parbox. In both cases they use \@arrayparboxrestore to normalise several things. If you don't want parskip and parindent normalized but left as in the main document just redefine the command not to reset them: \documentclass{article} \usepackage{array} \setlength{\parindent}{0mm} \setlength{\parskip}{8pt} ...

0

Use \extrarowheight or, better, don't use vertical lines and load booktabs. Here is a demo of both solutions: \documentclass[a4paper,12pt]{report} \usepackage{array, booktabs} \usepackage{multirow} \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}} \usepackage{makecell} \setcellgapes[t]{4pt} \begin{document} \begin{table}[!htbp] \centering% ...

1

Actually, minipage and \parbox reset \parskip to 0pt, so you will have to reset it inside. While in this case we know \parskip=8pt, in general that will not be true. \documentclass{article} \usepackage{array} \setlength{\parindent}{0mm} \setlength{\parskip}{8pt} \newlength{\oldparskip} \begin{document} \textbf{par inside tabular} \oldparskip=\parskip ...

1

@Hadson, Code in your link is far from minimal working example ... Anyway, you have two problems: you request from tables (with empty line bertween them) to be each in new line second tables are to width to both fits in one line in text width. For show what I do, I made from code the following MWE: \documentclass[a4paper,titlepage,10pt]{article} ...

0

Alright, at least I figured out how to get rid of the issue, although I couldn't quite find the origin of it. First of all thank you very much for your help @cfr . As I tried to compile a fresh sample of classicthesis and the error still kept popping up, I switched to my linux distribution and successfully hit the pdflatex to create an error free version. ...

2

The main error is caused by the missing required argument to \begin{adjustbox}. On the other hand, surrounding the table with \begin{adjustbox}{} <table> \end{adjustbox} does nothing, except localizing the font size change. But keeping it for future adjustments is not harmful. You also had wrong {} in the argument to tabular and && when it ...

2

Here's a solution that gets by without an adjustbox mechanism, and which compiles fine with both the report and the memoir document classes. It uses a tabularx environment to assure that the table takes up the full width of the text block. \documentclass[a4paper,12pt]{report} \usepackage[margin=1in]{geometry} \usepackage{booktabs,amsmath,tabularx} ...

2

I don't see any benefits of use of adjustbox (it as was provided in MWE, cause error) in your table, I comment it (for possible future proper use). After erasing all surplus ampersands and slightly "prettifying" of your table I got at memoir as document class the following result: \documentclass[a4paper,12pt]{memoir} \usepackage[margin=1 ...

1

A blank line starts a new paragraph, which is indented. Paragraphs following section headings are not indented, by default. So you need to prevent indentation of subsequent tables to ensure vertical alignment: \documentclass{article} \usepackage[table]{xcolor} \begin{document} \section{User Requirements} \hfill \begin{tabular}{|p{2.8cm}||p{12cm}|} \hline ...

1

You wrote ... The best I could find was using \multicolumn, but I guess that's not the proper way to do it, since its real purpose is to merge cells." Not quite. I'd say that \multicolumn has two real purposes: (a) to merge cells -- the purpose you mention -- and (b) to change the column type of its argument, be that a single cell or a range of cells. ...

2

You've done it almost the right way. If you want to have a shorter code, you can define a command that will replace all these \multicolumns. Here is a way to do it, with some minor improvements to your table: \documentclass{book} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{array} \usepackage{xparse} ...

1

Some suggestions: Use a tabularx environment instead of a tabular environment. Use a column type that permits wrapping of long material. Load the babel package with the appropriate language setting. (In the example below, I set "indonesian", but I may be completely wrong. Choose a smaller font size, and reduce the amount of whitespace that's inserted ...

3

You haven't exactly provided a lot of details about the table you wish to create. In the following example, a table environment is set up to house a \caption (along with a \label so that the table may be cross-referenced elsewhere in the document) as well as a two-column tabular environment. The macros \toprule, \midrule, and \bottomrule -- all provided by ...

1

The package pythontex requires, among other packages, filehook which is the bad guy in this case. The definition of \InputIfFileExists becomes \renewcommand{\InputIfFileExists}[2]{% \IfFileExists{#1} {\expandafter\filehook@swap\expandafter{\@filef@und}{% #2\@addtofilelist{#1}% \filehook@every@atbegin{#1}% ...

2

Some suggestions: Get rid of all vertical rules and most horizontal rules in the table. All those lines don't really improve legibility -- in fact, they add a lot of visual clutter that may reduce legibility... Load the booktabs package and use its \toprule, midrule, \bottomrule, and \cmidrule macros to get well-spaced horizontal rules. Your table, with ...

1

Only a first trial, due to lack of time --fill in the rest of information \documentclass{article} \usepackage[lmargin=1.5cm,rmargin=1.5cm]{geometry} \usepackage{tabularx} \begin{document} \begin{tabular}{|p{0.45\textwidth}|@{}p{0.45\textwidth}@{}|} \hline \begin{tabular}{@{}l@{}} \large \bfseries Chintaka Mandura \tabularnewline Bsc.Eng(Hons), University ...

1

according to chapter "5.3 Aligning the Nodes Using Matrices" in the pgfmanual I would try the TikZ matrices to reproduce something like this: \documentclass{standalone} \usepackage[usenames,dvipsnames,svgnames,table]{xcolor} \usepackage{tikz} \usetikzlibrary{positioning,shapes,shadows,arrows,matrix} \begin{document} \begin{tikzpicture} ...

1

Depending on your pdf viewer, you may have to zoom in to see the lines, but also your markup seems excessively complicated, I reproduce here with most of the markup commented out. \documentclass{article} \usepackage[table]{xcolor} \newcolumntype{R}{>{\raggedright\arraybackslash}p} \begin{document} %no\begin{center} \begin{table}%no[] \centering ...

3

Remove \\ from \\\cline{2-3}\cline{6-8} result should be: \toprule & \multicolumn{2}{c}{Heading text} & & & \multicolumn{3}{c}{Even more heading text}\\\cline{2-3}\cline{6-8}

0

So far, I have been succeeding working around these complex alignment possibilities and strict requirements by combining tcolorbox longtable threeparttable This answer (http://tex.stackexchange.com/a/170767/69378) got me going in getting a base formatting and easily adjustable size structure in place. Then when I coupled it with the table packages ...

2

It sounds like you'd like an automated approach, which makes me think of the pgfplotstable package. In the code below, I've used: \pgfplotstabletypeset[ every head row/.style={output empty row}, postproc cell content/.code={ \ifodd\pgfplotstablerow\relax \pgfkeysalso{@cell ...

1

Here's an option using the pgfplotstable package: % arara: pdflatex % !arara: indent: {overwrite: yes} \documentclass{article} \usepackage{pgfplotstable} \begin{document} \pgfplotstabletypeset[ every head row/.style={output empty row}, postproc cell content/.code={ \ifodd\pgfplotstablerow\relax \pgfkeysalso{@cell ...

3

Here is a solution, with etoolbox and array: I create a rowcnt counter initialise it at the beginning of the tabular environment and reset it at the end. A \altshape command is executed at the beginning of each cell, the result of which depends on the parity of rowcnt: \documentclass{article} \usepackage{array} \usepackage{xcolor, etoolbox, dcounter} ...

0

I'm not sure, if I correctly understand your question, so I will help myself with the following picture: Is this what you looking for? Above picture is generated by: \documentclass{article} \usepackage{booktabs,multirow} \usepackage{siunitx} \newcommand{\ml}[1]{\multicolumn{1}{l}{(\itshape #1\upshape\,\,\%)}} \begin{document} ...

Top 50 recent answers are included