Align Molecules in chemfig - latex

I want to align the reaction equation to the black line shown in the picture.
\documentclass[11pt,a4paper,oneside]{scrartcl}
\usepackage{chemfig}
\begin{document}
\begin{figure}
\begin{center}
\schemestart
\chemfig{*6(-=(*6(-(=O)-NH-NH-(=O)-))-=(-NH_2)-=)}\qquad
\+
\chemfig{H_2O_2}\qquad
\arrow(.mid east--.mid west){-U>[][$\mathrm{N_2}$]}\qquad
\chemfig{*6(-=(-COO^{-})-(-COO^{-})=(-NH_2)-=)}\qquad
\+
Licht
\schemestop
\end{center}
\caption{Reaktion von Luminol zu 3-Aminophtalatdianion}
\end{figure}
\end{document}

A bit hacky, but you could do
\documentclass[11pt,a4paper,oneside]{scrartcl}
\usepackage{chemfig}
\begin{document}
\begin{figure}[htbp]
\centering
\setchemfig{+ vshift=0.5cm}
\schemestart
\chemfig{*6(-=(*6(-(=O)-NH-NH-(=O)-))-=(-NH_2)-=)}\qquad
\+
\raisebox{0.5cm}{\chemfig{H_2O_2}}\qquad
\arrow(.north east--.north west){-U>[][$\mathrm{N_2}$][-2.4cm]}\qquad
\chemfig{*6(-=(-COO^{-})-(-COO^{-})=(-NH_2)-=)}\qquad
\+
\raisebox{0.5cm}{Licht}
\schemestop
\caption{Reaktion von Luminol zu 3-Aminophtalatdianion}
\end{figure}
\end{document}

