2

I am able to create basic tables, but never really gotten in depth with them. I am trying to recreate the table (see pic). I am unable to do so. I think I need to use multicol or row. Here is my doc:

\documentclass[11pt,letterpaper]{article}
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier}
\usepackage{caption}
\usepackage[dvipsnames]{xcolor}
\usepackage[utf8]{inputenc}
\let\circledS\undefined
\usepackage{tabularx,booktabs}

\usepackage[top=1cm, bottom=4.5cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage{amsmath,amsthm,amsfonts,amssymb,amscd}
\usepackage{multicol,fancyhdr,fullpage,setspace,parskip,float}


% HEADER AND FOOTER
\newcommand\course{AP Calculus BC}
\pagestyle{fancy}
\headheight 35pt
\lhead{\textbf{Skill Builder: Topics 2.1-2.3 -  The Definition of the Derivative}}
\chead{\textbf{}}
\rhead{\course \\ \today}
\lfoot{Mr. Bennett}
\cfoot{Flint Hill Upper School}
\rfoot{\small\thepage}
\headsep 1.5em


\begin{document}

Compute the derivative function \(f^\prime\left(x\right)\), using the definition of derivative for each of the following.  \textbf{\underline{Use proper notation}}.\\

     \begin{tabular}{|p{0.7\textwidth}|p{0.3\textwidth}|}
        \hline
            1.  \(f(x)=-2x^2+1\)    & 2. \(f(x)=3\) \\[2in] \hline
            3.  \(f\left(x\right)=\dfrac{2}{x+1}\) & \\[2in] \hline


     
     \end{tabular}

\end{document}

enter image description here

3 Answers 3

1

I FOUND IT!!!!!!!

Well I am not sure this is the "best way"

 \begin{tabular}{|p{0.7\textwidth}|p{0.3\textwidth}|}
    \hline
        1.  \(f(x)=-2x^2+1\)    & 2. \(f(x)=3\) \\[2in] \hline
            
             \multicolumn{2}{|l|}{\(f\left(x\right)=\dfrac{2}{x+1}\)} \\[2in] \hline
    


 \end{tabular}
1
  • Your table is wider than width of text area on page. It protrude out of the its right border.
    – Zarko
    Commented Aug 31, 2023 at 14:11
0

I'd use array features.

\documentclass{article}
\usepackage{amsmath}
\usepackage{array}

\newcommand{\prespace}[1]{\vadjust pre{\vspace{#1}}}
\newcolumntype{P}[2]{%
  p{\dimeval{#1\textwidth-2\tabcolsep-#2\arrayrulewidth}}<{\prespace{-2pt}}%
}

\begin{document}

\noindent X\dotfill X% to see the margins

\begin{center}

\begin{tabular}{|P{0.7}{1.5}|P{0.3}{1.5}|}
\hline
1.  \(f(x)=-2x^2+1\)    & 2. \(f(x)=3\) \\[2in] \hline
\multicolumn{2}{|P{1}{2}|}{\(f(x)=\dfrac{2}{x+1}\)} \\[2in]
\hline
\end{tabular}

\end{center}

\end{document}

Note that this produces a table exactly as wide as the text block.

The \prespace trick moves the formulas a little down.

enter image description here

2
  • For some reason, your code does not run
    – Nick B
    Commented Aug 31, 2023 at 19:04
  • @NickB Works for me. What error do you get?
    – egreg
    Commented Aug 31, 2023 at 20:26
0

I suggest to use tblr of tabularray table. With employing it the table code become simple:

\documentclass[11pt,letterpaper]{article}
\usepackage[hmargin=25mm, vmargin={1cm,4.5cm}]{geometry}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%
\usepackage{lipsum}                             % for dummy text
%---------------------------------------------------------------%

\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier}

\usepackage{tabularray}
\UseTblrLibrary{amsmath, booktabs}


\begin{document}

Compute the derivative function \(f'(x)\), using the definition of derivative for each of the following.  \textbf{\underline{Use proper notation}}.\\

\noindent\begin{tblr}{hlines, vlines,
                  colspec = {X[0.6, l, h, mode=math] X[0.4, l, h, mode=math]},
                  hspan   = minimal,
                  rows    = {32mm},
                  rowsep  = 5pt
                  }
1.\ f(x) = -2x^2+1         &  2.\ f(x)=3  \\
\SetCell[c=2]{}
3.\ f(x) = \dfrac{2}{x+1} &               \\
    \end{tblr}
\end{document}

enter image description here

(red lines indicate text area borders)

2
  • Hi @zarko, your code still has text past the table when I run it. No idea why
    – Nick B
    Commented Aug 31, 2023 at 19:07
  • @NickB sorry, I don't understand you. What is the problem? My MWE works. If you like to have higher cell, increase its height defined in rows = {33mm} for example with rows = {2in}, if you like to have bigger distance between (task?) numbers in cells and math terms, instead of \ insert for example \quad . Please elaborate your comment!
    – Zarko
    Commented Aug 31, 2023 at 20:06

You must log in to answer this question.

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