summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/thinsp/thinsp.tex
blob: 0043f9c3e5d62ef033e28058e728937adadada93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
\pdfoutput1
\documentclass[a4paper,11pt,british]{article}
\usepackage[T1]{fontenc}
\usepackage[colorlinks]{hyperref}
\usepackage{babel,thinsp,listings,tabularx,booktabs,ragged2e,textcomp}
\author{Palle J\o rgensen}
\title{The \thinsp\ package}
\def\origthinspace{\kern .16667em }
\def\orignegthinspace{\kern-.16667em }
\def\thinsp{\texttt{thinsp}}
\def\strthinspace{\texttt{\string\thinspace}}
\lstset{language=[latex]tex,breaklines=true}
\setcounter{tocdepth}{1}
\begin{document}
\maketitle

\section*{Summary}
\label{sec:summary}

The \thinsp\ package provides a stretchable \strthinspace\ to replace
\LaTeX's normal \strthinspace.

\tableofcontents

\section{Introduction}
\label{sec:introduction}

The normal \strthinspace\ command which \LaTeX\ provides as standard
is a fixed space of 0.16667em, with no strething. This gives an akward
spacing when using \strthinspace\ in underfull \verb+\hbox+'s.

Say, I wanted to create a certain box with the name P.\,A.\,M. Dirac
in it. To provide a proper spacing between the initials I use a
\strthinspace\ between the letters. Here shown with some
\verb+\framebox+'es.

\begin{verbatim}
\noindent\fbox{P.\,A.\,M. Dirac}\\
\framebox[\linewidth][s]{P.\,A.\,M. Dirac created 
  relativistic quantum mechanics}
\end{verbatim}

Then I would get something looking like this when using the original
\strthinspace\ from \LaTeX\medskip:

\noindent\fbox{P.\origthinspace A.\origthinspace M.
  Dirac}\\ \framebox[\linewidth][s]{P.\origthinspace A.\origthinspace
  M. Dirac created relativistic quantum mechanics}\medskip

In this example with the original spacing if \strthinspace\ the
spacing between the initials is the same, whether or not the
\verb+\hbox+ is underfull and need som stretcing or not. This makes
the initials to appear ``unnaturally'' close when comparing them to
the other characters.

With a \strthinspace\ that is strecthable like the normal space, the
resulting box is appearing more natural.\medskip

\noindent\fbox{P.\,A.\,M. Dirac}\\
\framebox[\linewidth][s]{P.\,A.\,M. Dirac created relativistic quantum
  mechanics}\medskip

\section{Usage}
\label{sec:usage}

The simplest usage of the package is simply adding
\begin{lstlisting}
\usepackage{thinsp}
\end{lstlisting}
to your preamble.

The the \strthinspace\ command as well as the \verb+\,+ shortcut is
replaced by the stretchable \strthinspace

The package furthermore provides a command
\verb+\thinthinspace+ with half the width of \strthinspace.

\subsection{Options}
\label{sec:options}

\begin{tabularx}{\linewidth}{>{\ttfamily}l>{\RaggedRight}X}
  \toprule
  \textrm{Option} & Description\\
  \midrule 

  nothinspace & Disables the replacement of \strthinspace.
  The stretchable thinspace is still available as
  \texttt{\string\stretchthinspace}.\\

  thinspace & Dummy option as counterpart to \texttt{nothinspace}\\

  nothinthinspace & Disables the possible\footnotemark\ replacement of
  \texttt{\string\thinthinspace}. The stretchable thinthinspace is
  still available as  \texttt{\string\stretchthinthinspace}.\\

  thinthinspace & Dummy option as counterpart to
  \texttt{nothinthinspace}\\ 

  negthinspace & Provides a stretchable \texttt{\string\negthinspace}.
  This is not default, as \texttt{\string\negthinspace} may be used
  with caution anyway, and almost always should be replaced by a
  manually \texttt{\string\kern}. A stretchable
  \texttt{\string\negthinspace} is available as
  \texttt{\string\stretchnegthinspace}\\ 

  nonegthinspace & Dummy option as counterpart to
  \texttt{negthinspace}\\ 

  \midrule 

  onehalf & Ajusting the stretchable \strthinspace\ to half of the
  ordinary space. This is default, as it appears just like the
  original \strthinspace\ in boxes that are not stretched.\\

  onethird & Ajusting the stretchable \strthinspace\ to one third of
  the ordinary space.\\

  twothirds & Ajusting the stretchable \strthinspace\ to two thirds of
  the ordinary space. This is the author's favourite\dots\\
  \bottomrule
\end{tabularx}
\footnotetext{Some packages provide a \texttt{\string\thinthinspace}
  command}

\section{\thinsp\ and other packages}
\label{sec:thinsp-other-pack}

As the package \texttt{amsmath} redifines \strthinspace\ as well,
there is a minor clash between these two packages. Hence \thinsp\
redefines \strthinspace\ at the beginning of the document, and if
\texttt{amsmath} is loaded, the \strthinspace\ is redefined in an
``\texttt{amsmath} way''.

\section{Bug reports and comments}
\label{sec:bug-reports-comments}

Any comment on this package can be sent to the author on his e-mail
address: \url{hamselv@pallej.dk}.

\section{Copyright and license}
\label{sec:copyright-license}

The \thinsp\ package and this documentation i copyright
\textcopyright\ 2007, 2016 by Palle J\o rgensen.

The license of the \thinsp\ package and this documentation is GNU
General Public License (GPL).

You should have received a copy of the GNU General Public License
along with this program. If not, see \url{http://www.gnu.org/licenses/}.

\appendix
\clearpage

\section{Source code of \texttt{thinsp.sty}}
\label{sec:source-code-thinsp.s}

\lstinputlisting{thinsp.sty}

\end{document}
\clearpage

\section{Source code of this document}
\label{sec:source-code-this}

\lstinputlisting{\jobname.tex}


\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: