7

I have found \arraystretch not always predictable in such matters. I prefer the \addstackgap macro from the stackengine package, that places a vertical buffer above and below its argument (default 3pt). I take the liberty of replacing min and max with \min and \max, to make them upright operators. \documentclass{article} \usepackage{mathtools,relsize,...


7

Loading microtype can solve many of these problems automatically. Other suggestions not mentioned in comments include writing the linear form of the \exp. Also, \allowbreak helps here as suggested by @daleif. Finally you can choose a suitable abbreviation for \beta [U(\vec{r'})- U(\vec{r})], say \beta_r, instead of the full form. Not related to the main ...


6

With forest package is no so hard: Edit: Above assumption is not completely correct. So far is very hard problem to correct include images in forest node. Edit: Considering of suggestion in the @Ulrike Fischer answer on my question with added estimation of duck size: \documentclass[border=3.141592]{standalone} \usepackage{forest} \usetikzlibrary{ducks} \...


6

I propose this code, with cellspace, which ensures a minimal vertical spacing at the top and bottom of cells in columns with specifier prefixed with the letter S by default (or whatever letter you please with the optional argument [column=some letter]: \documentclass{article} \usepackage{geometry} \usepackage{bm, dingbat} \usepackage{array, multirow, ...


5

With {NiceTabular} of nicematrix. In {NiceTabular}, you merge cells both horizontally and vertically with the command \Block. For the rows, you give the number of logical rows (and not the number of physical lines as with \multicolumn). You specify that you want a corner with corners=NW (north west). With the key hvlines, all the rules are drawn, excepted in ...


5

Here are three alternatives using cellspace, makecell or nicematrix. I also used \displaystyle instead of \mathlarger inside of the first column, as well as an S type column from siunitx for the numbers in the last column. All three examples result in the following output: \documentclass{article} \usepackage{mathtools} % only used in first example: \...


5

With use of tabularx for positioning of images and their captions: \documentclass{report} \usepackage[skip=1ex]{caption} \usepackage{tabularx} \newcolumntype{C}[1]{>{\centering\arraybackslash\hsize=#1\hsize}X} \usepackage{tikz} \begin{document} \begin{figure}[htp!] \centering \renewcommand\tabularxcolumn[1]{m{#1}} \begin{tabularx}{0.8\linewidth}{...


4

If you don't have too many of these structures, you can cheat. \documentclass{report} \usepackage{subfig} \usepackage{tikz} \begin{document} \begin{figure}[htp!] \centering \begin{tabular}{cc} \begin{tabular}{@{}c@{}} \begin{tikzpicture} \filldraw (0,0) rectangle (1,1); \end{tikzpicture} \end{tabular} & \begin{tabular}{@{}c@{}} \begin{...


4

Probably not the most elegant code, but the following should result in an output close to the expected one. \documentclass{report} \usepackage{subcaption} \usepackage{tikz} \begin{document} \begin{figure}[ht!] \centering \begin{subfigure}{0.2\textwidth} \centering \begin{tikzpicture} \filldraw (0,0) rectangle (1,1); \end{...


4

There are two things to consider when positioning nodes in line with external text. One is positioning the TikZ picture correctly with the text, the other is positioning the nodes correctly inside the picture. One can think of the first as the absolute position of the picture and the second as the relative position of the nodes within that picture. The key ...


3

An alternative construction with tcolorbox \documentclass{article} \usepackage[most]{tcolorbox} \newtcbox{mytcbox}[1][]{ on line, size=fbox, colback=yellow!30, sharp corners} \begin{document} Text \mytcbox{node a\hspace{1cm}node p\hspace{5mm}node h} some more text \end{document}


3

Use, as it was said in the comments, the baseline option for alignment, and layers to have the filled rectangle as background. For the baseline=value, the value depends on the outer ysep value of the nodes. The code \documentclass[12pt, a5paper]{article} \usepackage{tikz} \usetikzlibrary{positioning} \pgfdeclarelayer{background} \pgfsetlayers{background, ...


3

You don't have to reinvent the wheel, you already have the tikzmark library, which works like a charm. \documentclass{article} \usepackage{booktabs,tikz} \usetikzlibrary{tikzmark} \begin{document} \begin{tabular}{lrr} \toprule col1 & col2 & col3 \\ \midrule \tikzmarknode{a}{a} & 10 & 0 \\ b & 4 & 6 ...


3

As suggested by chsk, here is a solution with nicematrix. \documentclass{article} \usepackage{booktabs,tikz} \usepackage{nicematrix} \begin{document} \begin{NiceTabular}{crr}[create-medium-nodes] \toprule col1 & col2 & col3 \\ \midrule a & 10 & 0 \\ bbb & 4 & 6 \\ a & 7 & 3 \\ bb & 6 & 4 \\ \...


2

The standard form for tabular is \begin{tabular}[pos]{table spec} where [pos] is option for position of its baseline: [t] at top, [b] at bottom and c at the vertical center, which is default. For details see LaTeX/Tables. In your case, the MWE is: \documentclass{article} \usepackage{lipsum} \begin{document} \begin{description} \item[This is some ...


2

This is Bernard's solution after reading booktabs \documentclass{article} \usepackage{geometry} \usepackage{bm, dingbat} \usepackage{array, multirow, cellspace, booktabs} \setlength{\cellspacetoplimit}{2ex} \setlength{\cellspacebottomlimit}{2ex} \usepackage{rotating} \begin{document} \begin{table}[!h] \centering \small \setlength{\tabcolsep}{3pt} \begin{...


2

I was able to get my text to align by marking all of the text in the right-hand column with a star (i.e., \switchcolumn*. \documentclass[14pt,openany ]{book} \usepackage[a4paper,ignoreall,right=2cm, left=2cm,bottom=1.5cm,top=1.5cm]{geometry} \usepackage[german, english]{babel} \usepackage{paracol} \usepackage{csquotes} \usepackage{enumitem} % Bibliography ...


2

I found a solution here. As far as I can tell, one should absolutely not nest tikzpictures. \documentclass{scrartcl} \usepackage{tikz} \usetikzlibrary{ducks} \begin{document} \begin{tikzpicture} [level distance=4cm, sibling distance=4cm, hide/.style={opacity=0}] \node[matrix] { \duck[/tikz/local bounding box=d] \path (d....


2

In TeX's eyes a letter is just a box with a width, height, and depth. The actual glyph is neither necessarily contained in the box, nor it fills it completely. \documentclass{article} \usepackage{color} \newcommand*{\foo}[1]{% \begingroup \sbox0{#1}% \fboxsep=-0.1pt \fboxrule=0.1pt \textcolor{red}{% \fbox{\copy0}% \llap{\vrule ...


2

Hope this can meet your expectations: \documentclass{book} \usepackage{mdframed} \usepackage{lipsum} \newmdenv[topline=false, leftline=true, rightline=true, bottomline=false,% linewidth=2pt, innerleftmargin=12pt, rightmargin=-4pt,% innerrightmargin=12pt, skipabove=8pt, skipbelow=8pt]{leftrightbar}% \begin{document} \begin{leftrightbar} \lipsum[1-8] \...


2

Use a wrapper tabular: \documentclass[12pt]{article} \usepackage{geometry} \usepackage{mathptmx} \usepackage{colortbl} \usepackage{array} \usepackage[ colorlinks, pdfpagelabels, pdfstartview = FitH, bookmarksopen = true, bookmarksnumbered = true, linkcolor = black, plainpages = false, hypertexnames = false, citecolor = black ]{hyperref} \...


1

See if this suggestion can help you: \documentclass{article} \usepackage{geometry} \usepackage{enumitem} \usepackage{makecell} \renewcommand\theadfont{\bfseries} \renewcommand\theadgape{} \begin{document} \begin{table}[h] \setlist[itemize]{nosep, leftmargin=*, label=\textbullet, before=\begin{minipage}[t]{\...


1

Not only did I have to use [t] on the \textbox, but I used \belowbaseline[...]{...} of the stackengine package to shift the tikz element lower on the last item. \documentclass{article} \usepackage{tikz,enumitem,stackengine} \usetikzlibrary{arrows.meta,shapes,positioning} \newcommand{\textbox}[3][c]{\parbox[#1]{#2}{\strut#3\strut}} \begin{document} \begin{...


1

Placing both tabular environments in a single minipage is definitely the way to go. I would also make sure that the data columns all have the same width. \documentclass[12pt]{article} \usepackage{mathptmx} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{geometry} \geometry{verbose,margin=2cm} \usepackage{array} \usepackage{float} \...


1

You may want to try the background package. With this you can add the image to the background of the titlepage, but make sure you set the background to "empty" again for the subsequent pages. \documentclass[a4paper]{scrartcl} \usepackage{geometry} \usepackage{tikz} \usepackage{graphicx} \usepackage{background} \title{My Title} \author{My name} \...


1

This could be one option: valign=t option from adjustbox package \documentclass[border=2cm,tikz]{article} \usepackage{graphics} \usepackage[export]{adjustbox} \begin{document} \begin{figure} \centering \begin{tabular}{lclc} a) & \includegraphics[width=0.46\textwidth, valign=t]{example-image} & b) & \includegraphics[width=0.46\...


1

This answer admittedly does not focus on how one could achieve the requested alignment, but focuses more on the underlying issue of how one could make sure the whole table fits into the available space without the need to cut it in half: \documentclass[12pt]{article} \usepackage{mathptmx} \usepackage{geometry} \geometry{verbose,tmargin=2cm,bmargin=2cm,...


1

While all this answers are very good, I also recommend you to look at the tables generator in https://www.tablesgenerator.com It is very very good and can help you to get that table in no time. It has plenty of tools to centre the row/columns entries. My experience is that using that tool, you can finish that table quickly and easily.


1

Maybe you are looking for the attached result. I just put the \multicolumn once in the beginning, but I extended the textwidth to 0.17, the minimum you need to have all data in one single row. The threefold stripe is ugly and unusual in typesetting. I substituted it by a double. \documentclass[a4paper, 11pt]{article} \usepackage{amssymb, marvosym, fontspec, ...


1

All the solutions I have found seem to manually determine the vertical space to be eliminated. An "automatic" but in my opinion not so efficient way would be to redefine the \@maketitle defined by the titling package (even if in this way it becomes superfluous if it is used only for adjusting the title spacing): \def\@maketitle{% \newpage ...


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