Tag Info

Hot answers tagged

13

One option using a matrix; an array could also be used, but with matrix you don't have to specify the number and format of columns: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{matrix} 0 & 1 & 2 \\ \updownarrow & \updownarrow & \updownarrow \\ 2 & 3 & 1 \end{matrix} \] \end{document} As has been ...


12

\documentclass{scrartcl} \usepackage{tikz} \begin{document} \begin{tikzpicture} \coordinate (A) at (-5,0); \coordinate (B) at ( 5,0); \draw[->] (A) -- (B) node[midway,fill=white] {\emph{success}}; \end{tikzpicture} \end{document} This, which does the same, may be more understandable to other users \draw[->] (A) -- node[midway,fill=white] ...


10

This might seem an overkill, but may be a good way of generalization. \documentclass{scrartcl} \usepackage{mathtools,tikz} \usetikzlibrary{matrix} \begin{document} \[ \begin{tikzpicture} \matrix[name=m,matrix of math nodes,column sep=1em,row sep=1em] {0 & 1 & 2 \\ 2 & 3 & 1 \\}; \draw[<->] (m-1-1) -- (m-2-1); ...


9

Not too difficult to produce with MetaPost. The draw arrow_withtext macro I defined below produces an arrow with text placed precisely in the middle of the shaft, so that it can always be read from left to right (unless the shaft is vertical, of course :-)) input latexmp; setupLaTeXMP(textextlabel = enable, mode = rerun); vardef drawarrow_withtext(expr A, ...


9

You can do this without tikz and without any complicated code. The knowledge of TeX primitives is sufficient. \def\arrowtext#1#2{\hbox to#1{\arrowtextA\ #2 \arrowtextA\kern2pt\llap{$\succ$}}} \def\arrowtextA{\leaders\vrule height2.7pt depth-2.3pt\hfil} \arrowtext{5cm}{success} Edit: In response on the comment by @fpast below I show the example of ...


8

Yet another tikz solution, but here I use a \foreach loop: \documentclass{article} \usepackage{tikz} \newcommand\aestrut{\rule[-0.5ex]{0pt}{2ex}} \begin{document} \begin{tikzpicture}[my node/.style={anchor=base}] \foreach[count=\myi from 0] \mya/\myb in {0/1,1/2,2/3,h/g,e/j,j/k} { \node[my node] (A\myi) at (\myi,1) {\aestrut\mya}; ...


7

You can use something like A$\,\to\,$B or A\textrightarrow B (in text mode) from the textcomp package: \documentclass{article} \usepackage{textcomp} \begin{document} A$\,\to\,$B A\textrightarrow B \end{document}


7

A solution with TikZ without filling the background with white: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \coordinate (A) at (-2,0); \coordinate (B) at ( 2,0); \path (A) -- node (success) {\emph{success}} (B); \draw[->] (A) -- (success) -- (B); \end{tikzpicture} \end{document} With ...


5

You can use the extensible arrow \xrightarrow provided by amsmath, which has two arguments, an optional one for text below the arrow and a mandatory one for text above the arrow \xrightarrow[text below]{text above} In your case you have to use \xrightarrow[n \to \infty]{} MWE \documentclass{article} \usepackage{amsmath} \begin{document} \[ x_{n} ...


5

Depending on your intended use, a TABstack may offer certain advantages. \documentclass{article} \usepackage{amsmath,tabstackengine,xcolor} \stackMath \begin{document} While a TABstack can be used in a math environment \[ \tabbedCenterstack[l]{0&1&2\\\updownarrow&\updownarrow&\updownarrow\\2&3&1} \] it can also be used inline: ...


4

Defining new arrow tips with Xy-pic is a task I'd not engage in. You can (and should, in my opinion) switch to tikz-cd: \documentclass{article} \usepackage{MnSymbol} \usepackage{tikz-cd} \tikzcdset{arrow style=math font} \begin{document} $A \to B$ \begin{tikzcd} A \arrow[r,"f"] \arrow[dr,dashed,swap,"g\circ f"] & B \arrow[d,"g"] \\ & C ...


3

Based on Heiko Oberdiek solution: \documentclass[tikz,border=1em]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \coordinate (A) at (-2,-1); \coordinate (B) at ( 2,+1); % invisible line, for sloped option: \path (A) to node[sloped] (success) {\emph{success}} (B); % real line with sloped text in the midle ...


2

A PSTricks solution: \documentclass{article} \usepackage{multido,pstricks} \def\Map(#1)#2#3{% \psline{<->}(#1,0)(#1,1) \rput(#1,-0.3){#2} \rput(#1,1.3){#3}} % parameter \def\arrows{3} \begin{document} \begin{pspicture}(0.95,-0.4)(\arrows.05,1.4) \multido{\iA = 0+1, \iB = 1+1}{\arrows}{\Map(\iB){$\iA$}{$\iB$}} \end{pspicture} ...


1

A MetaPost way of doing this: prologues := 3; outputtemplate := "%j-%c.mps"; input latexmp; setupLaTeXMP(options = "12pt", textextlabel = enable, mode = rerun); % t[] values on top, b[] values on bottom % u spacing between columns, v arrows length vardef corresp(suffix t, b)(expr u, v) = save i; numeric i; i = 1; forever: exitif (unknown ...


1

Something likes this. Basically use of \tikzmark and \link skill defined in the macros. Also, thanks to @AboAmmar for the `shorten >=xx pt' suggestion. \newcommand\tikzmark[2]{% \tikz[remember picture,overlay] \node[inner sep=0pt,outer sep=2pt] (#1){#2};% } \newcommand\link[2]{% \begin{tikzpicture}[remember picture, overlay, >=stealth, shorten >= ...


1

Here's a way with the amsmath package's \underset macro. \documentclass{article} \usepackage{amsmath} \def\xtend{-\!\!\!} \begin{document} \[ x_{n} \underset{\scriptscriptstyle n \rightarrow \infty}{\xtend\xtend\rightarrow} x\] \end{document} Here's a way with a stack. the option argument (here [2pt]) controls the depth of the underset. ...


1

This might be considered 'bad latex', but i've made some arrows bold by just putting in a few on top of each other. \xymatrix{ & A \ar[dl] \ar[dr] & \ B \ar[rr] \ar[rr] \ar[rr] \ar[rr] & & C} gives sorry if that isn't the most helpful but at least works as a temporary solution/last resort.



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