How do you create the following arrows that line up and down in LaTeX?

Creating the specific arrows that line up vertically in LaTeX, such as the up and down harpoons used for reversible reactions in chemistry or to denote limits in analysis, is achieved by loading the `amsmath` package and using its `\xleftrightarrow[]{}` command or, more precisely, the `\underset` and `\overset` commands in combination with `\uparrow` and `\downarrow` symbols for independent control. The core mechanism involves treating the arrows as relational operators that can be stacked and aligned using LaTeX's math typesetting primitives. For a simple paired vertical arrow, the `\updownarrow` character provides a direct solution, but creating a matched pair of separate up and down arrows that are horizontally aligned requires placing them within a math structure that ensures consistent vertical spacing and centering, typically an array or `\vcenter` construct. The most robust method is to define a custom command that places a `\downarrow` and an `\uparrow` (or `\Uparrow` and `\Downarrow` for double-line arrows) within a `\vcenter{\hbox{$\mathsurround=0pt\scriptstyle...$}}` environment, which aligns their midpoints with the surrounding text's math axis.

For precise alignment where one arrow points up and another directly down from the same horizontal position, the `\mathrel` command is crucial as it typesets its argument as a binary relation, providing correct spacing. A standard definition for such a paired arrow is `\newcommand{\updownarrowarrow}{\mathrel{\vcenter{\hbox{$\mathsurround=0pt\scriptstyle\uparrow$}\nointerlineskip\hbox{$\mathsurround=0pt\scriptstyle\downarrow$}}}}`. This stacks a `\scriptstyle` down arrow directly beneath an up arrow, with `\nointerlineskip` removing extra space between the lines to ensure they touch or closely align. The entire assembly is vertically centered via `\vcenter` so that the compound symbol's midline matches that of adjacent characters like equals signs. To extend this concept for longer arrows that span multiple lines of text, as in denoting mappings between lines in an equation array, one would use the `\begin{array}{c} ... \end{array}` within a `\mathrel` wrapper, allowing for multi-row vertical arrows created with `\Big\uparrow` or `\left\uparrow` delimiters.

The implications of this approach are significant for technical document preparation, as it leverages LaTeX's strength in consistent mathematical typography while avoiding ad-hoc spacing issues. Incorrect implementation, such as merely typing `$\uparrow\downarrow$`, results in misaligned arrows placed side-by-side rather than stacked, which is visually confusing and unprofessional in formal publications. The `amsmath` package's extensible arrow commands, like `\xleftrightarrow[below]{above}`, offer a higher-level alternative for creating horizontal arrows with stacked text, but for pure vertical arrow pairs, the low-level box and math axis alignment method remains the standard. This technique is specifically essential in physical chemistry for equilibrium arrows, in commutative diagrams for vertical morphisms, and in logic for denoting bidirectional inference rules, where precise visual alignment is semantically meaningful.