0

Why is the following table wider than the page?!

After comments from two members from this site, I included more code from the original file. It seems that the tabular environment in the first problem is prompting TeX to artificially stretch the table in the last problem.

\documentclass{amsart}


\usepackage{tikz}
\usetikzlibrary{calc,intersections}


\usepackage{makecell}


\begin{document}


\noindent \textbf{1.) }Compute the following differences. Express each difference as a fraction for which the only common divisor of the numerator and denominator is 1. \\ \\
\noindent \hspace*{2em}
\setlength{\tabcolsep}{0.75in}
\setlength{\extrarowheight}{3ex}
\begin{tabular}{@{}r@{}lr@{}lr@{}l}
\textbf{i.) }   &   $\displaystyle{\frac{1}{2} - \frac{1}{3}}$
&
\textbf{ii.) }  &   $\displaystyle{1 - \frac{1}{3}}$
&
\textbf{iii.) } &   $\displaystyle{\frac{11}{18} - \frac{22}{45}}$ \\[1.2\normalbaselineskip]
\textbf{iv.) }  &   $\displaystyle{\frac{27}{14} - \frac{12}{35}}$
&
\textbf{v.) }   &   $\displaystyle{\frac{16}{27} - \frac{32}{81}}$
&
\textbf{vi.) }  &   $\displaystyle{\frac{21}{10} - \frac{21}{100}}$
\end{tabular}
\vskip0.25in

\vfill
\pagebreak


\noindent \textbf{14.) }What is the perimeter of the following triangle?
\vskip0.2in

\noindent \hspace*{\fill}
\begin{tikzpicture}


%Triangle ABC is drawn. The lengths of AB, AC, and BC are to be 8, 10, and 12, respectively.
%(The measure of the angle between AB and AC is arc cos(1/8).)
\coordinate (A) at (0,0);
\coordinate (B) at (5,0);
\coordinate (C) at ({acos(1/8)}:4);
\draw (A) -- (B) -- (C) -- cycle;



%The lengths of the sides of the triangle are typeset.
\node[anchor=north, inner sep=0, font=\footnotesize] at ($($(A)!0.5!(B)$) +(0,-0.15)$){$10$};
\node[anchor={acos(1/8)-90}, inner sep=0, font=\footnotesize] at ($($(A)!0.5!(C)$) +({acos(1/8)+90}:0.15)$){$8$};
\draw let \p1=($(B)-(C)$), \n1={atan(\y1/\x1)} in node[anchor={\n1-90}, inner sep=0, font=\footnotesize] at ($($(B)!0.5!(C)$) +({\n1+90}:0.15)$){$12$};


\end{tikzpicture}
\hspace{\fill}
\vskip0.25in

\noindent The following table, describing the Preston City workforce, is missing some data entries. Based on the information in the table, how many women in the Preston City workforce are unemployed?
\begin{tabbing}
\hspace*{3em} \= \hspace{2.5in} \= \kill
\> \textbf{a.) }500     \> \textbf{b.) }1000 \\
\> \textbf{c.) }1500    \> \textbf{d.) }2000 \\
\> \textbf{e.) }2500
\end{tabbing}
\vskip0.2in

\noindent \hspace*{\fill}
\setlength\extrarowheight{2pt}
\begin{tabular}{|| c | c | c !{\vrule width0.8pt}c ||} \hline
\multicolumn{4}{|| c ||}{{\bf Residents of Preston City}} \\ \Xhline{0.8pt}
            &   Employed    &   Unemployed  &   Total \\ \hline
    Men     &   27,000      &               &   \\ \hline
    Women   &               &               &   21,500 \\ \Xhline{0.8pt}
    Total   &   48,000      &               &   50,500 \\ \hline
\end{tabular}
\hspace{\fill}

\end{document}
  • Given this MWE, it's not wider than the page? – Mike Renfro Jan 05 '17 at 01:58
  • sorry, but this table is about half of text width! – Zarko Jan 05 '17 at 01:58
  • @Mike Renfro On a blank file, it is displayed correctly. In a file with other text, it is artificially stretched off the right edge of the page! – A gal named Desire Jan 05 '17 at 02:31
  • Still haven't seen that symptom. If I add more text via the lipsum package, I see the tabular content get pushed to the right due to the \hspace* command, but the tabular width is always sized around its content, which is comparatively narrow. – Mike Renfro Jan 05 '17 at 02:35
  • @Mike Renfro I just edited the post. If you compile this code, you will see the table get artificially stretched. (I didn't edit the code for the table.) – A gal named Desire Jan 05 '17 at 02:47
  • Change \setlength{\tabcolsep}{0.75in} to a lower value before the Preston City table. I expect you added it to spread out the table of fractions in question 1. – Mike Renfro Jan 05 '17 at 02:52
  • I'd also consider changing the table of fractions to a multi-column enumerated environment, along the lines of Multiple Choices Questions in 2 or 3 columns. – Mike Renfro Jan 05 '17 at 02:57
  • @Mike Renfro I replaced 0.75in to 0.5in, and it somehow brought the right edge of the table in the last problem onto the page. It is still twice as wide as the same table before I added the first problem. – A gal named Desire Jan 05 '17 at 03:12
  • 1
    Option 1: store the original \tabcolsep length before you change it (\newlength{\origtabcolsep} \setlength{\origtabcolsep}{\tabcolsep}), then change it back after your first problem (\setlength{\tabcolsep}{\origtabcolsep}). Option 2: add a brace group around the entire first problem, which makes the \tabcolsep local to the brace group, and not for the rest of the document. 0.75 inches is still too wide, even for the first problem (column three is well beyond your right margin). – Mike Renfro Jan 05 '17 at 03:18
  • @Mike Renfro I used your second option. (I reduced the column separation to 0.6in.) – A gal named Desire Jan 05 '17 at 03:33
  • @Mike Renfro If you post the code for your first option, I will accept it. – A gal named Desire Jan 05 '17 at 03:34
  • 1
    @AgalnamedDesire: That option is covered in the linked duplicate. – Werner Jan 05 '17 at 03:45
  • @Werner I didn't see anything like \setlength{\tabcolsep}{(space)} in the link. – A gal named Desire Jan 05 '17 at 04:10
  • @AgalnamedDesire: See bullet 6 of option 1. Or Ctrl+F for tabcolsep. – Werner Jan 05 '17 at 04:13
  • @Werner I thought that you were talking about the link provided by Mike Renfro in one of his comments. – A gal named Desire Jan 05 '17 at 04:18

0 Answers0