Debian Codegraph @

texmf-dist/doc/latex/swungdash/swungdash-documentation.tex

raw
1 \documentclass[12pt]{article}
2 \usepackage{swungdash}
3 \usepackage{xcolor}
4 \usepackage{fontspec}\definecolor{darkspringgreen}{rgb}{0.09, 0.45, 0.27}
5 \usepackage{titlesec}
6 \titleformat{\subsection}
7 {\bfseries}{\thesection.\thesubsection}{1em}{\normalfont\bfseries}
8 \usepackage[hidelinks]{hyperref}
9 \usepackage{hologo}
10 \usepackage[british]{babel}
11 \usepackage[useregional]{datetime2}
12 \DTMlangsetup[en-GB]{ord=omit}
13 \definecolor{LightGray}{gray}{0.9}
14 %\usepackage{mathpazo}
15 \IfFontExistsTF{Palatine Parliamentary}{\setromanfont[RawFeature={+calt,+hlig,+liga,+dlig,+onum,+pnum},
16 BoldFont={Palatine Parliamentary Bold},
17 ItalicFont={Palatine Parliamentary Italic}
18 ]{Palatine Parliamentary Regular}
19 }{\setromanfont[RawFeature={+onum,+pnum}]{TeX Gyre PagellaX}}
20 \setmonofont[Scale=.9,BoldFont=Source Code Pro Bold]{Source Code Pro}
21
22 \usepackage{minted}
23 \date{\today\\\smallskip\ttfamily Version \swungdashversionnumber}
24 \author{Elijah Z Granet\thanks{e-mail: \href{mailto:[email protected]}{\ttfamily [email protected]}}}
25
26 \title{\texttt{swungdash}:\\A package for a swung dash}
27 \begin{document}
28 \maketitle
29 \tableofcontents
30 \clearpage
31 \section{Overview}
32 The `swung dash' (\swungdash) is a rare but very useful mark of punctuation used in typesetting dictionaries and reference works as a stand in to avoid repeating the defined term in examples or definitions, and thus to save space. For example, a quoted example of the term `extraterritoriality' might save space by omitting repeating the long word:
33 \begin{quote}
34 \swungdash, in this as in every other case, is a fiction only, for diplomatic envoys are in reality not without, but within, the territories of the receiving States. The term `\swungdash' is nevertheless valuable because it demonstrates clearly the fact that envoys must, in most respects, be treated as though they were not within the territory of the receiving States. \footnote{Sir H Lauterpacht \textsc{qc} (ed) \textit{Oppenheim on International Law}, vol 1 (8\textsuperscript{th} edn, Longmans, Green \& C\textsuperscript{o} 1955), 793}
35 \end{quote}
36
37 Although the swung dash is included in Unicode as \texttt{U+2053}, few typefaces include it. This package turns a tilde in any given typeface into a swung dash of 1 \textsc{m} width, and then, using the \texttt{accsup} package, overwrites this extended tilde into the Unicode character so that it will be read as a swung dash.
38 \section{Usage}
39 In your preamble put:
40 \begin{minted}[
41 framesep=2mm,
42 baselinestretch=1.2,
43 bgcolor=LightGray,
44 fontsize=\footnotesize,
45 breaklines,
46 firstnumber=last
47 ]
48 {latex}
49 \usepackage{swungdash}
50 \end{minted}
51
52 To typeset a swung dash, simply use the command:
53 \begin{minted}[
54 framesep=2mm,
55 baselinestretch=1.2,
56 bgcolor=LightGray,
57 fontsize=\footnotesize,
58 breaklines,
59 firstnumber=last
60 ]
61 {latex}
62 \swungdash
63 \end{minted}
64 \section{Development}
65 Bugs, feature requests, \textit{etc}, should be submitted to the project's official Githup page: (\url{github.com/ezgranet/swungdash}).
66 \section{Licence}
67 This project is licensed under the Latex Public Project Licence version 1.3\textit{c}. This documentation is copyright of the author but licensed under CC-BY-SA 3.0.
68 \section{Implementation}
69 \begin{minted}[
70 frame=lines,
71 framesep=2mm,
72 baselinestretch=1.2,
73 bgcolor=LightGray,
74 fontsize=\footnotesize,
75 linenos,
76 breaklines,
77 firstnumber=last
78 ]
79 {latex}
80
81 \def\swungdashversionnumber{1.0.0}
82 \ProvidesPackage{swungdash}
83 [2022/08/24 v1.0 code to typeset a swung dash]
84 % !TeX program = lualatex
85 % !TeX encoding = utf8
86 % This work may be distributed and/or modified under the
87 % conditions of the LaTeX Project Public License, either version 1.3
88 % of this license or (at your option) any later version.
89 % The latest version of this license is in
90 % http://www.latex-project.org/lppl.txt
91 % and version 1.3 or later is part of all distributions of LaTeX
92 % version 2005/12/01 or later.
93 %
94 % This work has the LPPL maintenance status `maintained'.
95 %
96 % The Current Maintainer of this work is Elijah Z Granet
97
98 \RequirePackage{accsupp}\RequirePackage{graphicx}
99 \RequirePackage{iftex}
100 \newcommand{\thetilde}{\symbol{"007E}}
101 \newcommand{\swungdash}{\BeginAccSupp{method=hex,unicode,ActualText= 2053}%
102 \resizebox{1em}{!}{{\raisebox{-.1ex}{\scalebox{1.75}[1.1]{\thetilde}}}}
103 \EndAccSupp{}%
104 }
105 \newcommand{\twiddle}{$\sim$}
106 \ifPDFTeX {
107 \PackageError{swungdash}
108 {You are using pdfTeX but this package only works
109 \MessageBreak with XeTeX or LuaTeX}{}
110 }
111 \fi
112
113 \end{minted}
114
115 \section{Version History}
116 \subsection{\texttt{1.0.0}}
117
118 \ttfamily 24 August 2022: Package creation
119
120
121 \end{document}