3

I'm making a table, but I cannot seem to get the plus/minus symbol appear within the table. It merely says \pm where I want the actual symbol to be.

I'm not sure what to do - I'd appreciate any help.

\documentclass[twoside]{article}

\usepackage{lipsum} % Package to generate dummy text throughout this template


\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\linespread{1.05} % Line spacing - Palatino needs more space between lines
\usepackage{microtype} % Slightly tweak font spacing for aesthetics

\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} % Document margins
\usepackage{multicol} % Used for the two-column layout of the document
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats in tables or figures
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{float} % Required for tables and figures in the multi-column environment - they need to be placed in specific locations with the [H] (e.g. \begin{table}[H])
\usepackage{hyperref} % For hyperlinks in the PDF

\usepackage{lettrine} % The lettrine is the first enlarged letter at the beginning of the text
\usepackage{paralist} % Used for the compactitem environment which makes bullet points with less space between them
\usepackage{esvect}

\usepackage{abstract} % Allows abstract customization
\renewcommand{\abstractnamefont}{\normalfont\bfseries} % Set the "Abstract" text to bold
\renewcommand{\abstracttextfont}{\normalfont\small\itshape} % Set the abstract itself to small italic text

\usepackage{titlesec} % Allows customization of titles
\renewcommand\thesection{\Roman{section}} % Roman numerals for the sections
\renewcommand\thesubsection{\Roman{subsection}} % Roman numerals for subsections
\titleformat{\section}[block]{\large\scshape\centering}{\thesection.}{1em}{} % Change the look of the section titles
\titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{} % Change the look of the section titles

\usepackage{fancyhdr} % Headers and footers
\pagestyle{fancy} % All pages have headers and footers
\fancyhead{} % Blank out the default header
\fancyfoot{} % Blank out the default footer
\fancyhead[C]{CH 341: Biochemistry I $\bullet$ November 2015 $\bullet$ Vol. XXI, No. 1} % Custom header text
\fancyfoot[RO,LE]{\thepage} % Custom footer text
\usepackage{tabularx}
\usepackage{pgfplots}
\usepackage{caption}
\usepackage{graphicx} %allows importing images
\usepackage{float} % allows to control the float positions
\usepackage{mhchem}
\usepackage{textgreek}
\usepackage{siunitx}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{grffile}
\usepackage[export]{adjustbox}
\usepackage{placeins}




\begin{document}   
    \begin{table}
    \small\caption{Product Concentrations and Enzyme Reaction Velocities for the 5 Substrate Concentrations in Varying Inhibitor Environments}
    \begin{center}
    \footnotesize
    \newcommand{\head}[1]{\textnormal{\textbf{#1}}}
    \begin{tabular}{ccc}
      \toprule[1.5pt]
      \head{Metal} & \head{Average Velocity  SD} & \head{Average Product Concentration Formed  SD}\\
      \midrule
      \verb|Magnesium| & \verb|1.30 \pm 0.67| & \verb|25.97 \pm 13.33|\\
      \verb|Zinc| & \verb|0.40 \pm 0.049| & \verb|8.06 \pm 0.97|\\
      \bottomrule[1.5pt]
    \end{tabular}
    \end{center}
    \end{table}

\end{document}
  • 1
    You are using \verb, that won't work with \pm – user31729 Dec 6 '15 at 16:31
  • 1
    Can you explain the usage of \verb? – egreg Dec 6 '15 at 16:43
  • 2
    The usual way to say thank you is upvoting and accepting one of the answers here ;-) – user31729 Dec 9 '15 at 16:52
  • Yes, sorry, it's been a hellish week! – ragzoxaim Dec 9 '15 at 16:55
  • Sorry for being rude guys- thanks for the help. I've up voted the answers. – ragzoxaim Dec 9 '15 at 17:33
2

Since the header row of the tabular environment doesn't used "typewriter" (aka monospaced) letters, I wouldn't use typewriter-style letters in the body of the tabular either. Removing the \verb directives and encasing the numbers, as needed, in $ math initiators/terminators would seem to be the way to go. Use \phantom directives, as needed, to fine-tune the vertical alignment of the numbers before and after the \pm symbol.

I would also remove the \small and especially the \footnotesize directives as the material fits inside the text block.

In the example below, I've disabled the loading of all packages that appear to have no bearing on the example at hand.

Aside: the instruction

\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption}

seems to be contradictory, as the font shape for the text portion of the caption is supposed to be both up[shape] and it[alics]. At any rate, the second option for labelfont and textfont is ignored in both cases. It would be better to write the instruction as

\usepackage[hang, labelfont=bf,textfont=it]{caption}

enter image description here

\documentclass[twoside]{article}

    \usepackage[T1]{fontenc}
%    \linespread{1.05} % Line spacing - Palatino needs more space between lines
    \usepackage{microtype}

    \usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} 
