5

There is no way to reformulate the sentence. When I for example delete the letter "i" within the sentence, I'm good, everything fits perfectly.

So I was thinking about cutting the corners of blank space. It just concerns one particular row. Any idea? I guess this is against the laws of typography, but...

When I was the MS user, this occured to me once and I simply changed the size of blank space.

MWE

\documentclass[12pt]{article}


\begin{document}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 

Neither text reformulation nor deleting any characters is not the option (btw, is neither A nor B considered singular or plural?). Anyway, any idea????

\end{document}

This document needs to be just a one page. I want to deteriorate something on the last row (hopefully the space) so that I can still have there four questions marks. If you delete a letter 'i' in 'considered', it works, so I'm looking for some minor cheat.

7
  • You can add \hfuzz=2pt to the preamble and TeX will happily ignore overful \hboxes not exceeding 2pt. Commented Mar 20, 2014 at 3:58
  • @Gonzalo Medina: my document is full of overful hbox.
    – Vochmelka
    Commented Mar 20, 2014 at 3:59
  • 2
    Can you post an example that replicates your problem? Yes, you can adjust the inter-word spacing, or perhaps adjust the spacing around a specific character. Even you can adjust the entire line be shrinking it horizontally (not vertically). But more information is required. Preferably provide a minimal working example (MWE).
    – Werner
    Commented Mar 20, 2014 at 4:05
  • 6
    what about loading the microtype package? it can adjust the interspace words as well as other features (e.g., protrusion) that can help with the problem at hand.
    – Guido
    Commented Mar 20, 2014 at 7:14
  • 1
    I get no overfull line from your example. I second @Guido's advice of loading microtype that usually solves many of those problems.
    – egreg
    Commented Mar 20, 2014 at 12:40

4 Answers 4

3

This answer takes the approach of trying to resolve the problem locally (at the point of difficulty), rather than resetting global parameters that affect the whole document.

This answer has been REVISED to take barbara's suggestion of preferentially providing smaller space after periods and commas. I leave the original solution in the code as a comment. If you uncomment that line and recompile, you will see the difference that barbara's suggestion makes. (Note I reversed the order of results, previously best to worst, now worst to best, so take that into account when reading barbara's comment).

While, at first it may seem different, this answer was based on my recent answer at Typeset just the first letter in a group. I create the macro \squeeze{}, which will squeeze its contents by converting all spaces to two \hfils (but only one \hfil after commas and periods, respectively). To use it, just make sure the end of the paragraph is the end of the argument, and the beginning of the argument is somewhere on the last line. Below, I show that the beginning of the squeeze need not be precise, though generally including more words in the argument will spread the squeeze more gently across more spaces.

\documentclass[12pt]{article}
\def\squeeze#1{\squeezeit#1 \relax\relax}
% REVISED SOLUTION
\def\squeezeit#1 #2\relax{#1\if\relax#2\else
  \findlast#1\relax\relax%
    \if.\LastChar\hfil\else
      \if,\LastChar\hfil\else
        \hfil\hfil%
       \fi
    \fi
  \squeezeit#2\relax\fi%
}
\def\findlast#1#2\relax{\def\LastChar{#1}\if\relax#2\else\findlast#2\relax\fi}
\parskip 1ex
% ORIGINAL SOLUTION (No \findlast and this \squeezeit below
% Uncomment old definition below, to see comparison
%\def\squeezeit#1 #2\relax{#1\if\relax#2\else{}\hfill\squeezeit#2\relax\fi}
\begin{document}
{\bfseries Goal: get 3 line expression down to two lines.}\par
Neither text reformulation nor deleting any characters is not the option 
(btw, is neither A nor B considered singular or plural?). Anyway, any idea????\par
{\bfseries Marginal:}\par
Neither text reformulation nor deleting any characters is not the option 
(btw, is neither A nor B considered \squeeze{singular or plural?). Anyway, any idea????}\par
{\bfseries Good:}\par
Neither text reformulation nor deleting any characters is not the option 
(btw, is neither \squeeze{A nor B considered singular or plural?). Anyway, any idea????}\par
{\bfseries Better:}\par
Neither text reformulation nor deleting any characters is not the option 
\squeeze{(btw, is neither A nor B considered singular or plural?). Anyway, any idea????}
\end{document}

enter image description here

3
  • the second try looks markedly better than the last -- an object lesson for applying the adjustment to the longest string possible. it might be a good idea to preferentially reduce the spaces after periods and commas, where the "open" nature of the character helps avoid possible ambiguity. Commented Mar 20, 2014 at 12:55
  • @barbarabeeton Please see revision. Commented Mar 20, 2014 at 14:04
  • 1
    @barbarabeeton Oops, I reversed the order of my presentation to show increasing order of quality. Now that means your comment is out of date. READERS, barbara does not need an eye exam... it was my fault. Commented Mar 20, 2014 at 14:11
2

You can change the size of the interword space. There are at least three different ways to make your MWE into a 1 page document. If you add

\spaceskip=0.95\fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font

you will reduce the natural length of the interword space. The set of line breaks that leads to a paragraph with the smallest badness with this new natural length is different from the set of line breaks with the original interword space. This allows you to fit more on the page

Another option is to add

\spaceskip=\fontdimen2\font plus \fontdimen3\font minus 1.2\fontdimen4\font

this allows the interword space to be shrunk be a little bit more.

Potentially the simplest solution is to use the microtype package.

\usepackage{microtype}

The package enables all sort of tricks that lead to slightly better typesetting and in this case turns the 2 page document into a 1 page document.

1

Putting \hspace{-0.7mm} just before the word 'anyway' worked fine. What do you think?

enter image description here

(I should have probably mentioned better that I want to solve the problem locally, i.e. within the last row or even beter the specific paragraph.)

1

You can use \enlargethispage{50pt} or the starred version, \enlargethispage*{50pt} before the last paragraph. Then use \newpage after the last paragraph.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .