Tag Info

New answers tagged

1

I have found the solution to my own question. It seems that (as Werner pointed out), since \multicolumn allows for independent vertical rules for each cell, the location of the divider character, |, will change the appearance of the overall table, as seen in the figure in the above question. The solution is to ensure that you are consistent with the ...


0

After reading (again) the documentation for the datatool package I've found some commands that helped me doing what I wanted. In case someone have the same trouble, these are the commands \renewcommand{\dtldisplayafterhead}{\hline \hline} For adding two horizontal lines after the header \renewcommand{\dtldisplayendtab}{\tabularnewline \hline \hline} For ...


4

You have no X columns so tabularx is doing nothing useful here. You can just use longtable and prevent page breaks with \\* Unfortunately longtable always allows a break at a \hline but it is simple to define a variant that doesn't. \documentclass[10pt]{article} \usepackage[top=2.5cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry} \usepackage{helvet} ...


4

One option is to use adjustbox with export option. Then valign is available as a key to \includegraphics \documentclass{article} \usepackage{array} \usepackage{graphicx} \usepackage[export]{adjustbox} \begin{document} \begin{table} \begin{tabular}{lcr} & $\downarrow$ & \\ ...


1

Well \rule has an optional argument to adjust the vertical alignment: \documentclass{article} \usepackage{array} \begin{document} \begin{table} \begin{tabular}{lcr} & $\downarrow$ & \\ $\rightarrow$ & \rule[-2cm]{4cm}{4cm} & $\leftarrow$ \\ & ...


2

