Tag Info

Hot answers tagged

7

When a p (or m) cell is started, \everypar is not void, but it contains \vrule\@height\ht\@arstrutbox\@width\z@\everypar{} which is the code that provides the insertion of a strut at the beginning of the paragraph. With your code you're removing this. \documentclass{article} \usepackage{array} \newcommand{\dohang}{\hangindent1em\hangafter1 } ...


6

pbox doesn't seem to help you much here, I'd just use tabular \documentclass[a4paper]{article} \usepackage{array} \setlength\extrarowheight{2pt} \begin{document} \newcommand\pb[1]{% \begin{tabular}{@{}l@{}}#1\end{tabular}} \begin{table}[htp] \begin{tabular}{|l|l|l|l|l|} \hline \multicolumn{2}{|l|}{SOME TEXT HERE} & \multicolumn{3}{l|}{Big ...


6

\documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{gathered} \left.\begin{array}{c@{\,\,}c@{\,\,}c} \sin&\leftrightarrow&\tanh\\ \cos&\leftrightarrow&\sec \end{array} \right\} \sin^2 x + \cos^2 x = 1 \\ %% second line \left.\begin{array}{c@{\,\,}c@{\,\,}c} \sin&\leftrightarrow&\tanh\\ ...


5

Please unlearn your habit of using \left ... \right all over Drop the [], they do nothing to the interpretation of that column use the s column, and in that column just write say \meter In code \documentclass[10pt,a4paper]{report} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} ...


5

This can be done with the help of the collcell package (loads array). Just define your column as \newcolumntype{U}{>{$[\collectcell\si} l <{\endcollectcell]$}} and you're done. MWE \documentclass[10pt,a4paper]{report} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} ...


5

You can use the makecell package for that: it allows for linebreaks and common formatting in certain cells, with the \makecell and \thead commands: \documentclass[a4paper]{article} \usepackage{array} \usepackage{makecell} \renewcommand\cellalign{lc} \setcellgapes{3pt} \makegapedcells \begin{document} \begin{table}[htp] \begin{tabular}{|*{5}{l|}} \hline ...


5

It's easier to set \tabcolsep to zero then add space where you need it, this has some space in the outer columns, and tight space in the middle \documentclass[11pt,onecolumn]{article} \usepackage{array} \usepackage{color, colortbl} \definecolor{mColor1}{rgb}{0.9,0.9,0.9} \begin{document} \newcolumntype{N}{@{}>{\columncolor{red}[0pt][0pt]}m{0pt}@{}} ...


5

You need to make the table narrower than the text width, also as latex warns: LaTeX Warning: Unused global option(s): [paper=a4]. The document class option syntax was wrong. \documentclass[a4paper]{article} % A4 paper and 11pt font size \usepackage[dutch]{babel} % Dutch language/hyphenation \usepackage{array} ...


4

