\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}


If you want to convert only capitals to small capitals (for example, because your style guide, like that of  \textit{The Economist} prescribes mixed small-caps and lowercase abbreviations), then you can use the macro \verb!\csconly{#1}! or the switch \verb!\csconlyshape! For example, the commands:
\begin{minted}[
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
breaklines,
firstnumber=last
]
{latex}
She earned first an \csconly{MSc} and then a \csconlyshape PhD
\end{minted}

Produce:

\begin{quote}
	
She earned first an \csconly{MSc} and then a \csconlyshape PhD
\end{quote}


\normalfont



\section{Development}
Bugs, feature requests, \textit{etc}, should be submitted to the project's official Github 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.2}
\ProvidesPackage{textcsc}
[2023/05/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.3c 
% 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.3c 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{textcsc}
      {You are using pdfTeX but this package only works 
      \MessageBreak with XeTeX or LuaTeX}{}
    }
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Dependencies
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{fontspec}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% the switch
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\cscshape}{\scshape\addfontfeature{RawFeature={+c2sc}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% the macro
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\textcsc}[1]{{\cscshape%
#1%
}}
\newcommand{\csconlyshape}{\addfontfeature{RawFeature={+c2sc}}}
\newcommand{\csconly}[1]{{\csconlyshape%
#1%
}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% all done
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{minted}
\section{Version History}
\subsection{\texttt{1.2.0}}

\ttfamily 24 April 2023: added option for only caps to small caps text.


\subsection{\texttt{1.1.0}}



\ttfamily 24 April 2023: Update to fix issue with LetterSpace property  not carrying over.





\subsection{\texttt{1.0.0}}

\ttfamily 22 September 2022: Package creation

	
\end{document}