Tag Info

Hot answers tagged

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}% ...


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] ...


6

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

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} ...


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. ...


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}


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

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} ...


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 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}} ...


3

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 ...


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 ...


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

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} ...


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 ...


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} ...


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

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}} ...


1

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 ...


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] ...


1

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} ...


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 ...


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} ...


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}} ...


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 ...


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 ...



Only top voted, non community-wiki answers of a minimum length are eligible