As I avoid the space at the end of the lines. I want the last word of each line to touch the edge of the minipage but not to exceed it. Each line has to stay as it is, one should not remove or include words, or change words between two lines. I can not use \ spaceskip to rearrange each line individually. The first word of each line should touch the right edge of the minipage just as it is in the image below. The distribution of the words should be agreeable in the end. Lines that have only one word are not a problem as long as the word remains in the text. I want to know a global solution, such as a style, or package, or command, etc.
\documentclass{article}
\usepackage{fancybox,anyfontsize,geometry,setspace}
\thispagestyle{empty}
\paperwidth=15.0in
\paperheight=13.0in
\addtolength{\textwidth}{12.55in}
\addtolength{\textheight}{6.90in}
\begin{document}
\fbox{
\begin{minipage}{0.45\textwidth}
\begin{spacing}{9}
\fontsize{40}{6}\selectfont
\spaceskip=1.78\fontdimen2\font plus 1.2\fontdimen3\font minus 1.2\fontdimen4\font
Deep down, I know I do \\
great work! I literally \\
study every single day, \\
and I work on huge projects at work. I've been in \\
the field for over 15 years. I work with \\
and even challenge some of the \\
best developers.
\end{spacing}
\end{minipage}
}
\end{document}
Hi @leandriis, here a code using \makebox[\linewidth][s]:
\documentclass{article}
\usepackage{fancybox,anyfontsize,geometry,setspace}
\thispagestyle{empty}
\paperwidth=15.0in
\paperheight=13.0in
\addtolength{\textwidth}{12.55in}
\addtolength{\textheight}{6.90in}
\begin{document}
\fbox{
\begin{minipage}{0.45\textwidth}
\begin{spacing}{9}
\fontsize{40}{6}\selectfont
\spaceskip=1.78\fontdimen2\font plus 1.2\fontdimen3\font minus 1.2\fontdimen4\font
\makebox[\linewidth][s]{Deep down, I know I do} \\
\makebox[\linewidth][s]{great work! I literally} \\
\makebox[\linewidth][s]{study every single day,} \\
\makebox[\linewidth][s]{and I work on huge projects at work. I've been in} \\
\makebox[\linewidth][s]{the field for over 15 years. I work with} \\
\makebox[\linewidth][s]{and even challenge some of the} \\
\makebox[\linewidth][s]{best developers.}
\end{spacing}
\end{minipage}
}
\end{document}
and the result



\linebreaknot\\but your question is very unclear – David Carlisle Feb 24 '19 at 22:36