You can have a much simpler code, using the makecell package. The caption package helps getting a caption like the image in the O.P.s question. However, I suggest another layout using booktabs, with no vertical lines. The code below shows both layouts: \documentclass{article} \usepackage{multirow,graphicx} \usepackage{mathtools} \usepackage{makecell, ...


4

If you are prepared to use pgfplotstable then this can be done. It contains a construct to divide columns in to equal parts to simulate multicolumn tables, namely select equal part entry of. Dividing in to two columns is achieved with the first column being given style select equal part entry of={0}{2} and the second select equal part entry of={1}{2}. You ...


2

Consider just a suggestion in terms of displaying the information. You seem to be using row/column indices, which I've set using \small. I've used hhline to highlight the blocks (requires a fragile frame): \documentclass{beamer} \usepackage{array,tabularx,hhline} \newcolumntype{C}{>{\centering\arraybackslash}X} ...


0

this is not what you looking for but maybe it help \documentclass[a4paper]{extarticle} \usepackage{lmodern,datatool,tabularx,multicol,ifthen} \setlength{\columnsep}{0pt} \begin{filecontents*}{data.csv} Name,Number name1,nr1 name2,nr2 name3,nr3 name4,nr4 name5,nr5 name6,nr6 name7,nr7 name8,nr8 name9,nr9 name10,nr10 name11,nr11 name12,nr12 name13,nr13 ...


4

It's always possible to use an \includegraphics command within a table environment, but the other question is, whether the included 'table' looks like like a table. \documentclass[]{article} \usepackage{graphicx} \begin{document} \begin{table} \centering \includegraphics{pic1} \caption{this is actually table1} \end{table} \end{document} Alternative ...


6

You mean like this? \documentclass{Article} \usepackage{multirow,graphicx,array} \begin{document} \begin{table}[!htbp] \centering %% use this instead of \centerline \resizebox{0.90\linewidth}{!}{\begin{tabular} {|>{\centering}p{15pt}|>{\centering}p{25pt}|>{\centering}p{63pt}|>{\centering}p{26pt}| ...


4

Here's one possibility; the \multirow command from the multirow package won't be useful here since a TikZ matrix is not really a standard LaTeX matrix; you can use the anchors for some of the matrix cells to place the labels at the desired location (defining a command to do so, as in my example code). I also drew some horizontal lines to separate the groups ...


6

Yes, with tabularx. MWE \documentclass{article} \usepackage{tabularx} \newcolumntype{Y}{>{\raggedleft\arraybackslash}X} \begin{document} \noindent x\hrulefill x \begin{table} \centering \begin{tabularx}{\linewidth}{YcX} $-0.3858 * 10^{5}$ & for & $H_2O + COS \rightarrow H_2S + CO_2$ \\ $-0.6927 * 10^{5}$ & for & $2H_2O + CS_2 ...


4

Your columns are too narrow (with your code you receive Overfull \hbox warnings); as soon as you increase the width, you get the desired result, Using \extrarowheight you can improved the vertical alignment: \documentclass[xcolor=table]{beamer} \usepackage{ragged2e} \usepackage{tabularx} \newcolumntype{C}[1]{>{\Centering}m{#1}} ...


2

there isn't a problem with the rules really if you print or zoom in they are all there, some pdf viewers are better than others at showing them. If it bothers you that they come and go in a viewer one option is not to use them they don't really add a lot to the understanding of the table really. the only problem is the table is too wide Overfull \hbox ...


0

You can that with a simple alignat. I also use the tabstackengine package and mathtools to define a variant of \xrightarrow with a predefined length (default: 2em). I also define a \particle command with two arguments. If the text under the particle is too wide, you can use \clap from mathtools to prevent unwanted gaps between arrows and particle names: ...


2

Another option: MetaPost, here in a LuaLaTeX program. Here N gives the number of boxes, n the box which must be filled, len and h are the dimensions of a box. To be adapted at will. \documentclass{standalone} \usepackage{luamplib} \mplibsetformat{metafun} \mplibtextextlabel{enable} \usepackage{xcolor} \definecolor{myblue}{RGB}{42,87,102} ...


1

I would use tikz-cd here: % arara: pdflatex \documentclass{article} \usepackage{dsfont} \usepackage{mathtools} \usepackage{cancel} \usepackage{tikz-cd} \newcommand{\textCD}[1]{\begin{tabular}{@{}l@{}}#1\end{tabular}} \begin{document} \[ \renewcommand{\arraystretch}{0.7}% \begin{tikzcd}[row sep=-0.5ex, column sep=2.11em] ...


5

Two TikZ-free options: First, using some defined boxes and \xleftrightarrow: \documentclass{article} \usepackage{xcolor} \usepackage{mathtools} \definecolor{myblue}{RGB}{42,87,102} \newcommand\MyBox[2][white]{\fcolorbox{black}{#1}{\rule[-0.35cm]{0pt}{1cm}\makebox[1cm]{{#2}}}} \begin{document} \begin{minipage}{\dimexpr7cm+14\fboxsep+11\fboxrule\relax} ...


7

One possibility, using a TikZ's matrix of math nodes: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \definecolor{myblue}{RGB}{42,87,102} \begin{document} \begin{tikzpicture} \matrix[ matrix of math nodes, row sep=-\pgflinewidth, nodes={ draw, text width=1cm, align=center, minimum height=30pt } ] (mat) { ...


5

Use longtable \documentclass{article} \usepackage{lipsum} \usepackage{mathrsfs,amsmath} \usepackage{longtable} \begin{document} \lipsum[1-2] \begin{longtable}{ | l |l | l | l |l|} \hline $D$ & $\text{C}$ & $\text{ A } $ & $\text{ B } \mathscr{E}_{n_2(i)}$ & $\text{ E } $\\ \hline \endfirsthead % \multicolumn{5}{l}% {{\bfseries ...


4

This is my approach, by order of preference, without decreasing the font size, totating or scaling text: Remove unnecessary words or change by shorter words or redesign the table. This is not showed in my MWE, because I do not understand the meaning of the example table, but probably all/most the words "generated" can be deleted without lost any meaning. ...


1

Here I use a TABstack. Key points for the first MWE (alternative form given later in the answer): I invoke uniform column width with \fixTABwidth{T} One can set the column gap with \setstacktabbedgap{length} I have demonstrated a few 2-digit entries, to demonstrate right-alignment of matrix columns. If you don't like the parens on the matrix, replace ...


1

Since your code won't compile as it stands, I've edited a minimal amount to demonstrate: \documentclass{article} \usepackage{colortbl} \usepackage{multirow} \usepackage{xcolor} \begin{document} \begin{tabular}{*{5}{c}} \multicolumn{2}{|>{\columncolor{cyan}}c}{ } & \multicolumn{3}{>{\columncolor{cyan}}c|}{Basic Info} \\\hline ...


7

Without resizing, you can use the makecell package and rotate the column heads: \documentclass[12pt]{report} \usepackage{array, makecell, booktabs, rotating} \renewcommand\theadfont{\bfseries} \renewcommand\theadalign{lc} \begin{document} Text text text text text text text text text text text text text text text text text \begin{table}[h] ...


-2

Important note: resizing components doesn't look very nice. Consider revising the table itself to fit fully-scaled in the page, or possibly changing the font size to \small or whatever's appropriate. If you're just concerned with resizing the table to fit within the width of the page, the graphicx package provides \resizebox, which will do the trick. ...


1

You have to fix equal minimum size to equivalent columns and rows in both matrices to obtain similar sizes. Otherwise, first column of costmat is adjusted to its size which is narrower than first column in conmat. \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \tikzset{box/.style={draw, minimum width=3cm, minimum height=1cm}} ...


2

Your table is too wide for the page. You will have to rotate it or reformat it completely. You could also try to reduce each column with p{...cm} columns or by reducing the font size, but this will not help for good readability. % arara: pdflatex \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{multirow} \usepackage{booktabs} ...


2

You can avoid guessing the required length by noticing you want to span 2 X columns, a 3cm p column and two intercolumn gaps each of width 2\tabcolsep \documentclass[a4paper]{article} \usepackage{tabularx} \usepackage{array} \usepackage{booktabs} \begin{document} \textbf{Array A :} \vspace{\baselineskip} \noindent ...


4

The tabularx documentation suggests to not use the X specifier in \multicolumns and also to not use \multicolumn entries which cross any X column. If you really want to do that, you'd better use a p column and you don't need a minipage. Also, without a \noindent, using \linewidth exceeds the margins. Last, but not least, use \sffamily instead of the ...


4

If you specify a width in \multirow, it is essentially a p column, so you specify alignment in the same way: \documentclass{standalone} \usepackage{multirow} \begin{document} \begin{tabular}{|r|p{5cm}|} \multirow{2}{2.3cm}{\raggedleft text1 text1 text1} & text2 \\ & text3 \\ & text4 \\ \end{tabular} \end{document}


1

The cellspace is done for that. It defines a minimal vertical distance between the contents of a cell and the cells aboce and below. All you have to do is prefix the column qualifier with the letter S ( or C if you've loaded siunitx). To keep the other cells vertically centred, I defined a \cincludegraphics command. I think this code produces what you ...


0

I figured it out, I have to add an extra { before the resizebox command: so it will be like: \begin{rotate} \begin{table}[c] \centering \TABLE {Summary Table of Literature Review.\label{clist}} {\resizebox{1.4\textwidth}{!} {\begin{tabular}{cccccccc} first paper in addition & Yes & No & ...


7

After relocating some of lines, \documentclass{Article} \usepackage{tabularx} \newcounter{StepListCounter} \renewcommand\item[2]{% \medskip\noindent {\textbf{\arabic{StepListCounter}}\stepcounter{StepListCounter}} & #1 & & #2 \\ } \newenvironment{steplist} {% \medskip \setcounter{StepListCounter}{1}% ...


2

Here is a 2-page table. It is wider than the default article page width but I diod not change that as you gave no indication of your document setup (Please always supply full documents as below, not just fragments). \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{array,longtable} \begin{document} ...


2

Here is a solution. I make \headline part of tabularx. There is no need to split tabular \documentclass[10pt]{article} \usepackage{ltablex} \usepackage[top=2.5cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry} \usepackage{bibentry} \usepackage{etoolbox} \usepackage{helvet} \usepackage{xcolor} \usepackage{graphicx} \usepackage{color} ...


2

You can easily define new float types. \documentclass{memoir} \usepackage{lipsum} % for mock text \newfloat{usecase}{luc}{Use case} \begin{document} \lipsum[1] \begin{table}[htp] \centering \caption{A caption} A table here \end{table} \lipsum[2] \begin{usecase}[htp] \centering \caption{This is a caption.} \label{tab:some_table} Whatever should ...


0

As found here: You can use the caption package. To blatantly rip off @azetina, \documentclass[12pt, letterpaper]{article} \usepackage{caption} \begin{document} \begin{table}\centering \captionsetup[table]{name=New Table Name} \begin{tabular}{|c|c|} test & test\\ \end{tabular} \caption{test caption} \end{table} \end{document} In order to do this ...


2

Explicit usage of \selectlanguage in a document should be very rare. In your case the correct command to use is \foreignlanguage: \documentclass{article} \usepackage[T2A,T1]{fontenc} \usepackage[utf8x]{inputenc} \usepackage[slovak,ngerman]{babel} \usepackage{droid} \usepackage{tipa} \usepackage{array,longtable} ...


1

The macro discussed here is very curious mix of plain TeX and LaTeX approach. In pure plain TeX it can look like: \def\tableau#1{\vbox{\offinterlineskip \let\\=\cr \ialign{&\cellify{##}\cr #1\crcr}}} \def\cellify#1{\ifx^#1^\else \vbox{\kern-.2pt\hrule \hbox to18pt{\kern-.2pt\vrule height12pt depth6pt\hss#1\unskip\hss\vrule\kern-.2pt} ...


4

This is another solution, using siunitx, booktabs, makecell and threeparttable. With a small margin (1.8cm) the table fits into the margins if the font size is set to \small. Hope to have turned nightmare into a mellow dream… \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[margin=1.8cm]{geometry} ...


3

There seems to be too much data to put into one landscape table really, I used a small font and stole some margins but really it needs a different layout of some subject knowledge to compress the data (eg reduce the number of decimal places in some fields) \documentclass[a4paper]{article} \usepackage{dcolumn,booktabs} \newcolumntype{d}[1]{D..{#1}} ...


4

You had the #1 #2 #3` in the wrong order, and an unused optional argument. Here I show two forms \nonBranchingRule with three mandatory arguments and \nonBranchingRuleB where the rule argument is optional argument given first, in []. \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} ...


4

This happens because colortbl draws the rows over the columns. Adopt this trick. Add the following lines in your preamble: \usepackage{etoolbox} \makeatletter \patchcmd{\@classz} {\CT@row@color} {\oldCT@column@color} {} {} \patchcmd{\@classz} {\CT@column@color} {\CT@row@color} {} {} \patchcmd{\@classz} {\oldCT@column@color} ...


1

booktabs is recommended. See the manual for further tips. \documentclass{article} \usepackage{array,booktabs} \begin{document} Table \ref{tab:2} lists all the variables in the model. \begin{table} \caption{Variable Descriptions} \label{tab:2} \centering \begin{tabular}{>{\itshape}ll} \toprule \upshape Variables ...


7

One possibility is to use \\ \hline\noalign{\pause} Code: \documentclass{beamer} \begin{document} \frame{ \frametitle{Title} \begin{tabular}{|c|c|} \hline Row1L & Row1R \\ \hline\noalign{\pause} Row2L & Row2R \\ \hline \end{tabular} } \end{document}


1

A MetaPost way of doing this: prologues := 3; outputtemplate := "%j-%c.mps"; input latexmp; setupLaTeXMP(options = "12pt", textextlabel = enable, mode = rerun); % t[] values on top, b[] values on bottom % u spacing between columns, v arrows length vardef corresp(suffix t, b)(expr u, v) = save i; numeric i; i = 1; forever: exitif (unknown ...


3

If you use the array package you can create new column types with a fixed width and a left/center/right horizontal alignment (see http://tex.stackexchange.com/a/12712/46716). That way all your column can have the same width (if wanted). Create the rectangle with \cline \documentclass{IEEEtran} \usepackage{array} \renewcommand{\arraystretch}{1.25} ...


0

One more solution with tikz-cd: % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd}[column sep=1.7em, every arrow/.append style={<->}] 1\arrow{d} & 2\arrow{d} & 3\arrow{d} \\ 0 & 1 & 2 \end{tikzcd} \end{document}


2

You can try something like this: \documentclass{report} \usepackage{booktabs} \begin{document} \begin{center} \renewcommand{\arraystretch}{1.25} \begin{table*}[!t] \centering \caption{Table Teste}\label{tab:teste2} \begin{tabular}{ccc|cccc|cccc} \toprule & & & \multicolumn{4}{c|}{hola} & & & ...



Top 50 recent answers are included