cgnieder / chemformula Goto Github PK
View Code? Open in Web Editor NEWtypeset chemical compounds and reactions
typeset chemical compounds and reactions
\documentclass{article}
\usepackage{chemformula}
\begin{document}
\parbox{2em}{\ch{Cr4O7^-}}
\end{document}
Found on LC, no real information so far. Feel free to kick it off :-) This is merely to drop off a note.
The variable \l__chemformula_tmpa_bool
is used in \__chemformula_if_only_parens:n(TF)
and \chemformula_is_addition_symbol_input:n(TF)
, but is not declared.
Reference: https://tex.stackexchange.com/q/445843/4427
Dear Sir,
if I use \isotope*{element}
inside \ch
it shows the following error message at compilation time:
! Missing number, treated as zero.
<to be read again>
\@elements@atom@name@num@\chemformula_star_adduct:
l.19 \item The \ch{\isotope*{Cl}}
is the most abundant.
The text file used is:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{kpfonts}
\usepackage{chemgreek}
\usepackage[utf8]{inputenc}
\usepackage{chemformula}
\usepackage{chemmacros}
\usechemmodule{isotopes}
\begin{document}
\begin{itemize}
\item The \isotope{Cl} is the most abundant.
\item The \isotope*{Cl} is the most abundant.
\end{itemize}
\begin{itemize}
\item The \ch{\isotope{Cl}} is the most abundant.
\item The \ch{\isotope*{Cl}} is the most abundant.
\end{itemize}
\end{document}
with pdflatex it produces the attached pdf
I am using
Package: chemmacros 2020/11/21 v5.11a comprehensive support for typesetting chemistry documents (CN)
File: chemmacros.module.isotopes.code.tex 2020/11/21 v5.11a chemmacros module `
isotopes' 2015/07/22 a macro to easily print element isotopes
Thanks for the attention,
Rafael
From https://tex.stackexchange.com/questions/526138/unwanted-line-height-increase-with-chemformula/526140
\documentclass{article}
\usepackage{chemformula}
\lineskiplimit=-1em
\begin{document}
\begin{minipage}{0.2\textwidth}
\begin{tabular}{r}
\hline
\ch{H2O} \\
\ch{CH3OCH3} \\
\ch{H3PO4} \\
\hline
\end{tabular}
\end{minipage}
%
\begin{minipage}{0.2\textwidth}
\begin{tabular}{l}
\hline
\ch{H2O} \\
\ch{CH3-O-CH3} \\
\ch{H3PO4} \\
\hline
\end{tabular}
\end{minipage}
\end{document}
The problem is the bonds in \ch{CH3-O-CH3}
create a larger (higher) line than \ch{CH3OCH3}
Due to the renaming of generic hooks (see: latex3/latex2e#648), the following MWE
\documentclass{article}
\usepackage{chemformula}
\begin{document}
\end{document}
now results in a warning message:
LaTeX hooks Warning: Generic hook 'package/after/hyperref' is deprecated.
(hooks) Use hook 'package/hyperref/after' instead.
The following should be sufficient to fix that:
@@ -3285,7 +3285,7 @@
% --------------------------------------------------------------------------
% hyperref support
- \hook_gput_code:nnn {package/after/hyperref} {chemformula}
+ \hook_gput_code:nnn {package/hyperref/after} {chemformula}
{
\pdfstringdefDisableCommands
{
This is a feature request stemming from this stackexchange question. Essentially, I'd like to be able to use \shortintertext
from the mathtools
package inside the reaction environment. The main difference (visually anyway) between \shortintertext
and \intertext
is the vertical spacing around the output.
\intertext
intertext.pdf
\shortintertext
shortintertext.pdf
\shortintertext
works inside the align environment from amsmath
, which the reactions environment is based on, but is currently unsupported by chemmacros
.
The small code below fails to display the multiple subscripts when \ttfamily
is in used.
\documentclass{article}
\usepackage{chemformula}
\begin{document}
\ch{H2O}
\ch{_2H^1}
\ch{_{2b}H^{1a}}
\ch{_{Z-1}^{A-1}Y}
\ch{Y_{Z-1}^{A-1}}
\bigskip
\ttfamily
\ch{H2O}
\ch{_2H^1}
\ch{_{2b}H^{1a}}
\ch{_{Z-1}^{A-1}Y}
\ch{Y_{Z-1}^{A-1}}
\end{document}
\documentclass{article}
\usepackage{chemformula}
\begin{document}
\ch{A ->[ a ][b] B}
\end{document}
leads to
./test.tex:7: Extra }, or forgotten \endgroup.
\hbox_set:Nn ...group_begin: #2\color_group_end: }
l.7 \ch{A ->[ a ][b] B}
I'm refining the error detection of \cs_generate_variant:Nn
and it now complained about the following line in chemformula.sty
:
\cs_generate_variant:Nn \prop_if_in:NnT { x }
turning N
-type argument into x
-type is not really supported, as the result of an x
-expansion has no reason to be a single-token. Since you don't seem to be using that variant (perhaps a typo for Nx
?) I would appreciate if you could remove it, as I could then push my expl3
changes without fear of breaking documents in the wild.
(please excuse the preliminal submission of this question, suffered from fat fingers syndrome while still trying to find out what was going on...)
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{chemformula}
\begin{document}
\(^{1}J\)\ch{^{1}J}\(^{1}\textrm{J}\)\(^{1}\)J\textsuperscript{1}J
\(^{1}J \left( \ch{^{1}H},\ch{^{31}P} \right)\)
\end{document}
compiles to give
As you can see, the superscripts created within \ch
are printed a little higher in the vertical dimension with regard to text-mode and math-mode superscripts. This looks a bit odd to me in the second line. Is there a way to have those superscripts at the same height? I must me overlooking something in the manual. I couldn't find any option to \ch
that had visual influence on the height of the numbers. Thank you in advance...!
Dear Mr. Niederberger,
it would be nice if the options in your documentation would be ordered a bit to the corresponding commands they can be used with. Or are all options usable in any place? You are mentioning options all over the place but just in rare cases you define their scope of usage.
I try to name all appearances:
\setchemformula{<options>}
on page 3 (and the two commands from chemmacros (all appearing a second time on page 4)
\ch[<options>]{<input>}
on page 3
\chcpd[<options>]{<compound>}
on page 18
font-spec={[<options>]<font>}
on page 33 (I guess, this "options" has nothing to do with the rest)
\chlewis[<options>]{<electron spec>}{<atom>}
on page 35
On information on where to put all those options you have:
"There are some options to customize the output of the \ch command. They can either be
applied locally using the optional argument or can be set globally using the setup command." on page 4
"Enable the Kröger-Vink notation. As most options this can be enabled globally via the setup command or locally as option to \ch." on page 37
It would be nice if you could clarify where to use what. Right now, you do never mention \chcpd
regarding any options. What about tikz-external-disable
? Only for global? What about the Lewis options, only for global and \chlewis
?
Right now I see 5 occurrences of <options>
in the documentation. I think you are the person which does know best which options makes sense (and work) on which commands. I could try them all, but maybe you already have some lists on this.
The reason I am asking: I am writing a .cwl file (http://tex.stackexchange.com/a/263504) for this package. As it stands now, the user of TeXstudio gets a huge amount of options offered when using \setchemformula
which is really nice. But it would be even nicer if I can teach the user, where to use which option by offering him the right choices.
Thanks and feel free to ask, if this was not understandable.
Hi,
I've just started using this package and so far it's fantastic. Have you ever considered adding squiggly arrows to your package for all the photo/radiation chemists out there? Something like \rightsquigarrow
from the package amssymb
.
If you made this addition, I would be a very happy PhD student!
Thanks
The used \ProcessKeysPackageOptions{} seems to be obsolete.
Currently text above and below arrows is typeset as an hbox:
Lines 893 to 896 in f709324
This means that each box can contain only one line of text. However, now and then I wish to to typeset multiple lines in these positions (e.g. for a list of reaction conditions). It would be useful to change this part of the package to allow for this possibility.
Dear Clemens,
the following formula works for me only in this form
\begin{reaction}
S0 ->[{$h \nu$}] S_{$\geq 1$}
\end{reaction}
If I remove the curly brackets in the arrow label,
\begin{reaction}
S0 ->[$h \nu$] S_{$\geq 1$}
\end{reaction}
the compilation of the document with chemforumula v4.15e
and chemmacros v5.8b
fails. For me this is not an obvious caveat or is it?
Regards
Jakob
Description
The formula argument in the exclamation mark handler seems to be very sensitive to surrounding space. In the Huh?
case in the MWE it only renders strangely, but in the Boom!
case it crashes with ! Missing $ inserted.
MWE
\documentclass{article}
\usepackage{chemformula}
\begin{document}
Okay. \ch{!(yellow)( HIn_{(aq)} )}
Huh? \ch{!(yellow)(HIn_{(aq)})}
Okay. \ch{!(yellow)( HIn^+_{(aq)} )}
Boom! \ch{!(yellow)(HIn^+_{(aq)})}
\end{document}
Version information
chemformula.sty 2020/02/01 v4.15i typeset chemical compounds and reactions (
CN)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.