Tag Info

Hot answers tagged

10

Since the whole outer cell, which contains \specialcell should be bold, \bfseries can be specified in the outer cell, right before \specialcell: ... & \bfseries\specialcell{...} & ... This can also be put into a macro \specialcellbold, see the following example: \documentclass{report} \usepackage{booktabs} \usepackage{array} ...


7

Here's a possible solution. Note also the usage of siunitx for the numeric tables. \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{subcaption} \usepackage{booktabs} % nice rules \usepackage{adjustbox} % adjusting table (too wide) \usepackage{rotating} % sidewaytables \usepackage{siunitx} \begin{document} \begin{table}[p] \centering ...


6

\documentclass{standalone} \begin{document} \begin{tabular}{cc} \refstepcounter{enumi}\theenumi&\roman{enumi}\\ \refstepcounter{enumi}\theenumi&\roman{enumi}\\ \refstepcounter{enumi}\theenumi&\roman{enumi}\\ \refstepcounter{enumi}\theenumi&\roman{enumi}\\ \refstepcounter{enumi}\theenumi&\roman{enumi}\\ ...


6

What you gave doesn't qualify as a MWE. You have to use p type columns as for the given table D column is useless. \documentclass[a4paper,11pt,oneside]{article} \usepackage[protrusion=true,expansion=true]{microtype} \usepackage[left=3.0cm,right=3.0cm,top=3.0cm,bottom=3.0cm]{geometry} \usepackage{array} \usepackage{booktabs,threeparttable} ...


6

I don't know your purpose exactly, but this is a very bad table design. \documentclass[a4paper,11pt,oneside]{article} \usepackage[protrusion=true,expansion=true]{microtype} \usepackage[left=3.0cm,right=3.0cm,top=3.0cm,bottom=3.0cm]{geometry} \usepackage{array} \usepackage{booktabs,threeparttable,multirow,graphicx} ...


5

Juts for comparison. How to do this table in plain TeX. But it works in LaTeX (without any loaded package) too. \def\toprule{\noalign{\medskip\hrule height .8pt\medskip}} \def\midrule{\noalign{\medskip\hrule\medskip}} \let\bottomrule=\toprule \def\specialcell#1{$\vcenter{\halign{\hfil##\hfil\strut\cr#1\cr}}$} \def\x{\phantom{\%}}\def\h{\hfill\null} ...


5

longtable does \vspace{\LTPre} before a table and \vspace{\LTpost} after a table, both of which are by default \bigskipammount. Most latex display environments use \addvspace to add their vertical offsets, so that adjacent spaces combine (\addvspace just adds the maximum of any space currently on the vertical list and the space requested) but longtable ...


5

