1

I'm running into some formatting issues. Currently, my code looks like:

\documentclass[titlepage]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{wrapfig}
\usepackage{booktabs}
\usepackage{color}

% Adjust margins
\addtolength{\oddsidemargin}{-.75in}
\addtolength{\evensidemargin}{-.75in}
\addtolength{\textwidth}{1.5in}
\addtolength{\topmargin}{-.75in}
\addtolength{\textheight}{1.5in}


\begin{document}

\begin{wrapfigure}{L}{.2\textwidth}
    \rule{1cm}{5cm}
\end{wrapfigure}


\quad Figure~\ref{fig:measTool} is a zoomed in version of the measurement toolbar, the other primary toolbar that 
will be used during simulations. Here, instead of picking components like resistors and operational amplifiers, you 
will find primarily measurement tools. 

\begin{table}[h]
    \centering
    \caption{Descriptions of Measurement Toolbar Options} 
    \label{tab:measToolTab}
    \begin{tabular}{clc} \toprule
        Color & Label & Description \\ \midrule 
        \color{red} Red & \color{red} Multimeter & Primarily used to measure DC current, voltage, \\
        & & and resistance. \\ \bottomrule
    \end{tabular}
\end{table}


\end{document}

Which outputs: enter image description here

As can be seen, the table is not centered beneath the text, but is centered with the entire page. I was wondering how to shift the table so that it would be centered with the text?

Wei
  • 41
  • Your code can not be tested. \begin{document} is missing and we don't have the graphic -- replace it by a \rule. – Ulrike Fischer Dec 19 '17 at 10:23
  • Instead of table, use a minipage {\linewidth} and \captionof{table}. You will still have problems getting wrapfig to stop at the right spot. See the \wrapspacer macro from https://tex.stackexchange.com/questions/354522/wrapfigure-with-caption-and-floatfoot-problem/354571?s=2|9.3076#354571 – John Kormylo Dec 19 '17 at 14:16
  • @UlrikeFischer I've updated the code with a \begin{document}, but what exactly is a \rule? – Wei Dec 21 '17 at 00:39
  • 2
    \rule{1cm}{5cm} will create a black rectangle that is 1cm wide and 5cm high, can be used as a stand-in for the image. Alternatively, use \includegraphics[width=1cm,height=5cm]{example-image}, adjusting the dimensions to correspond to your image. (example-image is an image file included with a package called mwe, that is included in TeX Live and MikTeX, so most people have it.) – Torbjørn T. Dec 21 '17 at 00:51
  • 1
    The \rule (or more precisely, \rule{"width"}{"height"}) is a rectangle with dimensions as inside the bracers – Cragfelt Dec 21 '17 at 00:51

1 Answers1

1

Do you want something like the following?

figure by table with text

This is just done with minipages. I also substituted geometry, which is better than setting page dimensions manually, but you should adjust to your desiderata.

\documentclass[titlepage]{article}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{xcolor}
\usepackage[verbose]{geometry}
\geometry{margin=0.75in}

\begin{document}

\noindent
\begin{minipage}{.2\textwidth}
    \centering
    \rule{1cm}{5cm}

    \captionof{figure}{My rule}\label{fig:measTool}
\end{minipage}%
\begin{minipage}{.8\textwidth}

  \quad Figure~\ref{fig:measTool} is a zoomed in version of the measurement toolbar, the other primary toolbar that will be used during simulations. 
  Here, instead of picking components like resistors and operational amplifiers, you will find primarily measurement tools. 

  \begin{center}
    \captionof{table}{Descriptions of Measurement Toolbar Options} 
    \label{tab:measToolTab}
    \begin{tabular}{clc} \toprule
      Color & Label & Description \\ \midrule 
      \color{red} Red & \color{red} Multimeter & Primarily used to measure DC current, voltage, \\
      & & and resistance. \\ \bottomrule
    \end{tabular}
  \end{center}
\end{minipage}

\end{document}
cfr
  • 198,882
  • This works pretty great! I'm still running into a slight issue though. The MWE has a rule of 5 cm height, but when I increase the height (say to like, 20 cm), the text ends up being centered with the rule, instead of starting at the top of the page. Is there a way around that? – Wei Dec 21 '17 at 04:19
  • 2
    @Wei Try changing the first minipage to \begin{minipage}[t][][b]{.2\textwidth}, and the second to \begin{minipage}[t]{.8\textwidth}. – Torbjørn T. Dec 21 '17 at 10:00
  • 1
    @Wei See Torbjørn T.'s comment above. You can adjust the alignment of the minipages individually, relative to the baseline, to get the effect you prefer. The default is c for vertically centred, which is what you're seeing. So you just need to specify the non-default values you need. – cfr Dec 21 '17 at 16:45