Hot answers tagged

5

With use of the w{c}{2em} for the last three columns: \documentclass[a5paper,12pt]{book} %\usepackage{amsmath,amssymb} \usepackage{array} \begin{document} \[ \begin{array}{c *{3}{w{c}{2em}} } & & 3 & 6 \\ \times & & & 7 \\ \hline & 2 & 5 & 2 \\ & ...


4

You're forgetting that the template has c@{\quad\quad} \documentclass[a5paper,12pt]{book} \usepackage{amsmath,amssymb} \usepackage{array} \begin{document} \begin{equation*} \begin{array}{c@{\quad} *{3}{c@{\quad\quad}}} & & 3 & 6 \\ \times & & & 7 \\ \hline & 2 & 5 & ...


4

A variant of @Mico's solution, using the \DeclarePairedDelimiterX command, from mathtools: \documentclass{article} \usepackage{mathtools} \usepackage{amssymb} \DeclarePairedDelimiterX{\ffrac}[2]{\lfloor}{\rfloor}{\frac{#1}{#2}} \begin{document} \setcounter{equation}{7} \begin{alignat}{3} z\in\Bbb R^+, \qquad 0 &\le x- & & z\ffrac*{x}{z} & ...


4

For those who don't use KaTeX, here's an answer that use the alignat environment of the amsmath environment. \documentclass{article} \usepackage{array,amssymb,mathtools} \DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor} \newcommand\ffrac[2]{\floor*{\frac{#1}{#2}}} \newlength\mylen \settowidth\mylen{$\displaystyle x-z\ffrac{x}{z}$} % measure width of middle ...


3

Insert a space within the column specification of your blockarray: \documentclass{article} \usepackage{booktabs} \usepackage{blkarray} \begin{document} \[ \mathbf{R} = \begin{blockarray}{ cccccc } & \lambda_1 & \lambda_2 & \lambda_3 & \lambda_4 \\ \cmidrule{2-6} \begin{block}{@{} c @{\hspace{1ex}} | @{\quad} (ccccc) } ...


2

Here's for a starting point: \documentclass[tikz,border=3.14159pt]{standalone} \usetikzlibrary{matrix,positioning,arrows,arrows.meta,calc} \tikzset{ mymat/.style={ matrix of nodes, anchor=center, row 2/.style={nodes=draw,nodes in empty cells}, text height=2.8ex, text depth=0.75ex, text width=...


2

Something to start \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{matrix,positioning} \tikzset{ blockline/.style={matrix of nodes, nodes in empty cells, row sep=0pt, column sep=-\pgflinewidth, nodes={anchor=center, minimum width=15mm, minimum height=8mm},}, } \begin{document} \begin{tikzpicture} \matrix[blockline] (...


2

I show the changes on the line between the two % comment lines. It involves raising the | by a point, \smashing the result, and kerning left with a \! afterwards. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} &&&&&&&&&&&&&&x&&+&&\frac{x^3}{3}&&+&...


2

\documentclass[border=4pt]{standalone} \usepackage{tikz} \usetikzlibrary{matrix,positioning,arrows} % tex.stackexchange.com/questions/22687/multirow-in-tikz-matrix \tikzset{ table nodes/.style={ draw, align=center, minimum height=7mm, minimum width =7mm, text depth=0.5ex, text height=2ex }, ...


2

With {pNiceArray} of nicematrix. \documentclass{article} \usepackage{nicematrix,tikz} \begin{document} \[\mathbf{R}= \begin{pNiceArray}{cccc}[first-col,first-row] & \lambda_1 & \lambda_2 & \lambda_3 & \lambda_4 \\ \hline \noalign{\vskip2pt} \tau_1 & -1 & \phantom{-}1 & \phantom{-}0 & \phantom{-}0 \\ \...


2

I add a small answer (it similar to a comment). I suggest to use this link https://katex.org/docs/support_table.html, a simple guide of KaTeX specific for the table. \begin{darray}{cc} a & b \\ c & d \end{darray} In the left bar you can find also the guide of KaTeX. I add also a link of MathJaX that it is used in Math.SE: https://math.meta....


2

I just found out that KaTeX has the darray environment that does exactly what I'm asking for.


1

The question can be answered using tikz to put a top row on top of the last matrix. I used the nicematrix package because by defining the Tikz nodes in the cells and their corners, the package integrates very well with tikz. That way the code is much simpler and more compact. I used it in all four arrays, although in fact only in the last one is really ...


1

I think that you have needed to use optidef package: here there is a short example. \documentclass[a4paper,12pt]{article} \usepackage{mathtools,amssymb} \usepackage[short]{optidef} \begin{document} \begin{maxi*}<s> {\scriptstyle a,b}{a+b+c}{}{} \addConstraint{g }{=0 ,}{\quad lmno } \addConstraint{p}{=0 ,}{\quad math } \end{maxi*} \end{document}


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