Math & Sciencechemstyle | No '\unskip' in vertical mode

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
BoudewijnD
Posts: 60
Joined: Wed Nov 18, 2009 4:18 pm

chemstyle | No '\unskip' in vertical mode

Post by BoudewijnD »

Hi,

I use the great chemstyle package while writing my thesis. I use it for numbering of my compound in the scheme's. However when I make a list of all the compounds I use in the chapter, (via \compound*{name}) and put this in the begin of a section (intro) than I get the following error for all the compounds listed.

Code: Select all

./chapter3.tex:16:You can't use '\unskip" in verticalmode \compound*{iodo-1-6-anhydro}
What am I doing wrong? I could not figure it out.

\BoudewijnD

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

chemstyle | No '\unskip' in vertical mode

Post by Stefan Kottwitz »

Hi BoudewijnD,

it would be good if you would post a minimal working example, so we could test and possibly fix that.

Stefan
LaTeX.org admin
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

chemstyle | No '\unskip' in vertical mode

Post by cgnieder »

The chemstyle package uses the chemcompounds package for the numbering. As you probably know the command \compound* only creates a label but doesn't print it. It uses \unskip so that no unwanted extra blank is created.

Since you didn't provide a MWE it's hard to say, what exactly you did wrong. You might try

Code: Select all

\leavevmode\compound*{<label>}
Or -- if you don't need the \schemeref command -- you could use the chemnum package.
site moderator & package author
BoudewijnD
Posts: 60
Joined: Wed Nov 18, 2009 4:18 pm

Re: chemstyle | No '\unskip' in vertical mode

Post by BoudewijnD »

It was a question of putting all the \compound* direct above the first section and no white spaces in between...

\BoudewijnD
Last edited by BoudewijnD on Sat Aug 06, 2011 7:56 pm, edited 2 times in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

chemstyle | No '\unskip' in vertical mode

Post by cgnieder »

As I said before: use \leavevmode

Code: Select all

\documentclass{article}
\usepackage{chemcompounds}
\begin{document}

\section{test A}

\leavevmode\compound*{a,b,c}
\section{test B}
Text \compound{a} more text \compound{b}.

\end{document}
EDIT: On the other hand you could just leave a blank line between \compound* and \section:

Code: Select all

\documentclass{article}
\usepackage{chemcompounds}
\begin{document}
\compound*{a,b,c}

\section{test A}
Text \compound{a} more text \compound{b}.

\end{document}


Regards
site moderator & package author
DeminJanu
Posts: 1
Joined: Fri Sep 02, 2011 9:14 am

chemstyle | No '\unskip' in vertical mode

Post by DeminJanu »

Thanks for your reply Clemens.

In case any other websurfers else run into a different but similar problem:
I was using the pdfcomment package with MacTeX/TeX Live 2009. Upon switching computers and installing MacTeX/TeX Live 2011, I suddenly had the new, unexpected compilation error:

Code: Select all

! You can't use `\unskip' in vertical mode.
\\pdfcomment [#1]#2->\ifpc@opt@unskip \unskip 
                                              \fi \pc@copy@gopt@lopt \setkey...
No idea what this means, or what Clemens' solution is doing, but changing my \pdfcomment{} command to:

Code: Select all

\newcommand   {\note} [1]   {\leavevmode\pdfcomment{#1}}
(instead of just \pdfcomment{#1})

solved the problem. Again, i offer no insight as to what happened between TeX Live 2009 -> 2011, but it works, thanks!!!
Post Reply