Git Product home page Git Product logo

chemformula's People

Contributors

cgnieder avatar josephwright avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

chemformula's Issues

Starred version of \isotope doesn't work inside \ch

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

isotope.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

Unwanted line height increase with bonds

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}

Generic hook 'package/after/hyperref' is deprecated.

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
      {

Feature request: Support for *mathtools* `\shortintertext` in the reactions environment

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.

sub-, superscripts and tetetype family

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}

chemformula

Strange variant for prop_if_in

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.

superscripts are vertically shifted with respect to standard text-mode and math-mode superscripts

(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

Screenshot 2020-09-07 17 02 05

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...!

<options> in documentation: not clear to which commands they belong

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.

Feature Request: squiggly arrows

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

Allow multiple lines above and below arrows

Currently text above and below arrows is typeset as an hbox:

chemformula/chemformula.sty

Lines 893 to 896 in f709324

\hbox_set:Nn \l__chemformula_arrow_arg_i_box
{ \tl_use:N \l__chemformula_arrow_label_style_tl #2 }
\hbox_set:Nn \l__chemformula_arrow_arg_ii_box
{ \tl_use:N \l__chemformula_arrow_label_style_tl #3 }

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.

BUG: Reaction modules fails with math formula in arrow label AND subscript ?

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

Exclamation mark handler has weird parsing semantics

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.