Tag Info

New answers tagged

1

With a possibly handy syntax: the avs environment takes as optional argument the column specifier for the second column (default l); it should contain one or more \avsline commands; the optional argument is meant to specify a color. Some auxiliary macros are defined for easing specification of symbols. \documentclass{article} ...


0

\documentclass{article} \usepackage{array} \newcolumntype{I}{!{:}} \begin{document} \begin{equation} \left[\begin{tabular}{lIl} PLACE & dental \\ PLACE & dental \\ MANNER & fricative \\ VOICE & + \\ \end{tabular}\right] \quad \left[\begin{tabular}{lIl} PLACE & dental \\ PLACE & uvular \\ VOICE & + \\ \end{tabular}\right] ...


0

Use the package amsmath and try this: \begin{equation} \left[ \begin{array}{lcl} \mathrm{PLACE} &:& \mathrm{dental}\\ \mathrm{PLACE} &:& \mathrm{dental}\\ \mathrm{MANNER} &:& \mathrm{fricative}\\ \mathrm{VOICE} &:& + \end{array}\right] \qquad \left[\begin{array}{lcl} \mathrm{PLACE} &:&\mathrm{dental}\\ ...


3

Use \makebox instead of the \kern: \documentclass{article} \usepackage{array} \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}} \begin{document} \begin{tabular}[h]{|M{1in}|M{1in}|M{1in}|} %\begin{tabular}[h]{|c|c|c|} \hline \rule{0.2in}{1in} & \rule{1in}{0.2in} & \rule{0.2in}{1in} \\ \hline \rule{1in}{0.2in} & ...


1

I would omit all vertical rules in the table, drop about half of the horizontal rules, and use the line-drawing macros of the booktabs package for the remaining horizontal lines. And, do make sure that the tabular environment has a chance of fitting inside the text block. In the example below, I've chosen widths of 6cm and 7cm, respectively, for columns 1 ...


0

