Generalgraphic inside equation & alignment (achemso)

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
muchalh
Posts: 12
Joined: Fri Aug 14, 2009 4:51 am

graphic inside equation & alignment (achemso)

Post by muchalh »

Hi,

First, short background. I'm just starting in LaTeX world - I was disappointed with M$ Word for too long. I'm chemistry grad student trying to gain enough knowledge about LaTeX to convince my adviser to write scientific manuscripts using LaTeX. He is a pro in M$ Word workarounds and wants his manuscripts in certain way. Before I challenge him, I need to be able to produce better documents than he can.

I'm using achemso package which gives very similar output to what I want (at least for now). The problem I'm trying to solve at the moment is alignment of the graphic inside the equation with the numbering on the right. Basically, the .eps showing chemical reaction is an equation and I want the number on the right to be aligned to the middle of the graphic. Now it's kind of aligned to the bottom border of the graphic. I use the suggested in 'demo' file code and 'nice.eps' graphic:

Code: Select all

\begin{equation}
  \includegraphics{nice}
  \label{eqn:graphic}
\end{equation}
It doesn't have to be a graphic inside the equation. Any type of "labeling" a single reaction on the far right, that could then be cross referenced in the text will do the job. This is what my boss is not able to do with Word and ChemDraw combo.

I'm attaching the the .pdf (modified achemso-demo) that shows what I want to achieve (go to page 4).

Sorry for long first post,

Hubert
Attachments
achemso-demo.pdf
(170.35 KiB) Downloaded 310 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

graphic inside equation & alignment (achemso)

Post by josephwright »

Normally, I'd expect a scheme such as your example to be created as a scheme, using something like:

Code: Select all

\begin{scheme}
  \includegraphics{nice}
  \caption{Some title for a scheme} % Or perhaps just \caption{}
\end{scheme}
The LaTeX equation environment is intended for mathematical equations, and aligns its number with the bottom of the line of "text" (which in your case is the bottom of the graphic). I'll give a bit more thought to a hack to do what you want, but remember that achemso is intended for submissions to the ACS, who re-do all of the layout in any case!
Joseph Wright
muchalh
Posts: 12
Joined: Fri Aug 14, 2009 4:51 am

graphic inside equation & alignment (achemso)

Post by muchalh »

Thanks for your reply. That's the thing about my adviser. He WANTS single reactions to be labeled as 'equations' because sometimes couple of reactions are part of a figure (as on attached example).

I thought about it a little bit more and came to conclusion that I will have more flexibility with default LaTeX report document class in synergy with ACS BibTeX support to write documents that are not necessary intended for publication.

I'm trying to work with 'minipage' environment as in this example i found on the Web:

Code: Select all

\begin{figure}
  \begin{center}
    \begin{minipage}[t]{0.85\linewidth}
    \includegraphics{nice}
    \end{minipage}\hfill
    \begin{minipage}[t]{0.15\linewidth}
      (1)
    \end{minipage}
  \end{center}
\end{figure}
There are two problems with it. First, I need to put 'equation' number manually (I'm sure there is a way to index these numbers). Second, the 'equation' number is aligned to the bottom again. Any thoughts on this?

Thanks,

Hubert
Attachments
reactions in figure.pdf
(52.29 KiB) Downloaded 274 times
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

graphic inside equation & alignment (achemso)

Post by josephwright »

How about

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{equation}
  \begin{minipage}[c]{0.85\linewidth}
    \centering
    \includegraphics{nice}
  \end{minipage}
\end{equation}
\end{document}
This is not class dependent (will work with achemso, article, ...).

By the way, if I were reading what your boss likes, in say a thesis, I'd be asking for it to be changed!
Joseph Wright
muchalh
Posts: 12
Joined: Fri Aug 14, 2009 4:51 am

Re: graphic inside equation & alignment (achemso)

Post by muchalh »

Thank you very much. It works like a charm. I disagree with my boss on many style related issues. I want to believe that he is open-minded enough that when I show him my document written using LaTeX he'll be speechless ;)

Thank you again,

Hubert
Post Reply