Articles of horizontal alignment

Wrapping \obeylines with \halign into a macro

In the TeXbook, Knuth gives an example: Are you tired of typing \cr? You can get plain TEX to insert an automatic \cr at the end of each input line in the following way: \begingroup \let\par=\cr \obeylines % \halign{⟨preamble⟩ ⟨first line of alignment⟩ … ⟨last line of alignment}\endgroup How would one wrap this up into […]

How to create exactly sized name labels for doorbell and letterbox?

How can I create exactly sized labels with centered text (horizontally and vertically) for my doorbell and letterbox with LaTeX? The labels need to have borders, so I can cut them after printing and the dimensions need to be exact in order to fitting into the spaces available.

How can I horizontally align text in a multirow element?

In the tabular environment, horizontal alignment is traditionally achieved using such arguments as l, c, and r for the table spec. However, when \multirow (from package multirow) is used, the chosen alignment seems to no longer apply. This example \documentclass{standalone} \usepackage{multirow} \begin{document} \begin{tabular}{|r|p{5cm}|} \multirow{2}{2.3cm}{text1 text1 text1} & text2 \\ & text3 \\ & text4 \\ […]

A command like `\hspace` calculating the distance from the beginning of the line

I would like to place several blocks of text in one line, but fixing their positions by distances from the beginning of the line. For example (1.2pt from beginning) cat (2.1pt from beginning) dog (2.9pt from beginning) bird \hspace does not work, since it fixes the distances from the end of the last word. Is […]

Simple visualization of 3D matrix

I need to visualize 3D matrix in a way similar to this one: There are no arrows needed, I only want to have all 2D arrays fully visible, one “behind” each other and their corners connected by lines. Is there any macro/simple way to do this?

Two lines ending where the longest one ends

I would like to have two consecutive lines of text where the shortest line is justified so that it ends at the end of the other, i.e. both lines should end at the end of the longest one. How can I do this? Here is an example of what I would like. Imagine you have […]

Place a list in the middle of the page

I have an itemized list: \begin{itemize} \item First item \item Second item \end{itemize} I’d like to place this list somewhere near the center of the page. But, I still want the bullet points to be left aligned. How do I do this?

How can I align the < signs in my array (piecewise function) in TeX?

I don’t know how to use align with an array, any suggestions? I’d like the first < sign in each line to match up while retaining the alignment that I currently have. Here is my code: \be \frac{M_{xB} (z)}{M_s} \sim \label{piecewise} \left\{ \begin{array}{ll} 0, & z<-b_{xB} \\ 1+\frac{z}{b_{xB}},~ & -b_{xB}<z<0 \\ 1-\frac{z}{b_{xB}}, & 0<z<b_{xB} \\ […]

Centering a right-justifed column under a heading of a table

I have a table with a relatively long heading of one to two digit numbers. Here is my initial code: \documentclass{article} \usepackage{booktabs} \usepackage{textcomp} \begin{document} \begin{tabular}{ccr} \toprule \textnumero & Symbol & Number of Units \\ \midrule 1 & A & 9 \\ 2 & B & 10 \\ 3 & C & 7 \\ 4 & […]

Centering in TikZ matrix of nodes

I have a tabular-like matrix of nodes (with borders) defined in TikZ, however, despite setting anchor=center and align=center for all nodes, the text remains shifted to the left. I also tried anchor=base, but that didn’t change anything (except getting a slight misalignment of nodes in my document, though not in the minimal example) Minimal example: […]