%    \usepackage{multicol} % Used for the two-column layout of the document
    \usepackage[hang, labelfont=bf, textfont=it]{caption} % Custom captions under/above floats in tables or figures
    \usepackage{booktabs} % Horizontal rules in tables
%    \usepackage{float} % Required for tables and figures in the multi-column environment - they need to be placed in specific locations with the [H] (e.g. \begin{table}[H])

%    \usepackage{lettrine} % The lettrine is the first enlarged letter at the beginning of the text
%    \usepackage{paralist} % Used for the compactitem environment which makes bullet points with less space between them
%    \usepackage{esvect}

%    \usepackage{abstract} % Allows abstract customization
%    \renewcommand{\abstractnamefont}{\normalfont\bfseries} % Set the "Abstract" text to bold
%    \renewcommand{\abstracttextfont}{\normalfont\small\itshape} % Set the abstract itself to small italic text
%
%    \usepackage{titlesec} % Allows customization of titles
%    \renewcommand\thesection{\Roman{section}} % Roman numerals for the sections
%    \renewcommand\thesubsection{\Roman{subsection}} % Roman numerals for subsections
%    \titleformat{\section}[block]{\large\scshape\centering}{\thesection.}{1em}{} % Change the look of the section titles
%    \titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{} % Change the look of the section titles

    \usepackage{fancyhdr} % Headers and footers
    \pagestyle{fancy} % All pages have headers and footers
    \fancyhead{} % Blank out the default header
    \fancyfoot{} % Blank out the default footer
    \fancyhead[C]{CH 341: Biochemistry I $\bullet$ November 2015 $\bullet$ Vol. XXI, No. 1} % Custom header text
    \fancyfoot[RO,LE]{\thepage} % Custom footer text

