summaryrefslogtreecommitdiff
path: root/macros/unicodetex/latex/textcsc/textcsc-documentation.tex
blob: d0c7ec40403394d3e44cb638ed1ed31b075ab378 (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
\documentclass[12pt]{article}
\usepackage{textcsc}
\usepackage{xcolor}
\usepackage{fontspec}\definecolor{darkspringgreen}{rgb}{0.09, 0.45, 0.27}
\usepackage{titlesec}
\titleformat{\subsection}
  {\bfseries}{\thesection.\thesubsection}{1em}{\normalfont\bfseries}
\usepackage[hidelinks]{hyperref}
\usepackage{hologo}
\usepackage[british]{babel}
\usepackage[useregional]{datetime2}
\DTMlangsetup[en-GB]{ord=omit}
\definecolor{LightGray}{gray}{0.9}
%\usepackage{mathpazo}
\IfFontExistsTF{Palatine Parliamentary}{%
\setromanfont[SmallCapsFeatures={LetterSpace=10},
RawFeature={+calt,+hlig,+liga,+dlig,+onum,+pnum},
BoldFont={Palatine Parliamentary Bold},
ItalicFont={Palatine Parliamentary Italic}
]{Palatine Parliamentary Regular}
}{\setromanfont[RawFeature={+onum,+pnum}]{TeX Gyre PagellaX}}
\setmonofont[Scale=.9,BoldFont=Source Code Pro Bold]{Source Code Pro}

\usepackage{minted}
\date{\today\\\smallskip\ttfamily Version \textcscversionnumber}
\author{Elijah Z Granet\thanks{e-mail: \href{mailto:ezg21@cantab.ac.uk}{\ttfamily ezg21@cantab.ac.uk}}}

\title{\texttt{textcsc}:\\A package for caps-to-small-caps text}
\begin{document}
\maketitle
\tableofcontents
\clearpage
\section{Overview}
It is a longstanding typographic practice to typeset lengthy abbreviations as small-capitals to avoid unsightly groups of capital letters. Using the standard \LaTeX\ commands for small capitals (\verb!\textsc! and \verb!\scshape!) this requires the input letters to be typed in lowercase. For example, to produce \textcsc{FBI}, one types \verb!\textsc{fbi}!. This use of lowercase creates problems.  Users of screenreaders or other accessibility software, as well as people who copy-paste the text from your \textcsc{PDF} to quote you, will  only encounter the lowercase. If the document has been converted to another format, like an e-book or webpage, the small caps formatting may not convert with it. Even if the format carries when convert by Pandoc or other programme to \textcsc{HTML}, web users who block remote fonts or disable scripts may see, as a fallback, unsightly or confusing lower-case letters jammed together. 

Thus, for users of \hologo{LuaLaTeX} or \hologo{XeLaTeX}, this package provides two very simple commands that produce caps-to-small-caps text, taking advantage of existing OpenType features. These two commands neatly help solve the problem of ensuring that all capitals can be used to avoid confusion with other formats or usages, without compromising the traditional typographic practice.

\section{Usage}
In your preamble put:
\begin{minted}[
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
breaklines,
firstnumber=last
]
{latex}
\usepackage{textcsc}
\end{minted}

To use a switch analagous to \verb!\scshape! simply use  \verb!\cscshape!. 
\begin{minted}[
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
breaklines,
firstnumber=last
]
{latex}
The \cscshape CIA\normalfont\ and the \cscshape FBI
\end{minted}

Produces:
\begin{quote}
	The \cscshape CIA\normalfont\ and the \cscshape FBI
\end{quote}

To use a macro analagous to \verb!\textsc! simply use  \verb!\textcsc!:
\begin{minted}[
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
breaklines,
firstnumber=last
]
{latex}
	The \textcsc{CIA} and the \textcsc{FBI}
\end{minted}

Produces:
\begin{quote}
	The \textcsc{CIA} and the \textcsc{FBI}
\end{quote}

\section{Development}
Bugs, feature requests, \textit{etc}, should be submitted to the project's official Githup page: (\url{github.com/ezgranet/textcsc}).
\section{Licence}
	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 \textcsc{CC-BY-SA} 3.0.
	\clearpage 
\section{Implementation}
\begin{minted}[
frame=lines,
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
linenos,
breaklines,
firstnumber=last
]
{latex}
\def\textcscversionnumber{1.0.0}
\ProvidesPackage{textcsc}
[2022/09/10\textcscversionnumber\
 Command for caps-to-small-caps-text]
% This work may be distributed and/or modified under the 
% conditions of the LaTeX Project Public License, either version 1.3 
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX 
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Elijah Z Granet
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Warning that you need
% fontspec 
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{iftex}
\ifPDFTeX   {
    \PackageError{swungdash}
      {You are using pdfTeX but this package only works 
      \MessageBreak with XeTeX or LuaTeX}{}
    }
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Dependencies
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{fontspec}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% the switch
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\cscshape}{\addfontfeature{RawFeature={+c2sc,+smcp}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% the macro
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\textcsc}[1]{{\cscshape%
#1%
}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% all done
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{minted}

\section{Version History}
\subsection{\texttt{1.0.0}}

\ttfamily 22 September 2022: Package creation

	
\end{document}