% !TeX TXS-program:compile = txs:///arara
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}

\documentclass[11pt,a4paper]{ltxdoc}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{nodepthtext}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\usepackage{tabularray}
\usepackage{fontawesome5}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\lfoot{\sffamily\small [nodepthtext-doc]}
\cfoot{\sffamily\small - \thepage{} -}
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}}
\usepackage{hologo}
\providecommand\tikzlogo{Ti\textit{k}Z}
\providecommand\TeXLive{\TeX{}Live\xspace}
\let\TikZ\tikzlogo

\newcommand\fontIZ{\fontencoding{T1}\fontfamily{zi4}\fontseries{sb}\selectfont}

\usepackage{hyperref}
\urlstyle{same}
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
\def\TPversion{0.1.0}
\def\TPdate{11/11/2024}
\usepackage{tcolorbox}
\usepackage{pgffor}
\tcbuselibrary{breakable,skins,hooks,listingsutf8}

\lstdefinestyle{packagestyle}
{
	language=[LaTeX]TeX,%
	columns=fullflexible,%
	extendedchars=true,%
	basicstyle=\small\ttfamily,%
	keywordstyle={\color{black}},%
	classoffset=0,%
	keywords={},%
	alsoletter={-},%
	keywordstyle={\color{blue}},%
	classoffset=1,%
	alsoletter={-},%
	morekeywords={nodepthtext,calc,xstring,graphicx,inputenc,fontenc},%
	keywordstyle={\color{violet}},%
	classoffset=2,%
	alsoletter={-},%
	morekeywords={\nodepth},%
	keywordstyle={\color{green!50!black}},%
	classoffset=3,%
	morekeywords={scale,strut},%
	keywordstyle={\color{orange}},%
	inputencoding=utf8/latin1
}

\lstset{
	%	language=[LaTeX]TeX,%
	basicstyle=\small\ttfamily,%
	keywordstyle={},%
}

\newtcblisting{DemoCode}[1]{%
	enhanced,width=\linewidth,%
	bicolor,size=title,%
	colback=cyan!10!white,%
	colbacklower=cyan!5!white,%
	colframe=cyan!75!black,%
	listing options={%
		breaklines=true,%
		breakatwhitespace=true,%
		style=packagestyle,%
		basicstyle=\footnotesize\ttfamily,%
		tabsize=4,%
		commentstyle={\itshape\color{gray}},
		keywordstyle={\color{blue}},%
		classoffset=0,%
		keywords={},%
		alsoletter={-},%
		keywordstyle={\color{blue}},%
		classoffset=1,%
		alsoletter={-},%
		morekeywords={nodepthtext,calc,xstring,graphicx,inputenc,fontenc},%
		keywordstyle={\color{violet}},%
		classoffset=2,%
		alsoletter={-},%
		morekeywords={\nodepth},%
		keywordstyle={\color{green!50!black}},%
		classoffset=3,%
		morekeywords={scale,strut},%
		keywordstyle={\color{orange}}
	},%
	#1
}

\newtcbinputlisting\DemoCodeFile[1]{%
	enhanced,width=\linewidth,%
	bicolor,size=title,%
	colback=lightgray!10!white,%
	colbacklower=lightgray!5!white,%
	colframe=lightgray!75!black,%
	listing options={%
		breaklines=true,%
		breakatwhitespace=true,%
		style=tcblatex,
		extendedchars=true,%
		basicstyle=\tiny\ttfamily,%
		keywordstyle={},%
		tabsize=2,%
		commentstyle={\itshape\color{gray}},%
		inputencoding=utf8/latin1
	},%
	breakable,
	listing only,%
	listing file={#1}
}

\NewDocumentCommand\ShowCode{ m }{%
	\colorbox{lightgray!50}{\lstinline!#1!}%
}

\begin{document}

\thispagestyle{empty}

\begin{center}
	\begin{minipage}{0.88\linewidth}
		\begin{tcolorbox}[colframe=yellow,colback=yellow!15]
			\begin{center}
				\renewcommand{\arraystretch}{1.25}%
				\begin{tabular}{c}
					{\Huge \texttt{nodepthtext}}\\
					\\
					{\LARGE Adapt small texts,} \\
					{\LARGE with empty depth.} \\
					\\
					{\small \texttt{Version \TPversion{} -- \TPdate}}
				\end{tabular}
			\end{center}
		\end{tcolorbox}
	\end{minipage}
\end{center}

\begin{center}
	\begin{tabular}{c}
		\texttt{Cédric Pierquet}\\
		{\ttfamily c pierquet -- at -- outlook . fr}\\
		\texttt{\url{https://github.com/cpierquet/nodepthtext}} \\
	\end{tabular}
\end{center}

\hrule

\vfill

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
%normal version, with depth of letters & nodepth version, with removing depth and resizing
A sample text to show letters with depth.\\
\nodepth{A sample text to show letters without depth.}
\end{tcolorbox}

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
%normal version, with depth of letters & nodepth version, with removing depth and resizing
{\LARGE\ttfamily A text to show letters with depth.}\\
{\LARGE\ttfamily\nodepth{A text to show letters without depth.}}\\
{\LARGE\ttfamily\nodepth[0.7]{A text to show letters without depth and rescaling.}}
\end{tcolorbox}

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
%normal version, with depth of letters & nodepth version, with removing depth and resizing
{\LARGE\fontIZ A text to show letters with depth (inconsolata).}\\
{\LARGE\fontIZ\nodepth{A text to show letters w/o depth (inconsolata).}}\\
{\LARGE\fontIZ\nodepth[0.7]{A text w/o depth and scaling (inconsolata).}}
\end{tcolorbox}

\vfill~

\vspace*{5mm}

\pagebreak

\phantomsection

\hypertarget{matoc}{}

\tableofcontents

\vspace*{5mm}

%\hrule

\pagebreak

\section{Introduction}

\subsection{Loading, useful packages}

In order to load \ShowCode{nodepthtext}, simply use:

\begin{DemoCode}{listing only}
\usepackage{nodepthtext}
\end{DemoCode}

Loaded packages are \ShowCode{graphicx}, \ShowCode{xstring} and \ShowCode{calc}.

\subsection{Usage, limitations}

The purpose of this package is to provide command, based on \ShowCode{\\raisebox} and \ShowCode{\\resizebox}, to locally remove depth of characters.

\begin{itemize}
	\item the code read characters one by one;
	\item whenever a character (letter or punctuation\ldots) with depth is processed, this character is raised and resized in order to match others characters;
	\item if \hologo{LuaLaTeX} is used, accentuated characters can be given normally (\texttt{uft8}), but with \hologo{pdfLaTeX}, they mus be given within \LaTeX\ syntax.
\end{itemize}

So, for accentuated letters (because \ShowCode{xstring} processes the characters), please load \ShowCode{inputenc} and \ShowCode{fontenc} with corrects options if \hologo{pdfLaTeX} is used (not necessary with \hologo{LuaLaTeX}).

\begin{DemoCode}{listing only}
%example with pdflatex preamble
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\end{DemoCode}

\vfill

\subsection{History}

\texttt{0.1.0: Initial version}

\vspace*{5mm}

\pagebreak

\section{The macro}

The main macro is \ShowCode{\\nodepth}.

\begin{DemoCode}{listing only}
\nodepth[scale]{text}
\end{DemoCode}

The optional argument, within \ShowCode{[...]}, can modify scale for modified characters (\ShowCode{0.8} by default).

The mandatory argument, within \ShowCode{\{...\}}, is a small text to process (beware of accentuated characters).

\smallskip

In order to work with sizes and fonts, the macro needs to be given within the group of defined size/font!

\section{Samples}

\subsection{Wih custom size}

\begin{DemoCode}{}
%normal version, with depth of letters
{\LARGE\ttfamily A text to show letters with depth.}

%nodepth version, with removing depth and resizing
{\LARGE\ttfamily\nodepth{A text to show letters without depth.}}\\
{\LARGE\ttfamily\nodepth[0.7]{A text to show letters without depth and scaling.}}
\end{DemoCode}

\subsection{With custom font, and accents}

\begin{DemoCode}{listing only}
%use inconsolata font (with pdfLaTeX)
\newcommand\fontIZ{\fontencoding{T1}\fontfamily{zi4}\fontseries{sb}\selectfont}
\end{DemoCode}

\begin{DemoCode}{}
%normal version, with depth of letters and accents (inconsolata font)
{\large\fontIZ A text to show depth and a word with accents, météo.}\\

%nodepth version, with removing depth and resizing and accents...
{\large\fontIZ\nodepth{Quote text w/o depth and a word with accents, m\'{e}t\'{e}o.}}\\
{\large\fontIZ\nodepth[0.7]{Quote text w/o depth, scaling and a word with accents, m\'{e}t\'{e}o.}}
\end{DemoCode}

\pagebreak

\section{The code}

\DemoCodeFile{nodepthtext.sty}

\end{document}
