1

I keep getting \hbox badness error in my code. The line(-.97,-1.37,-1.37) gets indented as well and I'm not sure how to fix it. I just want the output to have the two lines then a space then next two lines etc.

\section{Part 2}
(-1.03, 2.87) decodes as 0100 \\
(-3.28, -1.21) decodes as 0011 - together, 01000011 gives "C"\\

  (-0.97, -2.71) decodes as 0110\\
(2.21, -0.95) decodes as 1011 - together, 01101011 gives "k"\\
\textbf{Probable error} \\
\textbf{Probable intended bit sequence: 01101111 “o”}\\

  (-1.37, -1.48) decodes as 0111\\
(-2.86, -2.51) decodes as 0010 - together, 01110010 gives "r"\\

  (-1.37, -2.73) decodes as 0110\\
(1.22, -3.17) decodes as 1110 - together, 01101110 gives "n"\\
5
  • 1
    Welcome. Please offer a full MWE: tex.meta.stackexchange.com/questions/228/…. Aug 11, 2017 at 22:26
  • the blank line indicates a paragraph break, hence the indentation of the next line. remove the blank lines, and instead modify the line break by adding an explicit skip: \\[1\baselineskip]. Aug 12, 2017 at 0:28
  • Still doesn't work for me
    – R.I
    Aug 12, 2017 at 1:51
  • @barbarabeeton If you don't mind bad boxes? Isn't our standard advice not to break lines this way outside special environments? What is different here?
    – cfr
    Aug 12, 2017 at 3:06
  • 2
    You might put a \begin{flushleft}... \end{flushleft} around this part of your text. Or use a tabular. Then you can use \\ without bad boxes and \\[1\baselineskip] for a 2 line skip, as suggested.
    – cfr
    Aug 12, 2017 at 3:08

2 Answers 2

1

Please always provide compilable code. I honestly have no idea if this will actually work in your example, as I don't know what else is going on. Shot in the dark ....

\documentclass{article}
\begin{document}
\section{Part 2}
\begin{flushleft}
  (-1.03, 2.87) decodes as 0100 \\
  (-3.28, -1.21) decodes as 0011 - together, 01000011 gives ``C''\\[1\baselineskip]

  (-0.97, -2.71) decodes as 0110\\
  (2.21, -0.95) decodes as 1011 - together, 01101011 gives ``k''\\
  \textbf{Probable error} \\
  \textbf{Probable intended bit sequence: 01101111 ``o''}\\[1\baselineskip]

  (-1.37, -1.48) decodes as 0111\\
  (-2.86, -2.51) decodes as 0010 - together, 01110010 gives ``r''\\[1\baselineskip]

  (-1.37, -2.73) decodes as 0110\\
  (1.22, -3.17) decodes as 1110 - together, 01101110 gives ``n''\\[1\baselineskip]
\end{flushleft}
\end{document}

shot in the dark

Note that your original code produces only closing double quotation marks. If you want curly quotes, you need opening ones, too. If not, you need to use the appropriate \text... command. But in that case, you probably want some sort of code-listing markup anyway.

2
  • I think you want math mode for the coordinate pairs.
    – egreg
    Aug 12, 2017 at 9:11
  • @egreg Or verbatim of some kind .... I'm not sure which would be correct here?
    – cfr
    Aug 12, 2017 at 12:36
1

You should use math mode for the coordinate pairs and \bigskip (or maybe just \medskip) between the lines you want to space out.

I also changed the hyphen into an em-dash (the hyphen should only join words) and set the bit sequences in the monospaced font for contrast.

There's also a suggested rendering with a table.

\documentclass{article}
\usepackage{booktabs,siunitx}

\newcommand{\bits}[1]{\texttt{#1}}
\newcommand{\lparen}{(}
\newcommand{\rparen}{)}

\begin{document}

\section{Part 2}

\begin{flushleft}
$(-1.03, 2.87)$ decodes as \bits{0100} \\
$(-3.28, -1.21)$ decodes as \bits{0011} --- together, \bits{01000011} gives ``C''

\bigskip

$(-0.97, -2.71)$ decodes as \bits{0110}\\
$(2.21, -0.95)$ decodes as \bits{1011} --- together, \bits{01101011} gives ``k''\\
\textbf{Probable error} \\
\textbf{Probable intended bit sequence: \bits{01101111} ``o''}

\bigskip

$(-1.37, -1.48)$ decodes as \bits{0111}\\
$(-2.86, -2.51)$ decodes as \bits{0010} --- together, \bits{01110010} gives ``r''

\bigskip

$(-1.37, -2.73)$ decodes as \bits{0110}\\
$(1.22, -3.17)$ decodes as \bits{1110} --- together, \bits{01101110} gives ``n''
\end{flushleft}

\section{Part 2}

\begin{tabular}{
  @{}
  >{\lparen}S[table-space-text-pre=\lparen,table-format=-1.2]
  @{,\,}
  S[table-space-text-post=\rparen,table-format=-1.2]<{\rparen}
  >{\ttfamily}c
  >{\ttfamily}c
  c
  @{}
}
\toprule
\multicolumn{2}{c}{Point} &
\multicolumn{1}{c}{decodes as} &
\multicolumn{1}{c}{together} &
gives \\
\midrule
-1.03 &  2.87 & 0100 \\
-3.28 & -1.21 & 0011 & 01000011 & C \\
\addlinespace

-0.97 & -2.71 & 0110\\
 2.21 & -0.95 & 1011 & 01101011 & k \\
\multicolumn{3}{@{}l}{\bfseries Probable error} \\
\multicolumn{3}{@{}l}{\bfseries Probable intended bit sequence} & 01101111 & \bfseries o\\
\addlinespace

-1.37 & -1.48 & 0111\\
-2.86 & -2.51 & 0010 & 01110010 & r \\
\addlinespace

-1.37 & -2.73 & 0110\\
 1.22 & -3.17 & 1110 & 01101110 & n \\
\bottomrule
\end{tabular}

\end{document}

enter image description here

You must log in to answer this question.

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