2

I'm trying to format an equation, with the definitions in the equations together with an image in my document. If you imagine a box on the page, I'd essentially like the equation on the top left, the equation definitions on the bottom left and the image directly to the right of these two. I'm trying to use minipage to do this but still haven't found the right code. Could anybody suggest a way to do this?

Here is what I've done so far:

\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{amsmath} 
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{subcaption}


\usepackage{cleveref}

\graphicspath{ {Images/} }


\begin{document}


        \begin{minipage}{0.5\textwidth}
            \begin{equation}
                \frac{d[mRNA]}{dt}= k0 + k \cdot TF_{Activator(t - \Delta t)} - \gamma \cdot [mRNA]_t
                \label{DDE}
            \end{equation}
        \end{minipage}

        \begin{minipage}{0.5\textwidth}
            \begin{flushleft}   
            Where:\\
                \tab $[mRNA] = $Concentration of mRNA\\
                \tab$ k0 = $Basal transcription rate \\
                \tab$ k = $Activated transcription rate \\
                \tab$ TF_{Activator} =$ a transcription factor for the gene \\
                \tab$ \gamma = $mRNA degradation rate \\
                \tab$ t = $time \\
                \tab$ \Delta t = $change in time - i.e. time delay
            \end{flushleft}
        \end{minipage}


        \begin{figure}[h]
            \centering
            \begin{minipage}{0.5\textwidth}
                \includegraphics[height=0.4\textwidth]{DDENetwork}
                \label{network1}
            \end{minipage}

        \end{figure}

\end{document}
1
  • Remove the figure environment and put \centering into the minipage. – TeXnician Jun 4 '17 at 12:30
4

You don't want it to float, so don't use a figure. You can still use captions (as \captionof{figure}{}. The rest is just putting it into minipages as you did.

picture

\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{amsmath} 
\usepackage{graphicx}
\usepackage{subcaption}

\def\tab{\quad}

\begin{document}
    \parbox{.45\linewidth}{
            \begin{equation}
                \frac{d[mRNA]}{dt}= k0 + k \cdot TF_{Activator(t - \Delta t)} - \gamma \cdot [mRNA]_t
                \label{DDE}
            \end{equation}\vfill
            \begin{flushleft}   
            Where:\\
                \tab $[mRNA] = $Concentration of mRNA\\
                \tab$ k0 = $Basal transcription rate \\
                \tab$ k = $Activated transcription rate \\
                \tab$ TF_{Activator} =$ a transcription factor for the gene \\
                \tab$ \gamma = $mRNA degradation rate \\
                \tab$ t = $time \\
                \tab$ \Delta t = $change in time - i.e. time delay
            \end{flushleft}
    }\hfill
    \parbox{.45\linewidth}{
            \centering
            \includegraphics[width=\linewidth]{example-image}
%            \captionof{figure}{Test}\label{network1}
    }
\end{document}
1
  • Excellent, once again you've saved me a lot of time. Thanks – CiaranWelsh Jun 4 '17 at 12:37
5

Just one minipage. I also added some improvements: the string “mRNA” should always be in the same style, so I introduced a macro for it.

The explanations are set in math mode, with \text for the textual parts, so as to ensure consistent spacing.

Also TF should be a single entity, so it's better to type it as \mathit.

\documentclass{article}
\usepackage[
  margin=0.5in,
  showframe, % just for the present picture
]{geometry}
\usepackage{amsmath} 
\usepackage{graphicx}

% ensure uniform style for printing 'mRNA'
\newcommand{\mRNA}{\textup{mRNA}}

\begin{document}

\begin{center}
\begin{minipage}{.5\textwidth}
% disable the spacing above and below the math alignment
\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
% align both parts at the left side; with flalign we get to the left margin
\begin{flalign}
&\frac{d[\mRNA]}{dt}= k_0+k\cdot\mathit{TF}_{\mathrm{Activator}}(t-\Delta t)-\gamma\cdot[\mRNA]_t
&&
\label{DDE}
\\
&\begin{aligned}
\makebox[2em][l]{Where:}&\\
  & [\mRNA] = \text{Concentration of \mRNA}\\
  & k_0 = \text{Basal transcription rate} \\
  & k = \text{Activated transcription rate} \\
  & \mathit{TF}_{\mathrm{Activator}} = \text{a transcription factor for the gene} \\
  & \gamma = \text{\mRNA degradation rate} \\
  & t = \text{time} \\
  & \Delta t = \text{change in time -- i.e. time delay}
\end{aligned}
&&\notag
\end{flalign}
\end{minipage}% <--- don't forget
\hfill
\raisebox{-.5\height}{\includegraphics[width=0.4\textwidth]{example-image}}
\end{center}

\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.