Hot answers tagged

8

How about this one? \documentclass{article} \usepackage{mathtools} \begin{document} $\xmapsto{P}$ \end{document}


6

Use \substack and \mathclap to pretend the large subscript has no width. \documentclass{article} \usepackage{mathtools} \begin{document} \[ \underbrace{2\quad 9\quad 10\quad 12}_{\text{$4$ elements}} \quad \underbrace{19\quad 22}_{ \substack{ \big\uparrow\\[3pt] \mathclap{\text{Median}=\frac{19+22}{2}=20.5} } } \quad \underbrace{37\quad 39\...


5

You may liked: instead edge[bend ...] use \draw (x) |- (y) or \draw (x) -| (y) or \draw (x) -| (y) where paths have rounded corners: \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{arrows, positioning} \begin{document} \begin{tikzpicture}[ node distance = 3mm and 5mm, punkt/.style = {draw, very thick, rounded corners, ...


5

One thing that does usually not get appreciated enough is that curved paths with arrows get distorted unless you are loading the bending library. This is true regardless of whether or not you actually add the bend key to the arrow heads, see p. 204 of pgfmanual v3.1.5 Yet I would also bend the arrow heads. And I would choose another way to bend the arrows: ...


5

You can use the calc library. First store the end points of the lines in symbolic coordinates (r0) and (r1) for the red plot, \addplot+[smooth,ultra thick,color=red,mark=none] coordinates{ (0,72) (54,0) } coordinate[pos=0] (r0) coordinate[pos=1](r1); and likewise for the blue plot. Then use the calc syntax of section 13.5.4 The Syntax of Distance ...


5

With barycentric coordinates you can determine a good candidate for the touching point, which can be used in various constructions such as \documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \begin{scope} \node(A){A}; \node[below = of A](B){B}; \node[left = of A](C){C}; \node[right = of A](D){D}; ...


4

May I suggest a tikz version inspired by this post you may have seen. \documentclass[a4paper]{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{tikzmark} \begin{document} $\{(0,\ldots ,0,{\tikzmarknode{11}{1}},0,\ldots ,0), (0,\ldots ,0,0,{\tikzmarknode{21}{1}},0,\ldots ,0),\ldots ,(0,\ldots ,0,{\tikzmarknode{31}{1}})\}$ \begin{...


4

Depending on what exactly you're doing, it might be better to do this sort of thing outside the axis. But anyways, you mainly just need to repeat the \edef\temp{...}\temp trick. And using evaluate you can simplify the code a bit, no need for the \pgfmathparse etc. Don't know if the arrows are how you want them, but you should be able to fix that if not. \...


4

Here is a proposal where the arrows/numbers remain at the same position regardless of the font size. With minor modifiations, it coul also adapt to the actual font size to keep de same space around the letter symbol. \documentclass[tikz]{standalone} \usetikzlibrary{arrows.meta,bending} \tikzset{ use bounding box relative coordinates/.style={ ...


3

Two examples: \documentclass[11pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage{mathtools} \usepackage{tikz-cd} \tikzcdset{arrow style=tikz, diagrams={>=Straight Barb}, nodes={text depth=0.25ex} } \begin{document} \begin{tikzcd}[column sep=tiny] & |[draw]| 1,5 \ar[ld]\ar[d]\ar[rd] & ...


3

\documentclass{article} \begin{document} \begin{itemize} \item[$\Rightarrow$] Given a satisying question that does not force the ones answering it to type in texts from a screen shot. \item[$\Leftarrow$] Given a set of input parameters satisying some strange conditions one will always find someone. \end{itemize} \end{document}


3

Here is a solution using tikz. We define a new command \cancelto that takes three arguments, one optional. The first required argument is the "to" expression, which is 0 in the example. You could use \scriptsize{0} if you want it smaller. The second required argument is the expression that is to be cancelled. The calling sequence is \cancelto[<height&...


3

Let's make the subscripts as less intrusive as possible: \documentclass{article} \usepackage{mathtools} \newcommand{\annoteentry}[2]{% \begingroup \renewcommand{\arraystretch}{0}% \begin{array}[t]{@{}c@{}} #1 \\\noalign{\vspace{2pt}} \hidewidth\scriptstyle\uparrow\hidewidth\hspace*{0pt}\\\noalign{\vspace{1pt}} \hidewidth\scriptstyle\...


3

An array+ pstricks way: \documentclass{article} \usepackage{array, bigstrut} \usepackage{pst-node} \begin{document} \[ \setlength{\bigstrutjot}{0.2cm} \begin{array}[t]{r|>{\centering\arraybackslash\bigstrut}m{0.5cm}|} \multicolumn{2}{c}{}\\ \cline{2-2} S &\pnode[0,0.07]{S}\\ % \cline{2-2} T & \pnode[0,0.07]{T} \\ \cline{2-2} U & \pnode[0,...


3

As usual there are many possibilities. \documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{matrix,positioning} \begin{document} \begin{tikzpicture}[pmat/.style={matrix of math nodes,nodes in empty cells, nodes={minimum size=1.5em,anchor=center}, column sep=-\pgflinewidth,row sep=-\pgflinewidth}] \node[pmat,column 2/.style={nodes={draw}}] (...


3

Maybe just placing an array below the underbrace. \documentclass{article} \usepackage{amsmath} \begin{document} Compute the median according to the above algorithm \[ \underbrace{2\quad 9\quad 10\quad 12}_{4\text{ elements}} \underbrace{19\quad 22}_{\begin{array}{c} \Big\uparrow \\[6pt] \operatorname{Median} = \frac{19+22}{2} = 20.5 \end{array}} \...


2

These are mainly off-topic comments. You are loading but not using positioning, which has the syntax below=<distance> of ... instead of below of=.... Then I'd rather use matrices for the layout. The only on-topic suggestion here is to use something like south fork/.style={to path={(\tikztostart.south) -- ++(0,-0.5) -| (\tikztotarget)}} for the ...


2

Your diagram is correct, I think you just made a mistake on a numerical value, a 0.5 instead of a 0.4 \documentclass[tikz, border=5mm]{standalone} \usetikzlibrary{positioning, fit, calc} \tikzset{block/.style={draw, thick, text width=2cm ,minimum height=1.7cm, align=center}, line/.style={-latex} } \begin{document} \begin{...


2

The second question is answered by "add a dot", so you need -{Rays[n=8,sep=0.50cm, orange].Tee Barb}. To address the first and third question, one can define a style with a preaction. This can be made one style using \ifpgfmathunitsdeclared. If the second argument has units, the solid line will be shorted by that distance. If it does not have units, the line ...


2

You can define \catcode`@=11 \def\underarrow#1{\mathop{\vtop{\m@th\ialign{##\crcr $\hfil\displaystyle{#1}\hfil$\crcr \noalign{\kern3pt\nointerlineskip} \hfil$\uparrow$\hfil\crcr\noalign{\kern3pt}}}}\limits} \catcode`@=12 And then write, for example, $(0,\dots,0,\underarrow{1}_{\hbox to0pt{\hss $(m+1)$-th\hss}},0,\dots,0)$ Result: As a general strategy ...


2

The reason why you only see one label you have the additional node far left of the left circle so that not everything fits on one page. So I decreased some distances. As for the arrows to the inequality signs, this is a job for tikzmark. \documentclass{beamer} \mode<presentation> { \usetheme{default} % or try Darmstadt, Madrid, Warsaw, ... \...


2

As for your problems: You can use \hfill to center the tikzpicture. You forgot a to, should not use loop for an arrow going from A to B, and if you wish to place a node along a curved path, you need to put it before the target.1 To get the frame only on a certain overlay, you can use |[draw=green,thick,fill=white, rounded corners,alt=<2>{opacity=1}{...


2

You can draw the trees with forest, and set the baseline for the multipart nodes. \documentclass[11pt,a4paper]{article} \usepackage{mathtools} \usepackage[edges]{forest} \usetikzlibrary{shapes.multipart} \tikzset{bplus/.style={ rectangle split, rectangle split horizontal, rectangle split parts = #1, draw },bplus/.default=3} \forestset{...


1

Here is a way. \documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{decorations.markings,quotes} \tikzset{->-/.style={decoration={% https://tex.stackexchange.com/a/39282/194703 markings, mark=at position #1 with {\arrow{>}}},postaction={decorate}}, ->-/.default=0.55} \begin{document} \begin{tikzpicture}[vertex/.style={circle,fill=black!...


1

Something like this? \documentclass{article} \usepackage{tikz} %So we can use south later \usetikzlibrary{positioning} \newcommand{\Nice}[2]{\tikz[remember picture, inner sep=0pt, baseline, anchor=base]\node(#1){#2};} \begin{document} Et \Nice{l1}{l}es \Nice{f1}{f}ruits \Nice{p1}{p}as\Nice{s1}{s}eront \Nice{l2}{l}a \Nice{p2}{p}romes\Nice{s2}{s}e des \Nice{...


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