Your file produces Overfull \hbox (233.45511pt too wide) in paragraph at lines 6--12 You have specified two columns of 10cm each which is much wider than the page. Just let the columns be natural width: \documentclass[11pt]{article} \usepackage{array,graphicx} \newcommand\rowincludegraphics[2][]{\raisebox{-0.45\height}{\includegraphics[#1]{#2}}} ...


1

With some help from xparse (to easily define a \source command with a *-variant) and array for a new column type: \documentclass{article} \usepackage{xparse,array} \NewDocumentCommand{\source}{sm}{% \IfBooleanTF{#1}{\bracedsource{#2}}{#2 &}% } \NewDocumentCommand{\bracedsource}{m}{% \global\setbox9=\hbox{% ...


3

If you want the macro without the optional argument: \documentclass[a4paper,10pt]{article} \newcommand{\macro}[2]{% notice the lack of the second brackets here & something & #2 & #1 \\ } \begin{document} \begin{tabular}{lccc} \macro{3}{4} \end{tabular} \end{document}


6

The macro \macro (sic!) is defined to have an optional argument. If this missing, the call \macro{3}{4} is the same as \macro[]{3} and the figure 4 will be read for the next tabular row. The column shift in the 'wrong' usage is clearly visible. 3 is in the 4th column, instead of the requested 3rd column. \documentclass[a4paper,10pt]{article} ...


0

Another way to do ; maybe a less elegant : \documentclass{article} \usepackage{MnSymbol} \usepackage{multirow} \begin{document} \begin{tabular}{rcl} full-time & $\mapsto$ & $1$ \\ \begin{tabular}{rl} part-time & \multirow{3}{*}{\Huge{$\rbrace$}} \\ not at all & \\ don't know & \\ ...


4

Here you go. \documentclass{article} \usepackage{multirow,bigdelim} \begin{document} Text goes here \begin{description} \item[\texttt{bigdelim}] \begin{itemize} \item[] \item[Sub-Thing:] Text goes here \item[Sub-Thing:] \begin{tabular}{r@{}cl} ...


5

A simpler solution using expl3 and its powerful fp module. \documentclass{article} \usepackage[table]{xcolor} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\he}{m} { \cellcolor[gray]{ \fp_eval:n { min ( 2*#1, 1 ) } } #1 } \NewDocumentCommand{\hetest}{m} { \cellcolor[gray]{ \fp_eval:n { min ( 2*#1, 1 ) } } \textcolor{red}{#1 ~ -- ~ ...


6

The following example solves the issue by expanding \resa before \cellcolor is expanded and looks at its arguments. The second problem is, the range for the color model gray is between 0 and 1 inclusively. The values 0.8 and 1.0 exceed this, when multiplied by 2. Therefore the example checks the result and limits it to 1 if necessary. ...


6

You could add the line \xdef\resa{\resa}%% to your code. But things still won't compile properly because your multiplier gets you out of the range from 0 to 1. \documentclass{article} \usepackage{fp,xcolor,colortbl} \FPeval{\resb}{0.5} \newcommand{\he}[1]{% \FPeval{\resa}{2 * #1}% \xdef\resa{\resa}%% \cellcolor[gray]{\resa}% #1 } ...


2

Here's the revised version. Changes: Fixed your newcolumntype. I also had fixed the command for the \tabnode, but this solution didn't allow the numbers inside the node to align by the decimal separator so I removed the command altogether and replaced with something else, see below. Furthermore, now if you try adding random numbers to your values, they ...


2

Smaller version with less lines and typographical fixes: \documentclass{article} \usepackage{array} \usepackage{booktabs} \begin{document} \begin{table} \centering \begin{tabular}{>{Pin }l<{:}@{ }l>{Pin }l<{:}@{ }l} \toprule \multicolumn{2}{l}{JP1/JP14, Pins 1--8} & \multicolumn{2}{l}{JP1/JP14, Pins 9--16} \\ ...


1

It is not clear, what "incomplete" means. Assuming, that the table extends horizontal dimension, we can correct it, tightening the columns (option [H] removed, because it needs an additional package): \documentclass{article} \begin{document} \begin{table} \begin{tabular}{|c|c|c|c|} \hline %\rule[-1ex]{0pt}{2.5ex} JP1/JP14 Pins 1 – 8 & Description ...


2

Here's an attempt following the guidelines of booktabs for professional tables and siunitx for alignment of the numerical data. Note that braces ({...}) are used to escape the contents of cells that do not contain numbers to be aligned. \multicolumn also serves this purpose for those cells. Allowing space for the minus sign in the alignment is a matter of ...


2

This has absolutly nothing to do with the way the chessboard is build. The chessboard is like e.g. a graphic simply a box with the baseline at the bottom and so allmost all answers concerning the alignment of graphics with text (see e.g. How to vertically center text with an image in the same row of a table) can be used in this case too: You can use ...


0

\documentclass{article} \usepackage{xskak,stackengine} \begin{document} {\centering \begin{tabular}{l p{4cm}} \belowbaseline[-3.2\ht\strutbox]{\chessboard[setfen=]} & White to move. Mutual zugzwang. \end{tabular} \begin{tabular}{l p{4cm}} \belowbaseline[-3.2\ht\strutbox]{\chessboard[setfen=]} & White to move. Mutual zugzwang. White to move. ...


1

This is not an answer, but an extended comment. The code that you posted works as expected for me; so create a minimal example that shows what is going wrong at your end. Note, the \showframe is only for diagnostic purposes. \startsetups[tableheader] \setupTABLE[column][1][width=.45\textwidth] \setupTABLE[column][2,3][width=.22\textwidth] ...


1

Try replacing relevant lines with: \setupheadertexts[\setups{tableheader}] and \bTABLE[split=no] % allow splitting over page boundaries it should work then. You can also insert images into cells in your header table. My compiler is LuaTeX from TeXLive package.


1

I suggest you delete the manual [5pt] spacing directives and, instead, specify \setlength\extrarowheight{5pt} I'd also switch to from the m to the p column type to assure that the material in the first column is set on the same baseline as in the other 8 columns. Furthermore, I'd like to encourage you switching to a table design that uses no vertical ...


1

Non-centring comes from the \\[5pt] used before \hlines. I replace this with loading the cellspace package, which ensures minimal vertical spacing above and below cels in columns with a specifier prefixed with the letter S (or C if you use siunitx). I also load the caption package to ensure a correct vertical spacing between caption and table: ...


1

Use \makecell from the equally named package (i.e. makecell) However, this command has to specified for each cell individually. The default setup is to center it vertically. There is some issue with the \\[5pt] commands, which results in some upshift of the fractions in the last column. I added a second version in which this does not occur ...


3

I wouldn't use the m column type for this table. In its place, I would use a centered form of the X column provide (provided by the tabularx package), in part to let LaTeX handle the chores of determining column widths. Separately, I'd use the line-drawing macros of the booktabs package to get well-spaced horizontal lines; plus, I'd omit all vertical lines. ...


3

David is referring to the m-specifier in \newcolumntype{M}{>{\centering\arraybackslash}m{\dimexpr.096\linewidth-2\tabcolsep}} How about a layout like this: \documentclass[a4paper,10pt]{article} \usepackage{tabularx,booktabs,geometry} \geometry{textwidth=15cm} \begin{document} \noindent \footnotesize ...


1

Package hypcap sets an anchor right at the beginning of the float via \capstart assuming the corresponding \caption command will follow, which is responsible for the number, which is used to derive an anchor name for \capstart. However, \caption is missing in the table float object of the question. Therefore the error message about a missing \caption is ...


1

A free interpretation of the desired design that is not a table, so that allow a flexible format. \documentclass[a5paper]{article} \newcounter{cell} \usepackage{xcolor} \def\nestedcell#1{% \noindent\fboxsep5pt\fboxrule1pt \fbox{\begin{minipage}[b][2cm]{\dimexpr.25\textwidth-12pt} \hfill{\color{red}\vrule\begin{minipage}{.3\textwidth} ...


1

For repeating headings, use \endfirsthead and \endhead. To increase the gape between rows, you may use makecell and its \setcellgaps and \makegapedcells inside a group. You won't need center environment as longtale is centered by default. BTW your table won't fit within the width (and I didn't correct it). \documentclass{article} ...


3

I think you have two good choices and a (likely) dreadful choice: Use a tabular* environment, Use a tabularx environment (or its close cousin, tabulary) Use the basic tabular environment and scale it up (or down) using \resizebox. The results are as follows (the first horizontal line is there just to illustrate the width of the text block): Can you ...


2

You can use the table-format option, to specify how much space to set aside for each part of the numbers in the table. If you have integers of up to, say, 3 digits, you can use table-format=3 to set aside space for 3 integer digits, and no decimals. As stated in the comments, this option can also be set on a per-column basis, by passing the options to the ...


2

With standard LaTeX methods, also with a friendly syntax. The trick is to nest tabular environments. \documentclass{article} \newlength{\blockwidth} \AtBeginDocument{\settowidth{\blockwidth}{0000}} \newcommand{\block}[2]{% \begin{tabular}{@{}c|c@{}} & \makebox[\blockwidth][r]{#2\enspace} \\ \cline{2-2} ...


5

Paul Gessler wrote the Plain TeX solution using \halign. Great. I add another Plain TeX solution using only \hbox \vbox. The main idea is: if there are only fixed-size columns then we needn't to use \halign, but the \hbox to construction is sufficient. \def\bx#1#2{\vbox{\hbox to4em{\hss\vbox{% \hbox ...


0

Consider adding a dummy row before your first row: \begin{tabular}{cc|cc|cc} \hlinewd{1.5pt} \rowcolor[gray]{.9} & & & & & \\[-10pt] \rowcolor[gray]{.9}\multicolumn{2}{c|}{\textbf{Solar}} & \multicolumn{2}{|c|} {\textbf{Wind}} & \multicolumn{2}{c}{\textbf{Load}} \\ \hlinewd{1.5pt} where the [-10pt] can be adjusted to suit your ...


11

A solution with Plain TeX for fun, learning, and to show what's possible with the basic building blocks: \def\widest{000} \def\uv{\unskip\vrule} \def\bx#1#2{\vbox{% \offinterlineskip% \halign{\ \hfil## &##&\ \hfil## \cr \hphantom{\widest}&&\hphantom{\widest}\cr &\vrule\strut& #2\cr ...


4

\documentclass{scrartcl} \usepackage{tikz} \tikzset{/bowlinggrid/.cd, box width/.store in=\bgridlargewidth,box width=3cm, box height/.store in=\bgridlargeheight,box height=2.5cm, small width/.store in=\bgridsmallwidth,small width=1.2cm, small height/.store in=\bgridsmallheight,small height=1cm, columns/.store in=\bgridcolnumber,columns=4} % I ...


5

FWIW, this effect is relatively easy to achieve in ConTeXt. Note the very clean separation of content and presentation. \startsetups[cellular] \setupTABLE[frame=off, align={middle,lohi}, offset=0.5em] \setupTABLE[even] [odd][frame=on, offset=0.25em] \setupTABLE[even][even][rightframe=on, bottomframe=on] \setupTABLE[odd] [even][leftframe=on, ...


6

As far as I know, there is no such package, but it can be achieved with basic setups, using \multicolumn and \cline macros. \documentclass[twoside]{book} \usepackage{booktabs} \usepackage{array} \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} \usepackage{blindtext} \begin{document} \large \begin{tabular}{|*{8}{L{1cm}|}} \hline & 114 ...


3

I would try to avoid scaling tables, and avoid using tabularx for numeric data (tabularx adjusts column widths by changing the target width for line breaking but you don't normally want line breaking within cells for this kind of table) \documentclass{beamer} \usepackage[english]{babel} \usepackage{tabularx,booktabs,dcolumn} ...


2

The OP is missing a \\ before the last \tabucline command. Any table package I know requires a \\ (apart from the first line) for \hline - like statements (unless multiple of them occur in a row) For my taste there are too much lines in the table. \documentclass[11pt,a4paper,twoside,openright]{report} %\usepackage{setspace} % not needed ...


1

You should replace \multirow{2} with \multirow{5}. Indeed \multirow seems to be done for one-lined cells, and in case of multilined cells, one should count the number of lines rather than the number of rows, and make some manual adjustment if necessary, to take into account the thickness of intermediate lines, extra vertical spacing between rows ...


4

Normally you break after operators in inline math (to show the expression carries over) and before operators in an aligned display, where it is essentially a new expression aligned on the first. Here inline math is being used as a convenience to get automatic breaking but arguably it should align like a display, so make = into an active character that ...


5

A new line is a space. A space is a space. Use % signs to end lines when spaces are not wanted. For example: \documentclass{report} \usepackage{etoolbox} \begin{document} \newcommand{\siglines}[1][coop]{% \begin{tabular}{@{}l} \\\hline Student\\ \\ \\\hline \ifstrequal{#1}{coop}{Employer Thesis ...


2

I slightly simplify the code using the makecell package, which allows for line breaks in cells and a common formatting. There is also a Xhline command for \hlines of variable thickness: \documentclass[a4paper,11pt]{article} \usepackage{multirow, array, makecell} \begin{document} \begin{tabular}{!{\vrule width1pt}% ...


4

This is the problem with m type column when it appears at the end (i.e., as the last column). You can add an empty column at the end and things are on track again. \documentclass[a4paper,11pt]{article} \usepackage{multirow} \usepackage{array} \begin{document} \begin{tabular}{|>{\centering\arraybackslash}m{2cm} ...


5

Here you are: \documentclass[a4paper,11pt]{article} \usepackage{multirow} \usepackage{array} \begin{document} \begin{tabular}{|>{\centering\arraybackslash}m{2cm} |>{\centering\arraybackslash}m{2.4cm}|}\hline X & Y \\ \hline \multirow{2}{*}{No problem} & One Line \\ \cline{2-1} & Two Line \\ ...


3

As an alternative to changing the font size and the width of a column, which is not always possible, you can also let the table span both columns. This can be invoked with the starred version. \begin{table*}...\end{table*} The placement character h is not advisable in this case at all. This also works for figures (and if defined other floating objects). ...


3

Here's a proposed solution that uses a tabularx environment and employs a 10% reduction in the font size (via a \small instruction). \documentclass[12pt, twocolumn]{article} \usepackage{booktabs,tabularx} \newcolumntype{C}{>{\centering\arraybackslash}X} \usepackage{lipsum} \setlength\textfloatsep{0.75\baselineskip} \begin{document} \lipsum[1-2] ...


2

One solution is: \documentclass[12pt, twocolumn]{article} \usepackage{booktabs,tabularx} \usepackage{multirow} \usepackage{lipsum} \newcolumntype{C}{>{\centering\arraybackslash}X} \begin{document} \lipsum \begin{table}[ht] \centering \footnotesize \setlength{\tabcolsep}{3pt} \caption{Power Consumption measured in mW} ...



Top 50 recent answers are included