Math & ScienceGreek Character in chemical Structure

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
huberte
Posts: 5
Joined: Sun Apr 07, 2013 4:35 am

Greek Character in chemical Structure

Post by huberte »

Hi,

In the documentation I read that I can draw Greek letters in chemfig like this.

Code: Select all

\scriptstyle\color{red}\delta+)
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
It's OK outside \chemfig, inside I get "ffi +" instead of the Greek letter delta. Why?

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Greek Character in chemical Structure

Post by Johannes_B »

Would you consider preaparing a self-contained and minimal Working Example. This helps us to directly test the code you provided and ensures we all see the same output by clinking on "Open in writeLaTeX". But this feature is only available if you put your code using the code button.

A MWE in your case is as simple as this, showing you the Greek letter delta. So your problem seems to be somewhere else.

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig{\delta} % this would be enough
\chemfig{\scriptstyle\color{red}\delta+}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
huberte
Posts: 5
Joined: Sun Apr 07, 2013 4:35 am

Greek Character in chemical Structure

Post by huberte »

Sorry Johannes, and many thanks for your quick answer.

Here's my code, it seems that mathpazo causes the issue (use this because I like/need Palatino :!)

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{chemfig}
\usepackage{mathpazo}
\begin{document}
\chemfig{\delta} % this would be enough
\chemfig{\scriptstyle\color{red}\delta+}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Greek Character in chemical Structure

Post by Johannes_B »

mathpazo actually loads URW palladio (as far as I know, it does not include a greek text font), an extended version of this font is TeX Gyre Pagella.

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{tgpagella}
%\usepackage{mathpazo}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{chemfig}
\begin{document}
\chemfig{\delta} % this would be enough
\chemfig{\scriptstyle\color{red}\delta+}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
huberte
Posts: 5
Joined: Sun Apr 07, 2013 4:35 am

Greek Character in chemical Structure

Post by huberte »

Johannes_B wrote:mathpazo actually loads URW palladio (as far as I know, it does not include a greek text font), an extended version of this font is TeX Gyre Pagella.
Sure it works, but not with chemfig ! , here :

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{mathpazo}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{chemfig}
\begin{document}
\chemfig{\delta} % this would be enough
\chemfig{\scriptstyle\color{red}\delta+}
$$\stackrel{\delta^+}{H}-\stackrel{\delta^-}{Cl}$$
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
thanks it works with tgpagella, but the team do not like the font so much comparing to mathpazo...

Is there any other workaround ?
unbonpetit

Greek Character in chemical Structure

Post by unbonpetit »

huberte wrote:It's OK outside \chemfig, inside I get "ffi +" instead of the Greek letter delta. Why?
Je vais parler français puisque je parle à une française, tant pis pour les modos (Clemens, à l'affut de questions sur chemfig notamment) qui vont peut être pas trop apprécier cette démarche sur ce forum anglophone.

Ici, ça ne fonctionne pas parce que chemfig utilise \mathrm pour tout ce qui est affiché et que la fonte correpondante ne dispose pas de ce glyphe. Essaie $\mathrm{\delta}$ pour te rendre compte du problème.

Il y a plusieurs façons de s'en sortir, en voici une qui redéfinit \delta pour qu'il soit toujours affiché en fonte normale (c'est un peu crade comme méthode mais tant pis). Dernière remarque, tu peux demander directement à l'auteur de chemfig (c-a-d moi) par email plutôt que sur des fora.

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{mathpazo}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\let\deltasaved\delta
\def\delta{\mathnormal\deltasaved}
\usepackage{chemfig}
\begin{document}
\chemfig{\delta}\qquad
\chemfig{\chemabove{H}{\scriptstyle\delta+}-\chemabove{Cl}{\scriptstyle\delta{-}}}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Greek Character in chemical Structure

Post by cgnieder »

unbonpetit wrote:Je vais parler français puisque je parle à une française, tant pis pour les modos (Clemens, à l'affut de questions sur chemfig notamment) qui vont peut être pas trop apprécier cette démarche sur ce forum anglophone.
I'm not looking especially for chemfig questions... I only happen to hang around on TeX forums a lot and don't seem to have another private life ;) I'll leave them too you if you like :)

The problem I have with non-English questions and answers here on http://www.latex-community.org -- and I'm pretty sure both Stefan and Thorsten agree with me on that -- is that it assumes that no one else will be interested in the post. I think it is rather unfair towards our other users. If people want to talk German they can use a German forum and it's the same with French or any other language.

Regards
site moderator & package author
huberte
Posts: 5
Joined: Sun Apr 07, 2013 4:35 am

Greek Character in chemical Structure

Post by huberte »

cgnieder wrote:
The problem I have with non-English questions and answers here....
I'll translate, I quite a newbie and don't want to have words with some modo :?

Désolé, unbonpetit :), je continue en anglais pour ne pas m'attirer les foudres des modos...

even with my bad english
unbonpetit wrote:
huberte wrote:It's OK outside \chemfig, inside I get "ffi +" instead of the Greek letter delta. Why?
It does not work here because chemfig use \mathrm for all that is displayed and selected font does not have this glyph. Try $\mathrm{\delta}$ to make you aware of the problem.
Ha, ok, but
I can see the delta with this code (is your command working or am I missing something ?) :

Code: Select all

Code, edit and compile here:
\documentclass{article}
%\usepackage{mathpazo}
\usepackage{tgpagella}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{chemfig}
\begin{document}
$\mathrm{\delta}$
\chemfig{\delta} % this would be enough
\chemfig{\scriptstyle\color{red}\delta+}
$$\stackrel{\delta^+}{H}-\stackrel{\delta^-}{Cl}$$
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
unbonpetit wrote: There are many ways to get a workaround, here's one that redefines \delta to always be displayed in normal font (it's a bit messy but never mind).
Ok, it works ! Merci :)
unbonpetit wrote: Final note, you can directly ask the author of chemfig (ie me) per email rather than with forum.
Have you lost your mind ? ;)

I'm a tolally newbie with latex, more with chemfig, and I would dare emailing the author of chemfig ? :roll:

No really, I did not even think about it....

Edit/PS : Et Merci beaucoup, chemfig is a killer chemsitry feature !
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Greek Character in chemical Structure

Post by cgnieder »

huberte wrote:I'll translate
Thanks :)
huberte wrote:I quite a newbie and don't want to have words with some modo :?
[...]
even with my bad english
Don't worry -- we're all nice people here :) And most of us aren't native speakers either...

Why not email Christian directly if he offers you to? He's a nice guy!

Regards
site moderator & package author
Post Reply