%    \usepackage{tabularx}
%    \usepackage{pgfplots}
%    \usepackage{caption}
%    \usepackage{graphicx} %allows importing images
%    \usepackage{float} % allows to control the float positions
%    \usepackage{mhchem}
%    \usepackage{textgreek}
%    \usepackage{siunitx}
%    \usepackage{textcomp}
%    \usepackage{multirow}
%    \usepackage{grffile}
%    \usepackage[export]{adjustbox}
%    \usepackage{placeins}

    % It's usually a good idea to load 'hyperref' last
    \usepackage{hyperref} % For hyperlinks in the PDF

    \newcommand{\head}[1]{\textnormal{\textbf{#1}}}

\begin{document}   
\begin{table}
\caption{Product Concentrations and Enzyme Reaction Velocities for the 5 Substrate Concentrations in Varying Inhibitor Environments}
\centering
\begin{tabular}{lcc}
\toprule[1.5pt]
\head{Metal} & \head{Average Velocity  SD} 
             & \head{Average Product Concentration Formed SD}\\
\midrule
Magnesium & $1.30 \pm 0.67\phantom{0}$ & $25.97 \pm 13.33$\\
Zinc      & $0.40 \pm 0.049$ & $\phantom{0}8.06 \pm \phantom{0}0.97$\\
\bottomrule[1.5pt]
\end{tabular}
\end{table}

\end{document}
5

Why the O.P. uses \verb|...|? → I don't know, perhaps to get \texttt (typewriter font)?

However, the \verb command buts everything in verbatim mode, so \pm is not interpreted (expanded) but displayed literally.

In order to get the monospaced letters use \texttt{...} for example.

\documentclass[twoside]{article}

\usepackage{lipsum} % Package to generate dummy text throughout this template


\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\linespread{1.05} % Line spacing - Palatino needs more space between lines
\usepackage{microtype} % Slightly tweak font spacing for aesthetics

\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} % Document margins
\usepackage{multicol} % Used for the two-column layout of the document
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats in tables or figures
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{float} % Required for tables and figures in the multi-column environment - they need to be placed in specific locations with the [H] (e.g. \begin{table}[H])
\usepackage{hyperref} % For hyperlinks in the PDF

\usepackage{lettrine} % The lettrine is the first enlarged letter at the beginning of the text
\usepackage{paralist} % Used for the compactitem environment which makes bullet points with less space between them
\usepackage{esvect}

\usepackage{abstract} % Allows abstract customization
\renewcommand{\abstractnamefont}{\normalfont\bfseries} % Set the "Abstract" text to bold
\renewcommand{\abstracttextfont}{\normalfont\small\itshape} % Set the abstract itself to small italic text

\usepackage{titlesec} % Allows customization of titles
\renewcommand\thesection{\Roman{section}} % Roman numerals for the sections
\renewcommand\thesubsection{\Roman{subsection}} % Roman numerals for subsections
\titleformat{\section}[block]{\large\scshape\centering}{\thesection.}{1em}{} % Change the look of the section titles
\titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{} % Change the look of the section titles

\usepackage{fancyhdr} % Headers and footers
\pagestyle{fancy} % All pages have headers and footers
\fancyhead{} % Blank out the default header
\fancyfoot{} % Blank out the default footer
\fancyhead[C]{CH 341: Biochemistry I $\bullet$ November 2015 $\bullet$ Vol. XXI, No. 1} % Custom header text
\fancyfoot[RO,LE]{\thepage} % Custom footer text
\usepackage{tabularx}
\usepackage{pgfplots}
\usepackage{caption}
\usepackage{graphicx} %allows importing images
\usepackage{float} % allows to control the float positions
\usepackage{mhchem}
\usepackage{textgreek}
\usepackage{siunitx}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{grffile}
\usepackage[export]{adjustbox}
\usepackage{placeins}


\begin{document}   
\begin{table}
\small\caption{Product Concentrations and Enzyme Reaction Velocities for the 5 Substrate Concentrations in Varying Inhibitor Environments}
\begin{center}
\footnotesize
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\begin{tabular}{ccc}
  \toprule[1.5pt]
  \head{Metal} & \head{Average Velocity  SD} & \head{Average Product Concentration Formed  SD}\\
  \midrule
  \texttt{Magnesium} & \texttt{1.30} $\pm$ \texttt{0.67} & \texttt{25.97} $\pm$ \texttt{13.33}\\
  %      \verb|Zinc| & \verb|0.40 \pm 0.049| & \verb|8.06 \pm 0.97|\\
  \bottomrule[1.5pt]
\end{tabular}
\end{center}
\end{table}

\end{document}
3

The usage of \verb is unclear; no formal table I know uses it.

In the following example I use siunitx, besides booktabs; the long header has been split across two lines in order to limit the table width.

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

\sisetup{separate-uncertainty}

\begin{document}   

\begin{table}
\centering

\caption{Product Concentrations and Enzyme Reaction Velocities for the 5
  Substrate Concentrations in Varying Inhibitor Environments}

\footnotesize
\newcommand{\head}[1]{{%
  \normalfont\bfseries
  \begin{tabular}{@{}c@{}}
  #1
  \end{tabular}%
}}

\begin{tabular}{
  l
  S[table-format=1.3(4)]
  S[table-format=2.2(4)]
}
\toprule
\head{Metal} & \head{Average Velocity SD} & \head{Average Product \\ Concentration Formed  SD}\\
\midrule
Magnesium & 1.30 \pm 0.67  & 25.97 \pm 13.33 \\
Zinc      & 0.40 \pm 0.049 &  8.06 \pm 0.97 \\
\bottomrule
\end{tabular}

\end{table}

\end{document}

enter image description here

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.