If you insist, here is again a two column table as it makes good alignment. \documentclass{article} \usepackage{xtab,booktabs,array} \usepackage[textheight=10cm]{geometry} %% just for this example. \begin{document} %\topcaption{This is top caption} %\bottomcaption{This is bottom caption} %\tablecaption{this is table caption} \tablefirsthead{ ...


4

I think it's easier to define a new column type C \newcolumntype{C}{>{\hspace{-\tabcolsep}}c} and use it instead of c to obtain what you want, so you don't have to manually specify the spacing. MWE \documentclass[11pt,onecolumn]{article} \usepackage{array} \usepackage{color, colortbl} \definecolor{mColor1}{rgb}{0.9,0.9,0.9} \begin{document} ...


4

To highlight just one entry, you need (should) not use that complex macro. Just use this simple version: \newcommand\Mark[2][]{% \tikz[baseline=(a.base)]{ \node[inner sep=0pt,outer sep=0pt](a){\phantom{#2}}; %% just to be defensive \node[draw,red,thick,inner sep=1pt, ellipse,text=black,overlay,minimum width=\widthof{#2},#1] {#2};% } } Remember to load ...


4

You can get the vertical alignment with m in the middle column \begin{tabular}{|>{\centering\arraybackslash}m{2cm}| >{\centering\arraybackslash}m{8cm}| >{\centering\arraybackslash}m{3cm}|} but the table is too wide for article a4 text width Overfull \hbox (47.48578pt too wide) in paragraph at lines 7--16 ...


4

Another attempt. Without the text, I can't really be sure the layout adjustments I've made make much sense, but here goes anyway: \documentclass{article} \usepackage{booktabs,siunitx,tabularx} \begin{document} \begin{table} \small\setlength{\tabcolsep}{3.7pt} \begin{tabularx}{\textwidth}% ...


3

How about that? I suppressed all vertical rules, loaded booktabs and cellspace for a better vertical spacing between rows. I also used siunitxfor numbers alignment and makecell, which allows for line breaks and a common formatting of column heads. %%%%%%%%%% \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{geometry} \usepackage{fourier} ...


3

I suggest you proceed as follows: The column type of the second column may as well be set to c to minimize its width For the remaining seven columns, a ratio of widths of roughly 3:2 seems about right. Setting the \hsize of the left-most column to 1.3 and that of the other six to 0.95 (note: 1.3 + 6*0.95 = 7) may be a good starting point. Feel free to ...


3

Here is a solution, using the \Xhline and \Xcline commands from makecell: \documentclass[a4paper]{article} \usepackage{array} \usepackage{makecell} \renewcommand\cellalign{lc} \setcellgapes{3pt} \makegapedcells \newcommand\thickvrule[1][2pt]{\vrule width #1} \begin{document} \begin{table}[htp] ...


3

afterpage doesn't support twocolumn (I never thought anyone was going to use it at all:-) and making it do so would be quite a bit of work. If you use \onecolumn at the point where latex would have broken the text page had there been no table, you can then add the longtable in 1-column mode, then issue \twocolumn and resume the text. This is more hand ...


3

A tick label can contain anything that's allowed inside a Tikz node, with the caveat that if it contains comma(s), it must be protected with curly braces. Use xticklabels={\begin{tabular}{r}1\\2\\3\end{tabular},B,C}, in the axis options. The ,B,C is required because if one tick label text is manually specified, all of them need to be manually specified. ...


3

You add no meaning with the units in brackets; in my opinion it's even wrong, as usually brackets denote abstract dimensions, such as “length·time–1” or “force·length”. The s column type is what you're looking for. I also removed all \: spacing commands, which are wrong, and set “eff” in upright type. Note also that Where:\bigskip would allow a page break ...


3

You can also use Natural Tables for such tables as it provides a much cleaner separation of content and presentation. \startsetups table:formatting \setupTABLE[each][each][width=0.1\textwidth, align={middle,lohi}] \setupTABLE[each][each][frame=off, leftframe=on, rightframe=on] \setupTABLE[row][1,2][frame=on] \setupTABLE[row][2][align={middle,low}] ...


2

How to scale/resize a table/tabular inside a minipage This question is the first one to pop up when searching for: latex scale table in minipage. Likewise queries such as rescale table in minipage or resize table in minipage end up at this answer too. I was personally also searching for this and couldn't find an answer anywhere. However, I've found the ...


2

Use m column type from array package instead of p type.. \documentclass[12pt]{article} \usepackage{array} \newlength{\mylen} \settowidth{\mylen}{the title} \begin{document} \begin{tabular}{|l|c|} \hline the title & number \\ \hline \multicolumn{1}{|m{\mylen}|}{very very very very long} & 100 \\ \hline \end{tabular} \end{document} As explained ...


2

Just for variety, here's a solution that uses the drcases environment of the mathtools package. \documentclass{article} \usepackage{mathtools} \DeclareMathOperator\sech{sech} \begin{document} \begin{align*} \begin{drcases} \sin \leftrightarrow \tanh\\ \cos \leftrightarrow \sec \end{drcases} &\quad \sin^2 x + \cos^2 x = 1; \quad \tanh^2 x + \sech^2 x = ...


2

You can add \multicolumn{1}{l}{} in the second line. \documentclass[12pt]{article} \begin{document} \begin{tabular}{|l|} \hline line 1\\ \hline \multicolumn{1}{l}{}\\ \hline line 3 \\ \hline \end{tabular} \end{document} You can also use a \fbox (provided the contents all have same width). \documentclass[12pt]{article} \begin{document} ...


2

Like this? \documentclass[12pt]{article} \newlength{\mylen} \settowidth{\mylen}{the title} \begin{document} \begin{tabular}{|l|} \hline the title \\ \hline \multicolumn{1}{|p{\mylen}|}{very very very very long} \\ \hline \end{tabular} \end{document} If you don't want those underfull boxes, load array package and use ...


2

You can use a tabular inside a tabular \documentclass{article} \newcommand{\mysplit}[1]{% \begin{tabular}[t]{@{}c@{}} %% remove [t] if you need vertical centered things. #1 \end{tabular} } \begin{document} \begin{table}[htb] \centering \begin{tabular}{| c | p{3cm} |} \hline \textbf{Equation} & \textbf{Description} \\ \hline ...


2

Two other solutions: one with the blkarray package, the other with the rcases environment, from mathtools: \documentclass[112pt]{book} \usepackage[utf8]{inputenc} \usepackage[showframe, nomarginpar, textwidth = 15cm]{geometry} \usepackage{mathtools} \usepackage{blkarray} \usepackage{nccmath} \DeclareMathOperator\sech{sech} \DeclareMathOperator\csch{csch} ...


1

Here's one possibility: \documentclass{article} \usepackage[margin=3cm]{geometry} % set margins smaller (YMMV) \usepackage{lmodern} % for unicode support \usepackage{booktabs} % for publication-quality tables \usepackage{tabularx} % for column width balancing \usepackage{siunitx} % for typesetting physical quantities with units \sisetup{% setup for your ...


1

Eledmac knows this problem. That's why it provides an edtabularl environnement (§ 13 of the actual handbook). However, for some technical reason, the \let\footnote\footnoteC can't work in this case (see https://github.com/maieul/ledmac/issues/207#issuecomment-54959471 for more details), and you have to do something like def\footnote#1{\footnoteT{#1}}. So ...


1

Something likes this. Basically use of \tikzmark and \link skill defined in the macros. Also, thanks to @AboAmmar for the `shorten >=xx pt' suggestion. \newcommand\tikzmark[2]{% \tikz[remember picture,overlay] \node[inner sep=0pt,outer sep=2pt] (#1){#2};% } \newcommand\link[2]{% \begin{tikzpicture}[remember picture, overlay, >=stealth, shorten >= ...



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