New answers tagged

2

With tabularray package and X[c] column types for all except the first columns: \documentclass{scrbook} %---------------- Show page layout. Don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} %---------------------------------------------------------------% \usepackage{...


3

Since automatic line breaking within cells doesn't seem to be a required feature for the table at hand, I suggest that you not employ the basic p column type. Instead, I would like to suggest that you load the array package and employ its w column type. This column type lets you specify a desired fixed width of, say, 5mm. \documentclass{scrbook} \usepackage{...


0

Add \hspace{1mm} to the column with a single letter. That should make all the columns equal width. You can always adjust the width by having different spacing \hspace{2mm}, \hspace{3mm}, ...


3

Most of what you are after can be done in LaTeX's listings package using suitable literate configuration. Haskell's wiki has an example configuration. Their configuration: \usepackage{listings} \lstloadlanguages{Haskell} \lstnewenvironment{code} {\lstset{}% \csname lst@SetFirstLabel\endcsname} {\csname lst@SaveFirstLabel\endcsname} \lstset{ ...


2

You may easily achieve your formatting objective by replacing the four instances of the r column type -- which, as you have (re)discovered, doesn't allow automatic line breaking -- with a centered version of the p column type and choosing the widths of the four data columns suitably, say, 2.5cm. \documentclass[a4paper,12pt]{article} \usepackage{booktabs,...


2

The makecell package is your friend for this kind of probleem, with its \thead command; \documentclass{article} \usepackage{threeparttable, booktabs} \usepackage{makecell} \renewcommand{\theadfont}{\small\bfseries} \usepackage{showframe} \begin{document} \begin{table} \centering \begin{threeparttable} \caption{Title of table} \label{Label} \begin{tabular}{...


3

With tabularray package is simple: \documentclass{article} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx} \begin{document} \begin{table}[ht] \begin{talltblr}[ caption = {Title of table}, label = {tab:Label}, remark{Note} = {Something noteworthy.}, ]{colspec={l *{4}{X[c, si={table-format=1.3}]}} } \...


3

Here's a version using a tikz matrix: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \newlength{\myboxlength} \begin{document} \setlength{\myboxlength}{1cm} \begin{tikzpicture} \matrix(table)[ matrix of nodes, row sep = 0.2\myboxlength, column sep = 0.2\myboxlength, nodes={ fill=none, draw=black}, column 1/.style={minimum ...


2

\def\mybox#1#2#3{\vrule height#2\vbox to#2{\dimen0=#1\advance\dimen0by-.8pt \hrule width\dimen0\vfil\hbox to\dimen0{\strut\hfil#3\hfil}\vfil\hrule width\dimen0}\vrule height#2\relax} \def\mykern{\kern1pt} \vbox{\hbox{\mybox{5pc}{3pc}{A}\mykern\mybox{1pc}{3pc}{b}} \mykern \hbox{\mybox{5pc}{1pc}{c}\mykern\mybox{1pc}{1pc}{0}}}


1

\include is only for including chapter-like chunks of a document and interacts with \includeonly so that you can just process parts of a documentto speed up drafts. Use \input to include fragments of a document in other places such as this table.


0

An approach almost identical to that mentioned in this answer also works with LyX. The only difference is that you can simplify the LaTeX preamble to \newcommand\newtag[2]{#1\def\@currentlabel{#1}\label{#2}}


0

In fact, longtblr and talltblr are defined as follows: \NewTblrEnviron{longtblr} \SetTblrOuter[longtblr]{long} \NewTblrEnviron{talltblr} \SetTblrOuter[talltblr]{tall} Therefore what you want is the following definitions: \NewTblrEnviron{mathtalltblr} \SetTblrOuter[mathtalltblr]{tall} \SetTblrInner[mathtalltblr]{ hline{1,Z} = {1pt,purple}, %% more specs }...


0

I take it that the table in question is not only printed on a page by itself, but is likely also at the very end of the document. To fix this situation, it should suffice to replace \begin{table} with \begin{table}[ht!]. Incidentally, I would also expend some effort to spruce up the look of the table, mostly in order to improve the odds that your readers ...


1

In tabularx table at least one column has to be of X type. You can reduce separation between columns by setting \tabcolsep to for example 2pt. Two successive cells with : try to merge in one. Considering above and use \scriptsize font size, you will get: (gray lines indicate page border) \documentclass[12pt,addpoints]{exam} \usepackage[a4paper,left=1.5cm, ...


1

Like this? Last three columns should have equal, long enough width. You my consider X columns type (defined in tabularx and also in tabularray package and then sett table width accordingly (by trial). Wit latter option, the MWE is: \documentclass{article} \usepackage{amsmath} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx, varwidth} \begin{...


1

Here is an example of building up a table where the number of rows is variable and the entry in the row is computed via the \Formula macro defined as #1*\NWeight/\Nunpoints where #1 is the row number. This yields: References: How do I use the ampersand (&) inside a foreach or conditional (or other group/environment) when building tables? Build ...


5

With {NiceTabular} of nicematrix. That environment is similar to the classical environment {tabular} (of array) but creates also PGF/Tikz nodes under the cells, rows and columns. You can use these nodes to draw with Tikz whatever rule you want. \documentclass{article} \usepackage{geometry} \usepackage{nicematrix,tikz} \begin{document} \begin{NiceTabular}{p[...


3

I would like to present an improved solution off Imran's solution. In my opinion, it is better to place the note (and remark) templates inside firstfoot and middlefoot and not in the contfoot-text template. This ensures the correct justification for multiline notes and remarks. Also, for consistency, one should use contfoot template and not hardcode the text....


2

\begin{flushleft} introduces vertical space before and after the environment. Vertical space is dropped at a page break but not actually at the start of the first page. The simplest thing to do is use \raggedright rather than the environment form, just as there is a common advice to use \centering rather than \begin{center} in some contexts.


1

With use of \small font size and reduced separation between columns and anticipated that page layout is default layout defined in the geometry package, you can get the following result: (red lines are borders of text area) \documentclass{article} \usepackage{geometry} %---------------- Show page layout. Don't use in a real document! \usepackage{showframe} \...


0

For this purpose I ever did https://github.com/jgm/pandoc/pull/3935 and https://github.com/jgm/pandoc/pull/7716. Have you been able to find a work around in Latex? My latest proposal would be https://github.com/jgm/pandoc/pull/7859


1

You have more issues with your MWE (Minimal working example): document layout is not consistent. I suggest to use geometry package for defining it because you load tabularray package I would use it for write your table: MWE with only to your problem related packages is: \documentclass[a4paper,svgnames,11pt]{article} \usepackage[hmargin=5mm, vmargin={10mm,...


3

tabularly must see a real \\ because it uses that to split the array in rows. So you must tell it to expand \tabularnewline first with [expand=\tabularnewline]. \documentclass{article} \usepackage{lmodern} \usepackage{xcolor} \usepackage{tabularray} \providecommand{\tabularnewline}{\\} \begin{document} \Large{RIGHT}: \begin{tblr}[expand=\tabularnewline]{|...


1

See, if the following solution works for you: \documentclass[twocolumn]{article} \usepackage{booktabs, makecell, multirow} \renewcommand\theadfont{\normalsize\bfseries} \renewcommand\theadgape{} \usepackage{siunitx} \sisetup{ output-open-uncertainty = (, output-close-uncertainty = ), uncertainty-mode=separate }% \begin{document} \begin{table*} \...


0

Here is a dirty way to accomplish this. \documentclass{article} \usepackage{ninecolors} \usepackage{tabularray} \newcommand{\ds}{\hfill\rule[-2mm]{0.5pt}{6mm}\hfill} %dummy column separator \begin{document} \begin{table}[htbp] \begin{tblr}{ hlines, vlines, width=\linewidth, colspec = {Q[l,m] X[c,m]}, rows = {rowsep=0pt}, columns={...


1

I already solved your problem in my answer on your previous question (without use of table). However, if you persist to have solution with table (and not be willing to show us what you try so far), below is MWE which can serve as starting point: \documentclass{article} \usepackage{geometry} \usepackage[export]{adjustbox} \usepackage{tabularray} \setlength\...


1

It seems to me that something similar to this is what is wanted: in this case a tcbposter can be used as the base layer to place all items over this page. The poster defines a regular matrix with desired rows and columns. Insade this sctructure it's possible to use tcolorboxes or TikZ nodes. The structure define inner nodes which can be used as reference ...


0

If I remove the resizebox, then the warning moves to the line with "Forfattere", and we see that the problem is you have 6 lines in a \multirow{2}. You need to increase that 2 to account for the height of the cell; 5 turns out to be sufficient. But you shouldn't use multirow for text that falls on the lines anyway, and \multicolumn{1} is always a ...


2

To have a layout like that using \multicolumn you'd need to make the table with 90(!) columns (the LCM between the number of columns in each row of that table), then use \multicolumn appropriately to achieve that layout. A much simpler solution is to stack tables on top of each other, each with a different number of columns, but all with the same width. The ...


3

You could try: \documentclass[12pt]{amsbook} \usepackage{dynkin-diagrams} \begin{document} \dynkin[labels={K},label macro/.code={\mathbb{#1}}] A1 \end{document} which will put all labels in to the mathematics blackboard font; I suppose that is probably what you want. But I admit I need to work out why your first guess: \dynkin[labels={\mathbb{K}}] A1 ...


3

It seems that with the latest version of the package (which should be included in a 2021 TeX installation, you should actually be able to write \dynkin[labels={\mathbb{K}}] A1 (even without curly brackets). As an alternative approach, you can try using the label macro option like in the following example: \documentclass[12pt]{amsbook} \usepackage{amsmath} \...


1

Although I would not recommend it, one could take the content of the cell, split it into the \qty, the first argument and the second argument, then construct the cell manually using \tablenum: \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} \usepackage{array} \usepackage{collcell} \sisetup{% propagate-math-font=true,% text-series-...


2

Welcome to TeX.SE! Edit: The package tabulary with its column specification is not the right choice for inserting lists as you do. Try to use tabularx package: \documentclass[a4paper]{article} \usepackage{geometry} \usepackage[T1]{fontenc} \usepackage{enumitem} \usepackage{etoolbox} \AtBeginEnvironment{tabularx}% { \setlist[itemize]{nosep, ...


0

As commented, Bernard's solution is the simplest and therefore the best to use the counter, IMHO. Said that, another possibility is not set any counter nor any complex preamble. If you don't know R and knitr, this solution is a bit like killing flies with cannon shots (although I strongly suggest you to know knitr if you often deal with numeric data and/or ...


0

Thanks everyone, I found the shortest, easiest and most effective way: \documentclass[a4paper,12pt]{article} \usepackage{cmap} \usepackage[T2A]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english,russian]{babel} \usepackage{caption} \usepackage{array,etoolbox} % For automatic numbering \begin{document} \newcounter{rownum} % Declare a new counter for ...


1

An implementation with expl3. \documentclass{article} \ExplSyntaxOn % #1 body var #2 body #3 head \cs_new_protected:Nn \__table_with_number:Nnn { \regex_split:nnN { \c{\\} } {#2} \l__table_line_seq \tl_clear_new:N #1 \seq_map_indexed_inline:Nn \l__table_line_seq { \int_compare:nNnTF {##1} = {1} { \tl_put_right:Nn #1 { #3 & ##2 \\ } } ...


2

Like this? With use of (relative new) package tabularray the MWE, which produce above result, is: \documentclass{article} \usepackage[a4paper, vmargin=2.5cm, hmargin=2.75cm]{geometry} \usepackage[T1]{fontenc} \usepackage{textcomp} \usepackage{chemfig, chemformula} \usepackage[skip=1ex, font=small, labelfont=bf]{caption} \usepackage{tabularray} \...


1

The trick here is to get your desired alignment is to do some fussy fiddling with multiples of columns. You want to have 19 - 22 - 43 to divide Tirsdag into thirds but 9 - 32 to divide it into halves. Fraction time: That means that when you have thirds each column will be ²⁄₆ and halves will be ³⁄₆ so you'll need to do something along the lines of defining ...


0

The \tabular just takes on the minimum space that it needs. I guess you want to put the logo at the right of the text area, not at the right of the table. Also you don't need the table environments. These are for floating materials with a caption. If this is the only text in the header, there is not need for these \tabulars at all, except to put the two line ...


0

Changing the \includepdf command to \includepdf[pages=-,nup=1x2,pagecommand={\thispagestyle{plain}}]{MWEtabelle.pdf} yields the following result. As you can see, both tables are included, but the result does not look very nice. You have no control over the spacing and the tables are inserted on a new page, leaving the prior page almost blank. I would ...


0

You may use the tabular environment. It should work even if you add more equations between cells. \documentclass{article} \usepackage{array} \usepackage{amsmath,amssymb} \usepackage[demo]{graphicx} \usepackage[a4paper,margin=.8cm]{geometry} \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}} \begin{document} \title{Plotting ...


5

Maybe like this: \documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{tikz, array, booktabs, amsmath, amssymb} \usetikzlibrary{arrows.meta, calc} \tikzset{tinyarrs/.style={ x=.5em, y=.5em, baseline=-.333em, every path/.style={arrows={Latex[length=2pt, width=2pt]-Latex[length=2pt, width=2pt]}} }} \newcommand{\nsArrow}{\tikz[tinyarrs]{ ...


2

Even without the accent you should avoid math italic for such words, here use T_{\textrm{médio}} (you need amsmath package so that \textrm uses subscript size)


3

One may also use the IEEEeqnarraybox environment from the IEEEtrantools package. In the code t is for centered "text" column (s and u for left and right aligned text respectively), l is for left aligned "math" column (c and r for centered and right aligned math respectively) and ? & / are for column separation. IEEEeqnarrayrulerow is ...


4

Here's a solution that operates with a single tabular environment with a carefully constructed new math-mode column type called L and a bit of extra space to the left of the equation numbers. \documentclass{article} % or some other suitable document class \usepackage[letterpaper,margin=1in]{geometry} % set page parameters as needed \usepackage{amsmath} \...


1

A remark up front: I am in no position to declare which table-related formatting practices may be best. My suggestions are, moreover, inevitably opinion-based. Nevertheless, I trust they can still be useful. For sure, if there are two tables with very similar structure -- say, one is about the "accuracy" of some entity, and the other is about "...


4

Consider using boxes to find the widest element across equations. This method is simplified by eqparbox. Below I'm using \eqmathbox[<tag>][<align>]{<stuff>} to set all content with the same <tag> into a box of width matching the widest <stuff>. An additional <align>ment can be specified (left, right and center). \...


2

What is the "best praxis" is opinion based. For example, in your MWE I would use packages which enable to write clear and short code: \documentclass{article} \usepackage[showframe, % in real document delete this option vmargin=25mm]{geometry} \renewcommand{\textfraction}{0.07} \setcounter{totalnumber}{4} % \usepackage[skip=1ex, ...


2

I would not use \resizebox, rather reduce font size and column separation in table. Also for numbers in table use of S columns gives nicer looking table. Edit: From MWE in question are added the last two frames: \documentclass[aspectratio=169, xcolor=dvipsnames]{beamer} \usetheme{Boadilla} \setbeamertemplate{caption}[numbered] % \usepackage{tabularray} \...


3

Maybe you'll like it ... With use of tabularray package: \documentclass[12pt,a4paper]{report} \usepackage[a4paper]{geometry} \usepackage{pifont} \newcommand{\cmark}{\ding{51}} % \usepackage{makecell} % new \usepackage{rotating} \usepackage{tabularray} % new \UseTblrLibrary{booktabs} \usepackage[skip=1ex, font=small, labelfont=bf]{...


Top 50 recent answers are included