Another possibility, using only commands from the "chemfig" package, where I used two "invisible arrows" to adjust the position of the "+"
\documentclass[11pt,a4paper,oneside]{scrartcl}
\usepackage{chemfig}
\begin{document}
\begin{figure}[htbp]
\centering
\schemestart
\chemfig{*6(-=(*6(-(=O)-NH-NH-(=O)-))-=(-NH_2)-=)}
\arrow{0}[,.1]\+
\chemfig{H_2O_2}
\arrow{-U>[][\chemfig{N_2}]}
\chemfig{*6(-=(-COO^{-})-(-COO^{-})=(-NH_2)-=)}
\arrow(.east--.west){0}[,.1]\+ Licht
\schemestop
\caption{Reaktion von Luminol zu 3-Aminophtalatdianion}
\end{figure}
\end{document}
Since the first molecule has branches above and below the rings, and the reaction product has branches just above, and knowing that the "chemfig" aligns the molecules by their "center of mass", a simple way to adjust the position of the resulting molecule of the reaction is by placing an "invisible bond" (-[6,,,,draw=none) at the bottom of this molecule.
\documentclass[11pt,a4paper,oneside]{scrartcl}
\usepackage{chemfig}
\begin{document}
\begin{figure}[htbp]
\centering
\schemestart
\chemfig{*6(-=(*6(-(=O)-NH-NH-(=O)-))-=(-NH_2)-=)}
\arrow{0}[,.1]\+
\chemfig{H_2O_2}
\arrow{-U>[][\chemfig{N_2}]}
\chemfig{*6(-(-[6,,,,,draw=none])=(-COO^{-})-(-COO^{-})=(-NH_2)-=)}
\arrow(.east--.west){0}[,.1]\+ Licht
\schemestop
\caption{Reaktion von Luminol zu 3-Aminophtalatdianion}
\end{figure}
\end{document}

Related

Latex: how to align subcaptions on the top left and caption to the right of the figures

I am using LaTeX to write a report and I'm going crazy to get a result like
with subcaptions (a), (b), (c) align to the top left of the subfigures and caption on the right of the figure.
I've already tried with floatrow and subcaption, but I've never obtained the result I want.
MWE:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{floatrow}
\usepackage{subfig}
\floatsetup[figure]{style=plain,subcapbesideposition=top}
\begin{figure*}
\ffigbox[\FBwidth]
{\begin{subfloatrow}
\sidesubfloat[]{\includegraphics[width=.5\linewidth]{image1}\label{fig:a}}%
\sidesubfloat[]{\includegraphics[width=.5\linewidth]{image2}\label{fig:b}}%
\end{subfloatrow}}
{\caption{Two figures}\label{}}
\end{figure*}
\end{document}
Here some starting point with the subcaption package (the exact dimensions might need some tweaking to nicely align with the surrounding text)
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\captionsetup[subfigure]{font={bf,small}, skip=1pt, margin=-0.7cm, singlelinecheck=false}
\begin{document}
\begin{figure*}
\hfill
\begin{minipage}[b]{.63\textwidth}
\begin{subfigure}{\textwidth}
\subcaption{}
\includegraphics[width=\linewidth]{example-image-duck}
\end{subfigure}\par
\begin{subfigure}{\textwidth}
\subcaption{}
\includegraphics[width=\linewidth]{example-image-duck}
\end{subfigure}
\end{minipage}
\quad
\begin{minipage}[b]{.3\textwidth}
\caption{some caption with aligns at the bottom}\label{key}
\end{minipage}
\end{figure*}
\end{document}

LateX Beamer : Putting a tikzpicture next to a picture

I'd like to put tikzpicture next to a picture on a beamer but right now the tikzpicture is way below the slide ! Here is my code :
\begin{frame}{Frame name}
\begin{columns}[t]
\column{.5\textwidth}
\centering
\begin{tikzpicture}{Tikzpicture name}
%my tikzpicture here
\end{tikzpicture}
\column{.5\textwidth}
\centering
\includegraphics[width=100px, height=200 px]{PICTURE.jpg}
\end{columns}
\end{frame}
You can use T as alignment option for the columns to make sure the very top of the columns is aligned instead of the baseline of the first lines.
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\frametitle{Frame name}
\begin{columns}[T]
\begin{column}{.5\textwidth}
\centering
\begin{tikzpicture}{Tikzpicture name}
\draw (0,0) circle [radius=1cm];
\end{tikzpicture}
\end{column}
\begin{column}{.5\textwidth}
\centering
\includegraphics[width=100px, height=200 px]{example-image-duck}
\end{column}
\end{columns}
\end{frame}
\end{document}

avoiding transparent caption in beamer/latex

I am trying to insert a figure but its caption is transparent in the current page. how to prevent this? many thanks in advance.
\documentclass{beamer}
\usetheme{Ilmenau}
\setbeamercovered{transparent}
\setbeamercolor*{item}{fg=blue}
\usepackage{caption}
\captionsetup{font=scriptsize,labelfont=scriptsize}
\usepackage{hyperref}
\hypersetup{urlcolor=blue}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\title{DNA - Computing}
\author{Aleyna Acikyol \& Alina Grahic
}
\begin{document}
\begin{frame}[plain]
\maketitle
\end{frame}
%5 FOTO
\begin{frame}{Probleme heutiger Computer (3)}
%\begin{enumerate}
% \item \textcolor{blue}{Transistoren:}
\begin{itemize}
\item \textcolor{blue}{Transistoren:}
\begin{itemize}
\item kleiner geht nicht
\item Ausgleich mit Multicores /Multiprozessorsysteme
\end{itemize}
\end{itemize}
\pause
\begin{figure}
%\begin{itemize}
\begin{columns}
\column{0.50\linewidth}
\centering
\includegraphics[height=3cm, width=3cm]{./5.jpg}\caption{diverse Datenträger im Privatgebrauch}
\column{0.50\linewidth}
\centering
\includegraphics[height=3cm, width=3cm]{./5.2.jpg}\caption{Data Centre, Cloud}
\end{columns}
%\end{itemize}
\end{figure}
%\end{enumerate}
\end{frame}
\end{document}
It looks like
The caption is transparent because you are using \setbeamercovered{transparent}. You have two options to avoid the transparent caption:
immediately show the images and caption by avoid the \pause in front of them
switching to \setbeamercovered{invisible} either temporarily or for the whole presentation to delay the images and caption to the next overlay:
\documentclass{beamer}
\usetheme{Ilmenau}
\setbeamercovered{transparent}
\setbeamercolor*{item}{fg=blue}
\setbeamerfont{caption}{size=\scriptsize}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\title{DNA - Computing}
\author{Aleyna Acikyol \& Alina Grahic
}
\begin{document}
\begin{frame}[plain]
\maketitle
\end{frame}
%5 FOTO
\begin{frame}
\frametitle{Probleme heutiger Computer (3)}
%\begin{enumerate}
% \item \textcolor{blue}{Transistoren:}
\begin{itemize}
\item \textcolor{blue}{Transistoren:}
\begin{itemize}
\item kleiner geht nicht
\item Ausgleich mit Multicores /Multiprozessorsysteme
\end{itemize}
\end{itemize}
{
\setbeamercovered{invisible}
\pause
\begin{figure}
%\begin{itemize}
\begin{columns}
\column{0.50\linewidth}
\centering
\includegraphics[height=3cm, width=3cm]{example-image-duck}\caption{diverse Datenträger im Privatgebrauch}
\column{0.50\linewidth}
\centering
\includegraphics[height=3cm, width=3cm]{example-image-duck}\caption{Data Centre, Cloud}
\end{columns}
%\end{itemize}
\end{figure}
%\end{enumerate}
}
\end{frame}
\end{document}
Some other comments:
you don't need \usepackage{hyperref}, beamer already loads it
I'd be wary to use \hypersetup{urlcolor=blue} with beamer, this can lead to strange alternations to the carefully constructed colour themes of beamer in places one would never expect
If your tex distribution was updated within the last 5 years or so, you don't need \usepackage[utf8]{inputenc}, that's now the default
If you just want to change the font size of the caption, you don't actually need the caption package, beamer has its own mechanism to control the size of captions
Instead of \begin{frame}{...} I would use \frametitle{...}. That's much more flexible and powerful
If you specify both the width and height of your images, they will end up distorted. Please consider adding the keepaspectratio option to avoid this
to avoid manually repeating the same frame title several times ("Probleme heutiger Computer (3)") you could use overlays and add the slide in frame counter to the frametitle

LaTex - Extra space between words of footnotes in figure environment

there is extra space between the words of the footnotes in the figure below. How can I fix this issue?
\documentclass[jou]{apa7}
\begin{document}
\begin{figure*}
\centering
\caption{Title}
\vspace{0.3cm}
\includegraphics[width=\textwidth]{example.png}
\vspace{4pt}
\begin{tablenotes}[para,flushleft]
{\small \textit{Note.} Figure notes here }
\end{tablenotes}
\end{figure*}
\end{document}
Your table note tries to fill the whole line. To avoid the extra space you can add \hfill at the end to fill the line.
\documentclass[jou]{apa7}
\shorttitle{subtitle}
\begin{document}
\begin{figure*}
\centering
\caption{Title}
\vspace{0.3cm}
\includegraphics[width=\textwidth]{example-image-duck}
\vspace{4pt}
\begin{tablenotes}[para,flushleft]
{\small \textit{Note.} Figure notes here\hfill }
\end{tablenotes}
\end{figure*}
\end{document}

How to remove automatic numbering of figure in LaTex?

I would like the caption of my figure to be "Figure A". Is there a way to remove the automatic numbering of the figures?
\documentclass[jou]{apa7}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\renewcommand{\figurename}{Figure A}
\centering
\caption{Title}
\includegraphics[width=0.5\textwidth]{test.png}
\end{figure}
\end{document}
With the code above, the caption is "Figure A 1".
Thank you in advance!
Two quick hacks, either you can temporarily remove the number or you can latex do the numbering with capital letters:
\documentclass[jou]{apa7}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\renewcommand{\figurename}{Figure A}
\renewcommand{\thefigure}{}
\centering
\caption{Title}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\end{figure}
\begin{figure}
\renewcommand{\thefigure}{\Alph{figure}}
\centering
\caption{Title}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\end{figure}
\end{document}

Resources