1

I am using WinEdt for LaTeX. After compiling the tex file, the output comes out in the following way.

enter image description here

Is there any way to justify the text better? It seems quite bad on the right side of the text. I tried using $\justify$ command but it didn't help. Kindly help.

  • 3
    Justified text is the LaTeX default. Do you get any warnings about bad boxes? Underfull or overfull? There is a lot of math going on, have you thought about using display environments? – Johannes_B Jun 3 '18 at 6:03
  • @Johannes_B I have no idea about display environments. Can you please elaborate briefly please. – monalisa Jun 3 '18 at 6:14
  • Math on lines of its own, maybe with an quation number on the side for referencing. Search for equation and align. – Johannes_B Jun 3 '18 at 6:16
  • 3
    Please edit your posting and show the code that gave rise to the screenshot you've posted. Please also indicate which document class you employ and which font- and math-related packages (if any) you load. – Mico Jun 3 '18 at 7:32
3

I think you should typeset the four path statements as displayed equations, i.e., on lines by themselves. (The opposite of a displayed equation is an inline equation.) Using displayed equations will not only get around some of the most severe justification difficulties, it will also make the long equations much easier to read (and, hopefully, understand!).

You could employ an align* environment to generate the four displayed equations. Note that alignment is performed on the : (colon) symbols.

The following code features both inline equations, i.e, those that start and end with $, and displayed equations.

enter image description here

\documentclass[12pt]{article}
\usepackage[letterpaper,margin=2.5cm]{geometry} % set the page parameters suitably
\usepackage{mathtools} % for 'align*' environment and '\shortintertext' macro
\usepackage{newtxtext,newtxmath} % Times Roman text and math fonts
\begin{document}

\noindent
\textbf{(b)} $n=4m+2$, $m$ odd, and $i=2m$.

We write $2m=4m+2-(2m+2)$. In this case, the shortest
$u_0-u_i$, $u_0-v_i$, $v_0-u_i$, and $v_0-v_i$ paths are
given by
\begin{align*}
P_9'' &\colon u_{4m+2}=u_0,\ v_{4m+2}=v_0,\ 
v_{(4m+2)-4}, \dots,\ v_{(4m+2)-(2m+2)},\ u_{(4m+2)-(2m+2)}; \\
P_{10}'' &\colon u_{4m+2}=u_0,\ \dots, \ ; \\
P_{11}'' &\colon v_{4m+2}=v_0,\ \dots, \ ; \\
\shortintertext{and}
P_{12}'' &\colon v_{4m+2}=v_0,\ \dots, \ .
\end{align*}
The lengths of $P_9''$, $P_{10}''$, $P_{11}''$, and $P_{12}''$ are
$1+\frac{(4m+2)-\{(4m+2)-(2m+2)\}}{4}+1$, 
$1+\frac{(4m+2)-\{(4m+2)-(2m+2)\}}{4}$, 
$1+\frac{(4m+2)-\{(4m+2)-(2m+2)\}}{4}$, and
$\frac{(4m+2)-\{(4m+2)-(2m+2)\}}{4}$, i.e.,
$\frac{m+5}{2}$, $\frac{m+3}{2}$, $\frac{m+3}{2}$, 
and $\frac{m+1}{2}$, respectively.

\end{document} 

Addendum: The inline equations in the final paragraph contain some fairly long fractional expressions, and they just happen to have the right lengths to not cause overfull lines. That's mostly just sheer good luck. Nothing against good luck, naturally, but what to do if good luck runs out? A good way to proceed is not to generate long fractional expressions in an inline setting, as these fractional terms can't be broken across lines. Instead, switch to inline-fraction notation. What is inline-fraction notation? Basically, instead of writing $\frac{a+b+c}{d}$, one would write either $[a+b+c]/d$ or, if for some reason one isn't willing to drop \frac completely, $\frac{1}{d}[a+b+c]$. The following screenshot shows how the final paragraph of the preceding example would look like with either type of inline-fraction notation. Not only is the danger of overfull lines pretty much banished, the inline fractions generate larger letters and symbols than \frac does, which should be easier to read.

enter image description here

The associated code is as follows (simply plug it into the correct place in the full, compilable example provided above):

The lengths of $P_9''$, $P_{10}''$, $P_{11}''$, and $P_{12}''$ are
$1+[(4m+2)-\{(4m+2)-(2m+2)\}]/4+1$, 
$1+[(4m+2)-\{(4m+2)-(2m+2)\}]/4$, 
$1+[(4m+2)-\{(4m+2)-(2m+2)\}]/4$, and
$[(4m+2)-\{(4m+2)-(2m+2)\}]/4$, i.e.,
$(m+5)/2$, $(m+3)/2$, $(m+3)/2$, and $(m+1)/2$, respectively.

\medskip\noindent
The lengths of $P_9''$, $P_{10}''$, $P_{11}''$, and $P_{12}''$ are
$1+\frac{1}{4}[(4m+2)-\{(4m+2)-(2m+2)\}]+1$, 
$1+\frac{1}{4}[(4m+2)-\{(4m+2)-(2m+2)\}]$, 
$1+\frac{1}{4}[(4m+2)-\{(4m+2)-(2m+2)\}]$, and
$\frac{1}{4}[(4m+2)-\{(4m+2)-(2m+2)\}]$, i.e.,
$\frac{1}{2}(m+5)$, $\frac{1}{2}(m+3)$, $\frac{1}{2}(m+3)$, and $\frac{1}{2}(m+1)$, respectively.
  • 2
    Incidentally, I don't think that it's correct to write the path between $x$ and $y$ as $x-y$. The path should, rather, between written as $x$--$y$, so that a text mode en-dash symbol gets employed instead of a math-minus symbol. – Mico Jun 3 '18 at 9:10
  • 1
    Thank you so much. For so long I was wondering the same. You solved my problem. Thanks a lot – monalisa Jun 4 '18 at 4:53

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.