Hide part of the letters (LaTeX or LuaLaTeX)

The adjustbox package provides ways to trim and clip boxed content:

enter image description here

\documentclass{article}

\usepackage{adjustbox}

\begin{document}

Horizontal hiding:
\begin{itemize}
  \item --something--
  \item --\phantom{some}thing--
  \item --some\hphantom{thing}--
  \item --\adjustbox{trim=0pt 0pt 17pt 0pt,clip,lap=\width}{something}\phantom{something}--
  \item --\phantom{something}\adjustbox{trim=.3333\width{} 0pt 0pt 0pt,clip,lap=-\width}{something}--
\end{itemize}

Vertical hiding:
\begin{itemize}
  \item --something--
  \item --so\adjustbox{trim=0pt 3pt 0pt 0pt,clip,raise=3pt}{methi}ng--
  \item --\adjustbox{trim=0pt 0pt 0pt .45\height,clip}{something}--
\end{itemize}

\end{document}

Like this?

enter image description here

\documentclass[tikz,border=2mm]{standalone} 
\usetikzlibrary{positioning}

\begin{document}
\begin{tikzpicture}

\node[inner sep=0pt] (a) {\LaTeX};

\begin{scope}[yshift=-5mm]
\node[inner sep=0pt] (b) {\LaTeX};
\fill[white] (b.north west)-|(b.east)--cycle;
\end{scope}

\begin{scope}[yshift=-1cm]
\node[inner sep=0pt] (c) {\LaTeX};
\fill[white] (c.north west)-|(c.south)-|cycle;
\end{scope}

\begin{scope}[yshift=-1.5cm]
\node[inner sep=0pt] (d) {\LaTeX};
\fill[white] (d.south west) rectangle (d.east);
\end{scope}

\end{tikzpicture}
\end{document}

Update

I've updated the code and defined several styles which can be easily applied to any text. Of course, these styles are just examples of what can be done.

\documentclass{article} 
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\usepackage{lmodern}

\tikzset{
    show bottom/.style={inner sep=0pt, 
        prefix after command={%
            \pgfextra 
                \clip (\tikzlastnode.south west) rectangle ($(\tikzlastnode.south east)!#1!(\tikzlastnode.north east)$);    
            \endpgfextra}
        },
    show top/.style={inner sep=0pt, 
        prefix after command={%
            \pgfextra 
                \clip (\tikzlastnode.north west) rectangle ($(\tikzlastnode.north east)!#1!(\tikzlastnode.south east)$);    
            \endpgfextra}
        },
    show left/.style={inner sep=0pt, 
        alias=this,
        prefix after command={%
            \pgfextra 
                \clip (\tikzlastnode.north west) rectangle ($(\tikzlastnode.south west)!#1!(\tikzlastnode.south east)$);    
            \endpgfextra}
        },
    show right/.style={inner sep=0pt, 
        prefix after command={%
            \pgfextra 
                \clip ($(\tikzlastnode.north west)!#1!(\tikzlastnode.north east)$) rectangle (\tikzlastnode.south east);    
            \endpgfextra}
        },
    show bottom triangle/.style={inner sep=0pt,
        prefix after command={%
            \pgfextra 
                \clip (\tikzlastnode.south west)--(\tikzlastnode.north)-- (\tikzlastnode.south east) -- cycle;  
            \endpgfextra}
        },      
    show top triangle/.style={inner sep=0pt,
        prefix after command={%
            \pgfextra 
                \clip (\tikzlastnode.north west)--(\tikzlastnode.south)-- (\tikzlastnode.north east) -- cycle;  
            \endpgfextra}
        },
    show inner/.style={inner sep=0pt,
        prefix after command={%
            \pgfextra 
                \clip ($(\tikzlastnode.north west)!#1!(\tikzlastnode.center)$) rectangle ($(\tikzlastnode.south east)!#1!(\tikzlastnode.center)$);  
            \endpgfextra}
        }       
}

\begin{document}

Vertical hiding:
\begin{itemize}
\item \LaTeX
\item \tikz \node[show bottom=.3] {\LaTeX};
\item \tikz \node[show bottom=.8] {\LaTeX};
\item \tikz \node[show top=.3] {\LaTeX};
\item \tikz \node[show top=.8] {\LaTeX};
\end{itemize}

Horizontal hiding:
\begin{itemize}
\item \LaTeX
\item \tikz \node[show left=.3] {\LaTeX};
\item \tikz \node[show left=.8] {\LaTeX};
\item \tikz \node[show right=.3] {\LaTeX};
\item \tikz \node[show right=.8] {\LaTeX};
\end{itemize}

Others:
\begin{itemize}
\item \LaTeX
\item \tikz \node[show bottom triangle] {\LaTeX};
\item \tikz \node[show top triangle] {\LaTeX};
\item \tikz \node[show inner=.2] {\LaTeX};
\end{itemize}

\end{document}

enter image description here

Tags:

Typography