You can use \hangindent=1em\hangafter=1 and put this and \ttfamily (which I found more suitable for this case over \bfseries) in the column specifiers themselves using array package. \documentclass{book} \usepackage{booktabs,array} \begin{document} \begin{table} \caption{A summary of the default Rails directory structure. ...


5

still a fraction over-full but... \documentclass[fleqn,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{dcolumn,booktabs} \begin{document} \begin{table}\centering \begin{tabular}{ *{2}{D..{2.0} D..{4.1} D..{4.1} D..{1.2}}} \toprule & \multicolumn{3}{c}{Yellow conidia}& \multicolumn{3}{c}{Black conidia} \\ \midrule ...


5

You can use \renewcommand{\arraystretch}{2}. Change 2 as you want for example 3. \documentclass[a4paper]{exam} \usepackage{multicol, setspace} \usepackage{textcomp, booktabs,colortbl} \usepackage[table]{xcolor} \setlength\columnsep{10pt} \onehalfspacing \begin{document} \begin{center} \fbox{\fbox{\parbox{5.5in}{\centering ...


5

Please always post complete documents showing all packages used. Your code had several commands not defined by the packages I guessed so I deleted them here. The main problem was that you over-rode the L specifier with c which does not allow line breaking so forced all the entries to be too wide. \documentclass[a4paper]{article} \usepackage{tabulary} ...


5

Here is an attempt using swiss army knife aka tikz \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{capt-of} \usepackage{booktabs} % nice rules \usepackage{tikzpagenodes} % adjusting table (too wide) \usepackage{array} \usetikzlibrary{positioning} \begin{document} \begin{table}[htb] \begin{tikzpicture}[remember picture] ...


5

This uses \rotatebox to rotate the minipages and using stacking to place the subcaptions under the tables. \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{booktabs} % nice rules \usepackage{adjustbox} % adjusting table (too wide) \usepackage{rotating} % sidewaytables \usepackage{array} \usepackage{stackengine} \begin{document} ...


4

Your approach here (in terms of horizontal rules) matches that of what is suggested by booktabs. Here's what I would use: \documentclass{article} \usepackage[sc]{mathpazo} \usepackage[T1]{fontenc} \usepackage{geometry} \usepackage[labelfont=sf,hypcap=false,format=hang,width=\columnwidth]{caption} ...


4

The problem is that you are declaring theorem twice, first \newtheorem{theorem}[thm]{Theorem} and then \newtheorem{theorem}[table]{Theorem} I wouldn't also mix declarations made with \declaretheorem and with \newtheorem. In your case, I think that the following should do what you want: \newtheorem{theorem}[table]{Theorem} ...


4

If you want to have all columns with the same width and use the maximum width of your text, you should go with tabularx here: % arara: pdflatex \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[english]{babel} \usepackage{caption} \usepackage{booktabs, tabularx, threeparttable} ...


4

the later columns are all left aligned, but the first column is very wide due to \textbf{a. Time period 1886 - 1892:} which forces the width of the column. perhaps you intended to use \multicolumn so that spanned all the columns rather than forcing the first column to be wide? tabulary (and tabularx) are unsuited to this kind of table, they work by ...


4

You should use tabular and \multicolumn{17}{l}{...} for the entries spanning columns: \documentclass[12pt]{report} \usepackage{booktabs} \usepackage{caption} \begin{document} \begin{table}[htbp] \centering \caption{Yearly membership growth for different time periods} \label{tab:addlabel} \scriptsize \addtolength{\tabcolsep}{-1.8pt} ...


4

\documentclass[]{article} \usepackage{graphicx} \usepackage{color} \begin{document} \begin {table}\centering \begin {tabular}{| l | l | l | l | l | l |} \cline{2-6} \multicolumn{1}{c|}{}&\multicolumn{5}{c| }{$\eta_{\infty}$} \\ \cline{2-6} \multicolumn{1}{c|}{}& i=1,f=6 & i=1,f=3 & i=3,f=5& i=4,f=2& i=6,f=3 \\ \hline $k,l=0,0$ ...


3

latex doesn't really support this. This makes float pages have an empty foot, so it does just affect the page the table lands on, not the page before or after. It will affect all other float pages unless you set it back ie restore the original definition without the marked line. \documentclass[12pt,letterpaper]{article} \usepackage[margin=1in ]{geometry} ...


3

Use \iffloatpage from fancyhdr: \documentclass[12pt,letterpaper]{article} \usepackage[margin=1in,headheight=15.2pt]{geometry} \usepackage{fancyhdr} \usepackage[flushleft]{threeparttable} \pagestyle{fancy} \fancyfoot[C]{\iffloatpage{}{\thepage}} \usepackage{lipsum} \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} ...


3

It looks like surrounding the English text in the xepersian package's latin environment is the solution. Disclaimer: I don't know this language, but I copied the text below from the first page of the xepersian documentation. I used the Nazli font because it is freely available through my Debian distribution. \documentclass{article} \usepackage{xepersian} ...


3

Here's a solution that uses (a) the S column type of the siunitx to align the numerical entries on the decimal markers, (b) the \si macro (also of the siunitx package) to format the units, and (c) the tabularx package (and a modified form of that package's X column type for 6 of the 8 subheaders) to force the table to occupy the full width (and no more!) of ...


3

A slightly modified version of Harish Kumar's answer. Code: \documentclass[a4paper,11pt,oneside]{article} \usepackage[protrusion=true,expansion=true]{microtype} \usepackage[left=3.0cm,right=3.0cm,top=3.0cm,bottom=3.0cm]{geometry} \usepackage{array} \usepackage{booktabs,threeparttable,multirow,graphicx} \newcommand\mc[1]{\multicolumn{1}{@{}c@{}}{#1}} % ...


3

You can try the cellspace package, that defines minimal vertical spacing above and below cells in columns with specifier prefixed with the letter S. If one uses the siunitx package which also uses the letter S, the prefix is replaced with the letter C: %%%%%%%%%% \documentclass{article} \usepackage{graphicx} \usepackage[sc]{mathpazo} ...


2

Here is a solution. I removed all vertical lines, and used the booktabs, makecell and ltablex packages (the latter combines the functionalities of longtable and tabularx, and introduced some itemize inside cells environments and a few other modifications to the table layout: \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{geometry} ...


2

Here's an expansion upon prettygully's answer that lets you have line breaks and defines a new command for it: \newcommand\multibrace[3]{\rdelim\}{#1}{3mm}[\pbox{#2}{#3}]} \begin{table}[h!] \centering \begin{tabularx}{0.75\textwidth}{>{$}l<{$} l l} \text{Complexity} & Growth rate \\ \cline{1-2} O(1) & None\\ O(log ...


2

Another way is to specify manually the skip you want after each row substituting \\ with \\[skip]. In this way you can even differentiate the skip for each row. For example, in the following MWE, I've given 5ex after each white row and 7ex after each grey row: \documentclass[a4paper]{exam} \usepackage{multicol, setspace} \usepackage{textcomp, ...


2

Here is a solution using the ltablex package (adds the functionalities of longtable to tabularx. The use of tabularx allows for slighly wider columns; I also loaded ragged2e (to have some hyphenation in a raggedright context), sinuitx fr a correct typesetting of units and numbers, with its \si, \SI and \num commands and the possibility to use abbreviations ...


2

This works, but as I mentioned in comment, your geometry settings are not optimal: \documentclass[10pt]{article} \usepackage{geometry,array} \usepackage{calc} \geometry{verbose,tmargin=40pt,bmargin=40pt,lmargin=30pt, rmargin=30pt} \usepackage{showframe} % shows you the cut-off side margin \begin{document} \noindent % If the table stands alone, as ...



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