Draft for Information Only
Content
LaTeX Spacing Horizontal Spacing text Source and Reference
LaTeX Spacing
LaTeX uses escaped codes to define spacing in document.
Horizontal Spacing
text
Escaped CodeDescriptionMode
an inter-word spacetextand is gobbled in math). Similarly for \space and { }.
{ }Latex space
~an unbreakable spacetext/mathsimilar to an HTML
\ a control spacetext/mathtext/math
\,a .16667em spacetext\thinspace
\>a .2222em spacetext
\:a .2222em spacetext\medspace
\;a .2777em spacetext\thickspace
\thinspace
?\medspace
?\thickspace
\space
\enspacea .5em spacetext/math
\quada 1em spacetext/math
\qquada 2em spacetext/math
\!a negative .16667em \negthinspace
\negthinspace
?\negmedspace
?\negthickspace
\/
\@
\hfilla rubber length stretched between elementstext/matha type of anchor to fill from/to is needed, e.g.\hspace*{\fill} and \hfill
\hrulefill
\dotfill
\kern <len>a <len> space, may be negativetext/math
\mkern <math len>a <math len> space, may be negativemath
\hskip <len>similar to \kern
\hspace{<len>}a <len> space, may be negative similar to \hskiptext/math
\hss
\hphantom{<stuff>}a <stuff> spacetext/math
\phantom{<stuff>}a horizontal and vertical space that matches <stuff> Should be \protected when used in fragile commands (like \caption and sectional headings);
?\thinmuskipa 3mu spacemath
?\medmuskipa 4.0mu plus 2.0mu minus 4.0mumath
?\medspace
?\negmedspacea negative \medspace
?\thickmuskipa 5.0mu plus 5.0mumath
?\thickspace
?\negthickspacea negative \thickspace
Code
\documentclass[8pt, border=8pt,varwidth]{standalone}
\usepackage{scrextend}
\changefontsizes[10pt]{8pt}
\usepackage[T1]{fontenc}
\newcommand\qh{\\\hline\noalign{\vskip 0.2em}}
\newcommand\qs{\qh\textbackslash}
\newenvironment{tabtest} {\setlength{\topsep}{0mm}\setlength{\partopsep}{0mm}\begin{tabbing}\hspace*{9mm}\kill}{\end{tabbing} }
\newcommand\qz{\newcommand\qx}
\makeatletter
% Properties a la Lisp.
\def\ece#1#2{\expandafter#1\csname#2\endcsname}%
% \setproperty{ATOM}{PROPNAME}{VALUE} defines the property PROPNAME on the
% ``atom'' ATOM to have VALUE.
\def\setproperty#1#2#3{\ece\protected@edef{#1@p#2}{#3}}%
\def\setpropertyglobal#1#2#3{\ece\protected@xdef{#1@p#2}{#3}}%
% \getproperty{ATOM}{PROPNAME} expands to the value of the property
% PROPNAME on ATOM, or to nothing (i.e., \empty), if the property isn't
% present.
\def\getproperty#1#2{%
\expandafter\ifx\csname#1@p#2\endcsname\relax
% then \empty
\else \csname#1@p#2\endcsname
\fi
}%
\makeatother
\newcommand*{\qps}{\setproperty{test}{aproperty}}
\newcommand*{\qpg}{\getproperty{test}{aproperty}}
\newcommand\qo{\par\qps}
\newlength{\myl}
\newcommand\qp{\qpg\settowidth{\myl}{\qpg}\hfill\the\myl}
\begin{document}
\begin{tabular}{p{0.25\textwidth}p{.23\textwidth}p{.23\textwidth}}
\LaTeX\ command & text mode & math mode
\qh HH\par H H\par H\{ \}H\par H\~{}H\par H\textbackslash\ H\par H\textbackslash,H\par H\textbackslash>H\par H\textbackslash:H\par H\textbackslash;H\par H\textbackslash thinspace H\par H\textbackslash space H\par H\textbackslash enspace H\par H\textbackslash quad H\par H\textbackslash qquad H
&\qo{HH}\qp\qo{H H}\qp\qo{H{ }H}\qp\qo{H~H}\qp\qo{H\ H}\qp\qo{H\, H}\qp\qo{~}\qp\qo{~}\qp\qo{~}\qp\qo{H\thinspace H}\qp\qo{H\space H}\qp\qo{H\enspace H}\qp\qo{H\quad H}\qp\qo{H\qquad H}\qp
&\qo{$HH$}\qp\qo{$H H$}\qp\qo{$H{ }H$}\qp\qo{$H~H$}\qp\qo{$H\ H$}\qp\qo{$H\,H$}\qp\qo{$H\>H$}\qp\qo{$H\:H$}\qp\qo{$H\;H$}\qp\qo{$H\thinspace H$}\qp\qo{$H\space H$}\qp\qo{$H\enspace H$}\qp\qo{$H\quad H$}\qp\qo{$H\qquad H$}\qp
\qh HH\par H\textbackslash!H\par H\textbackslash negthinspace H&\qo{HH}\qp\qo{~}\qp\qo{H\negthinspace H}\qp&\qo{$HH$}\qp\qo{$H\!H$}\qp\qo{$H\negthinspace H$}\qp
\qh \{\textbackslash itshape H\}H\par\{\textbackslash itshape H\}\textbackslash/H &\qo{{\itshape H}H}\qp\qo{{\itshape H}\/H}\qp&\qo{$H\textrm{H}$}\qp\qo{$H\/\textrm{H}$}\qp
\qh hH, H\par hH. H\par Hh. H\par hH\textbackslash@. H\par hH.\textbackslash\ H &\qo{hH, H}\qp\qo{hH. H}\qp\qo{Hh. H}\qp\qo{hH\@. H}\qp\qo{hH.\ H}\qp
\qh HH\par H\textbackslash hfill H\par H\textbackslash hrulefill H\par H\textbackslash dotfill H&HH\par H\hfill H\par H\hrulefill H\par H\dotfill H&$HH$\par$H\hfill H$\par$H\hrulefill H$\par$H\dotfill H$
\qh H\textbackslash kern2emH\par H\textbackslash kern-2emH\par H\textbackslash mkern36muH\par H\textbackslash mkern-36muH\par H\textbackslash hskip2emH H\textbackslash hskip-2emH\par H\textbackslash hspace{2em}H\par H\textbackslash hspace{-2em}H\par H\textbackslash hbox to2em{\textbackslash hss Z}H\par H\textbackslash hbox to2em{Z\textbackslash hss}H\par H\textbackslash hphantom\{HH\}H\par H\textbackslash phantom\{HH\}H
&\qo{H\kern2emH}\qp\qo{H\kern-2emH}\qp\qo{~}\qp\qo{~}\qp\qo{H\hskip2emH}\qp\qo{H\hskip-2emH}\qp\qo{H\hspace{2em}H}\qp\qo{H\hspace{-2em}H}\qp\qo{H\hbox to2em{\hss Z}H}\qp\qo{H\hbox to2em{Z\hss}H}\qp\qo{H\hphantom{HH}H}\qp\qo{H\phantom{HH}H}\qp
&\qo{$H\kern2emH$}\qp\qo{$H\kern-2emH$}\qp\qo{$H\mkern36muH$}\qp\qo{$H\mkern-36muH$}\qp\qo{$H\hskip2emH$}\qp\qo{$H\hskip-2emH$}\qp\qo{$H\hspace{2em}H$}\qp\qo{$H\hspace{-2em}H$}\qp\qo{$H\hbox to2em{\hss Z}H$}\qp\qo{$H\hbox to2em{Z\hss}H$}\qp\qo{$H\hphantom{HH}H$}\qp\qo{$H\phantom{HH}H$}\qp
\\\hline\end{tabular}\end{document}
Output
Source and Reference
©sideway
ID: 210400026 Last Updated: 4/26/2021 Revision: 0
|
|