TransWikia.com

Why is there a missing piece of line on the table?

TeX - LaTeX Asked on December 11, 2020

I have the following table which for some reason doesn’t display the complete LHS vertical end line. I’ve notice that the line ‘broke’ when I added the ; I added because I wanted some space between the end-horizontal line and the fractions. Could someone please help me to fix the line?

documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tabularx}
usepackage{graphicx}


begin{document}



begin{table}[h]
begin{center} 
begin{tabular}{ | m{3.5cm} m{3.5cm} m{2.8cm}| } 
hline
%vspace{2mm}
multicolumn{3}{|l|}{textbf{Reciprocal identities :}}
vspace{2mm} $sin theta = dfrac{1}{csc theta}$ & vspace{2mm} $cos theta = dfrac{1}{sec theta}$ & vspace{2mm} $tan theta = dfrac{1}{cot theta}$
vspace{3mm} $csc theta = dfrac{1}{sin theta}$ & vspace{2mm} $sec theta = dfrac{1}{cos theta}$ & vspace{2mm} $cot theta = dfrac{1}{tan theta}$ 
hline
end{tabular}

end{center}
end{table}


end{document}

Also, how can I add space between the horizontal line and ‘Reciprocal identities’? I tried vspace{2mm} (with %) but, once again, the line breaks and modifies the text to the center.

Thank you in advance.

3 Answers

You can use [Xpt] instead of at the end of the last table line for considering some space between the last table line and the horizontal line. In this way, you can also adjust the space by changing the X value.

So, your code will be something like this:

documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tabularx}
usepackage{graphicx}


begin{document}



begin{table}[h]
begin{center} 
begin{tabular}{ | m{3.5cm} m{3.5cm} m{2.8cm}| } 
hline
%vspace{2mm}
multicolumn{3}{|l|}{textbf{Reciprocal identities :}}
vspace{2mm} $sin theta = dfrac{1}{csc theta}$ & vspace{2mm} $cos theta = dfrac{1}{sec theta}$ & vspace{2mm} $tan theta = dfrac{1}{cot theta}$
vspace{3mm} $csc theta = dfrac{1}{sin theta}$ & vspace{2mm} $sec theta = dfrac{1}{cos theta}$ & vspace{2mm} $cot theta = dfrac{1}{tan theta}$ [20pt]
hline
end{tabular}

end{center}
end{table}


end{document}

Correct answer by Venus on December 11, 2020

Here is my suggestion using framed and an array instead of the inner tabular:

enter image description here

documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{framed}
begin{document}

begin{table}[h]
  renewcommand{arraystretch}{2.5}
  setlength{arraycolsep}{25pt}
  begin{framed}
    textbf{Reciprocal identities:}
    [begin{array}{cll} 
      sin theta = dfrac{1}{csc theta} 
        &  cos theta = dfrac{1}{sec theta} 
          &  tan theta = dfrac{1}{cot theta}
      csc theta = dfrac{1}{sin theta} 
        &  sec theta = dfrac{1}{cos theta} 
          & cot theta = dfrac{1}{tan theta} 
    end{array}]
  end{framed}
end{table}


end{document}

Answered by leandriis on December 11, 2020

You simply forgot, adding an empty row, to add a full empty row.

I propose two other solutions, one using cellspace, which ensures a minimal spacing at the top and bottom of cells in columns with specifier prefixed with the letter S (or C if you load siunitx and another entirely different, based on the empheq package, which enables to have boxed multilined equations:

documentclass{article}
usepackage[utf8]{inputenc}
usepackage{empheq}
usepackage{tabularx}
usepackage{graphicx}
usepackage{cellspace}
setlength{cellspacetoplimit}{6pt}
setlength{cellspacebottomlimit}{6pt}

newcommand*widefbox[1]{setlength{fboxsep}{6pt}fbox{quad#1quad}}

begin{document}

begin{table}[h]
centering
begin{tabular}{ |*{2}{>{$}m{3.5cm}<{$}}>{$}m{2.8cm}<{$}| }
hline
multicolumn{3}{|l|}{textbf{Reciprocal identities :}}
vspace{2mm} sin θ= dfrac{1}{csc θ}&vspace{2mm} cos θ= dfrac{1}{sec θ} & vspace{2mm}tan θ= dfrac{1}{cot θ}
vspace{3mm} csc θ= dfrac{1}{sin θ} & vspace{2mm} sec θ= dfrac{1}{cos θ} & vspace{2mm} cot θ= dfrac{1}{tan θ}  & & 
hline
end{tabular}

vskip1cm
begin{tabular}{ |*{2}{>{$}S{m{3.5cm}}<{$}}>{$}S{m{2.8cm}}<{$}|}
hline
multicolumn{3}{|Sl|}{textbf{Reciprocal identities :}}
 sin θ= dfrac{1}{csc θ}& cos θ= dfrac{1}{sec θ} &tan θ= dfrac{1}{cot θ}
csc θ= dfrac{1}{sin θ} & sec θ= dfrac{1}{cos θ} & cot θ= dfrac{1}{tan θ} 
hline
end{tabular}
end{table}

begin{empheq}[box = widefbox]{align*}
 & rlap{textbf{Reciprocal identities :}}
 & sin θ= dfrac{1}{csc θ}& & cos θ= dfrac{1}{sec θ} & &tan θ= dfrac{1}{cot θ}[1.5ex]
 & csc θ= dfrac{1}{sin θ} & & sec θ= dfrac{1}{cos θ} & & cot θ= dfrac{1}{tan θ}
 end{empheq}

 end{document} 

enter image description here

Answered by Bernard on December 11, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP