Got inspired from a nice article titled "why All Caps is so hard to read", I want to produce the following result for my document.

enter image description here





How to do this automatically?

enter image description here

In order to be flexible, let r be the ratio of height to remove (relative to the baseline).

Bonus: How to convert all characters to capital before trimming?

  • I think that, for it to be "automatic", you would actually need to create a truncated font. – Steven B. Segletes Feb 27 '18 at 18:57
  • @StevenB.Segletes or you could "stack" a box over the text.... – David Carlisle Feb 27 '18 at 19:56
  • @DavidCarlisle Don't think the thought hadn't crossed my mind ;^). – Steven B. Segletes Feb 27 '18 at 19:58
  • Sadly both soul and ulem don't work out of the box, as those apparently put the line behind the text. – Skillmon Feb 27 '18 at 22:00

Of course there is a minimal solution in ConTeXt.



\chop{\WORDS{\input lorem }}


enter image description here

| improve this answer | |

enter image description here




| improve this answer | |
  • @ArtificialStupidity if it was normal text you could use \MakeUppercase but \lipsum isn't expandable so doesn't work there. – David Carlisle Feb 27 '18 at 20:17
  • your example used standalone so I rather assumed you only wanted single page but yes this just overprints lines going up from the end of the paragraph so if there is a page break mid paragraph it would need more work. You don't really want this for extended runs of multi-page text do you??? – David Carlisle Feb 27 '18 at 20:26
  • adding rules at a fixed distance to every page over the text is easy (just add a picture mode to the page foot that adds lines as here) if you want multi-page version with arbitrary text such as section headings etc and having to recalculate where the rules go for each text block it's possible but far too much work for the answer here sorry. Hopefully one of the answers here will get you started so you can fill out to whatever full version you need. @ArtificialStupidity – David Carlisle Feb 27 '18 at 20:31

Here is another proposal based on TikZ and lineno. You only need to adjust \TruncateRatio to get a different truncation ratio r. If you want to truncate only a portion of your text, put it bewtween \begin{runninglinenumbers} and \end{runninglinenumbers} (and comment out \linenumbers). David Carlisle's comments on \MakeUppercase apply here, too. The reason why I post this (given the other excellent answers) is that it is trivial to play with opacity and, perhaps more importantly, also works with equations.

\tikz[remember picture,baseline=(#1.base),inner sep=0pt] \node (#1) {$#2$};%
}%from https://tex.stackexchange.com/questions/402462/tikz-equivalent-of-pstricks-commands-ncbar-and-rnode/402466#402466

        {\tikznode{left}{\strut}\ \rlap{\hskip\textwidth\ \tikznode{right}{\strut}}
        \tikz[overlay,remember picture]{\fill[white](left.south)rectangle($(right.south)!\TruncateRatio!(right.north)$);}}
         b_1 &=& a_{11}x_1 + a_{12}x_2 \\
         b_2 &=& a_{21}x_1 + a_{22}x_2

enter image description here

| improve this answer | |
  • Much better than my 1min adaptation! – Skillmon Feb 28 '18 at 7:35
  • But you shouldn't use eqnarray anymore! – Skillmon Feb 28 '18 at 7:36
  • @Skillmon Thanks! But I just copied the equation literally from the lineno manual. Seems like the authors didn't want to blow up their manual by loading additional packages, and I have the same reservation here. Needless to say that my propsal also works with align , but of course for fractions it will just kill the denominator. In any case, there are also no instructions from the OP how to deal with equations, I guess that you will always find a pathological case with subscripts and so on. – user121799 Feb 28 '18 at 16:05

A TikZ solution (quickly modified version of a TikZ based multiline underline). It doesn't work across multiple pages and if the line distance is more than \baselineskip. This reuses ideas from https://tex.stackexchange.com/a/411361/117050 and https://tex.stackexchange.com/a/411655/117050.



\tikzset{tikzCUT/.style={line width=1.1ex,white}}
\newcommand{\gettikzxy}[3]{% from https://tex.stackexchange.com/a/58590/121799
  \tikz[remember picture,overlay, baseline=(Begin.base)]{%
    \node[anchor=base,inner sep=0pt,outer sep=0pt,xshift=-\tikzCUT@length]
      (Begin) {\strut};
    \gettikzxy{($(Begin.base)-(current page.south west)$)}
  \tikz[remember picture,overlay, baseline=(End.base)]{%
    \node[anchor=base,inner sep=0pt,outer sep=0pt,xshift=+\tikzCUT@length]
      (End) {\strut};%
    \gettikzxy{($(End.base)-(current page.south west)$)}
  \begin{tikzpicture}[overlay,remember picture]
    \ifdim\dimexpr\tikzCUT@ey-\tikzCUT@by = 0pt
      % one line
      \draw[tikzCUT] ($(Begin.base)+(0,#1)$) -- ($(End.base)+(0,#1)$);%
      % multiple lines
        ($(current page text area.west)-(\tikzCUT@length,0)$) node(WestLine){};
        ($(current page text area.east)+(\tikzCUT@length,0)$) node(EastLine){};
        % more than two lines
    \GenericError{Multi-page warning}{AHHHH}{}%
    ($(Begin.base -| WestLine)+(0,#1)-(0,\tikzCUT@count\tikzCUT@length)$)--
    ($(Begin.base -| EastLine)+(0,#1)-(0,\tikzCUT@count\tikzCUT@length)$);
  \advance\tikzCUT@count by 1
    ($(Begin.base)+(0,#1)$) -- ($(Begin.base -| EastLine)+(0,#1)$)
    ($(End.base)+(0,#1)$) -- ($(End.base -| WestLine)+(0,#1)$);}

\tikzCUT{this foo away}

enter image description here

| improve this answer | |
  • @ArtificialStupidity it seems so, guess I pressed that button twice by accident :) – Skillmon Feb 27 '18 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.