New answers tagged

3

You're overspecificating: stating column widths is usually unnecessary; you also have p{2.5cm}X which means two column specifiers. If you want that the first column takes all the available space, use X; for getting centered entries, >{\centering}X. \documentclass{article} \usepackage{array} \usepackage{tabularx} \usepackage{booktabs} ...


2

an alternative ... withtabularx and siunitx instead of D columns: \documentclass{article} \usepackage{tabularx} \usepackage{booktabs} \newcolumntype{d}[1]{D{.}{.}{#1}} \usepackage{siunitx} \begin{document} \begin{table} \begin{tabularx}{\textwidth}{X S[table-format=1.4] ...


2

When using the D column type, be careful to provide only one number containing a decimal marker per cell. Also, take care to distinguish between a typographic - ("minus") and -- ("en-dash") symbol. I would suggest you organize the table as follows: \documentclass{article} \usepackage{dcolumn,booktabs} \newcolumntype{d}[1]{D{.}{.}{#1}} ...


0

Please try to trim examples to just the required packages, in this case your example just needs \documentclass[12pt]{article} \usepackage{tabularx} % provides a column type called "X" that should satisfy your professed need to have several equal-width columns \usepackage{booktabs} \usepackage{threeparttable} %\usdate \usepackage{dcolumn} ...


4

I propose two layouts with tabularx, with vertical rules and without. I loaded booktabs, andcellspace` to give some vertical padding to the rows: \documentclass{article} \usepackage[letterpaper, portrait, margin=2cm]{geometry} \usepackage[english]{babel} \usepackage[protrusion=true,expansion=true]{microtype} \usepackage{amsmath,amsfonts,amsthm,amssymb} ...


4

Perhaps this will at least provide some ideas. I'm not sure what the final contents of the table will look like but I assume some empty cells will end up filled which will change things. At least, that's what I assume here. This is an abuse of both makecells and booktabs. \midrule is not meant to be used like this. Neither is \diaghead. ...


0

I just want all the columns to be equal and be centered. I suggest you define a centered version of the X column type and use it for all four columns. \documentclass{article} \usepackage{tabularx} \newcolumntype{C}{>{\centering\arraybackslash}X} \begin{document} \begin{table}[!ht] \begin{tabularx}{\linewidth}{*{4}{C}} \hline\\ ...


0

The preamble of your tabularx environment wasn't correct for what you want (you had one X column and 4 centred columns with their natural width). I took the liberty to replace the \hlines with rules from the booktabs package, which hace some vertical padding around them and a variable width, looking more ‘professional’: \documentclass{article} ...


2

This is a side effect of the tabulary package. In this package, tables are evaluated twice, to ensure right widths in columns. In your example, sums are increased by 43 (the last value ontained in the first evaluation!). Modify your code to ensure that \mySum is zero when the second calculation occurs: \begin{document} \begin{minipage}{.25\textwidth} ...


1

\documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{mathtools,} \usepackage{array} \begin{document} \begin{tabular}{ r| l} \arraycolsep=1.4pt \def\arraystretch{1.5} $\begin{array}[t]{@{} r l @{}} C_{g|in} &=C_{gn}+C_{gp}\\ C_{int} &=C_{outputnode}\\ p &=(C_{gate}/C_{inv})_{int}\\ ...


0

Two versions, with different alignments. \documentclass{article} \usepackage{amsmath,array} \newcommand\tab{\quad} \newcommand\tsub[1]{_{\textup{#1}}} \begin{document} \begin{center} \hspace*{\fill}% $\begin{gathered} C_{g|\mathrm{in}}=C_{gn}+C_{gp}\\ C\tsub{int}=C\tsub{outputnode}\\ p=(C\tsub{gate}/C\tsub{inv})\tsub{int}\\ ...


1

Like this? I changed gather* to gathered to remove \abovedisplayskip used the [t] optional argument for both gathered and tabular: \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{mathtools,} \usepackage{array,tabularx} \begin{document} \begin{tabularx}{\linewidth}{X| ...


3

I would do it this way. Note you can use accented letters from your keyboard, as all systems nowadays understand UTF8: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{amsmath,tabularx, float, booktabs} \renewcommand{\tabularxcolumn}[1]{>{\centering\arraybackslash}m{#1}} \begin{document} ...


0

Quick and dirty: you can reduce the fontsize and make the columns narrower. Still an overfull box, so it's bigger than the text area, but it fits the (A4) page at least. \documentclass[a4paper]{article} \usepackage[table]{xcolor} \usepackage{array,rotating} \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} ...


3

A small variant, loading the caption package for a sensible vertical skip between caption and table, and a supplementary empty column to ensure centring of the bi-column heads: \documentclass{article} \usepackage{array, booktabs, caption} \begin{document} \begin{table} \centering \caption{Some table} \begin{tabular}{@{}cc@{\qquad}ccc@{\qquad}c@{\,}} ...


4

I'd argue that all vertical lines in the table -- and not just the one in the top-left corner -- are undesired. For sure, the vertical lines aren't needed, as the following screenshot is meant to illustrate. Do consider giving your table a more "open" look. Your readers will thank you, implicitly, by being more inclined to absorb the information contained ...


6

To remove the vertical bar, add \multicolumn{1}{c|}{} to the first cell. The reason for the different column widths is described in Table column widths disproportionate due to multicolumn cell being too long A workaround is shown below. \documentclass{scrartcl} \usepackage{array} \begin{document} \begin{tabular}{|c| ...



Top 50 recent answers are included