Graphics, Figures & TablesScale chemfig figure

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Scale chemfig figure

Post by MatthiasN »

Hi everyone,

In chemfig there is a possibility to scale your figure by one of the optional arguments:

Code: Select all

\chemfig[][scale=x]{figure code}
However, when I apply this on a figure of DDT I made, the circles inside of the benzene rings do not rescale (figure attached). I used the following code:

Code: Select all

\documentclass{article}
\usepackage{chemfig}

\begin{document}
\chemfig[][scale=.7]{**6((-Cl)---(-([2]-([:45]-Cl)([:135]-Cl)-Cl)-[:-30]**6(---(-Cl)---))---)}
\end{document}
Thus, my question is: How do I scale my chemfig figure as a whole so that it still looks representable.

Thanks for reading,
Matthias
Attachments
DDT.pdf
(10.88 KiB) Downloaded 667 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Scale chemfig figure

Post by cgnieder »

Hi,

here are a few methods that differently scale the molecule. Maybe there is one option you like:

Code: Select all

\documentclass{article}
\usepackage{chemfig}

\begin{document}

% IMHO: bonds to long
\chemfig{**6((-Cl)---(-([2]-([:45]-Cl)([:135]-Cl)-Cl)-[:-30]**6(---(-Cl)---))---)}

\begingroup
% IMHO: atoms to small with respect to the bond length
\footnotesize
\chemfig{**6((-Cl)---(-([2]-([:45]-Cl)([:135]-Cl)-Cl)-[:-30]**6(---(-Cl)---))---)}
\endgroup

% IMHO: better vaule for the bond length
\begingroup
\setatomsep{1.8em}
\chemfig{**6((-Cl)---(-([2]-([:45]-Cl)([:135]-Cl)-Cl)-[:-30]**6(---(-Cl)---))---)}
\endgroup

% for this molecule: use the optional argument of the ring for scaling:
\chemfig{**6([,.7](-Cl)---(-([2]-([:45]-Cl)([:135]-Cl)-Cl)-[:-30]**6(---(-Cl)---))---)}

\end{document}
chemfig.png
chemfig.png (17.09 KiB) Viewed 14291 times
Regards
site moderator & package author
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Re: Scale chemfig figure

Post by MatthiasN »

Thanks, that works.
dexteritas
Posts: 2
Joined: Fri Sep 02, 2022 4:59 pm

Scale chemfig figure

Post by dexteritas »

In the current version of chemfig the following command is undefined:

Code: Select all

\setatomsep{1.8em}
Instead, you can use:

Code: Select all

\chemfig[atom sep=1.8em]{<molecule code>}
or to set it globally:

Code: Select all

\setchemfig{atom sep=1.8em}
Post Reply