[NTG-context] Difference between \skip and \unskip

Matija Šuklje matija at suklje.name
Wed Nov 3 10:21:41 CET 2010


Hullo,

can someone tell me what's the difference between \skip and \unskip and when 
to use them?

I've already checked the wiki and the references, but cannot find a definition 
of either.

Here's a use case that's giving me headaches for quite some time:

In my bibliography I often have items that are missing one or two fields (e.g. 
legal texts with or without amendments etc.) and I have to tell ConTeXt to 
skip those. From trial and error I learnt that:

	* \skip leaves me with the punctuation and styling around the skipped 
field (e.g. a trailing ", ." or "( )")

	* \unskip seems to do what I want, but generates the following error every 
time 'context' reaches an '\unskip' entry:
--8<------------------
l.1 ...al , št. \localissue /\localvolume \skip ,
                                                   \localspremembe .
\currentnotedescriptiontext ...ptionnumberentry )}
                                                  
\handlenoteitself ... \currentnotedescriptiontext 
                                                  \endstrut 
\dostopstoreddes...
\handlenoteinsert ...s }\handlenoteitself {#1}{#2}
                                                  \egroup \the 
\everyafterno...
\@@notemakedescription ...note \currentnotenumber 
                                                  \fi \fi \endgroup \fi \fi 
...
...
l.82 ...e Konvencija MOD št. 173\zakon[][MOD_173]
                                                   (ter Priporočilo št. 18...
? help
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
------------------>8--

The example code:

--8<------------------
\def\zakon[#1][#2]%                                                                                                                                                                     
    {\doifdefinedelse{zakonkratko:#2}                                                                                                                                                   
        {\zakonkratko[#1][#2]}                                                                                                                                                          
        {\bgroup                                                                                                                                                                        
        \nocite[#2]%                                                                                                                                                                    
        \getcitedata[title][#2] to \localtitle                                                                                                                                          
        \getcitedata[kratko][#2] to \localkratko                                                                                                                                        
        \getcitedata[journal][#2] to \localjournal                                                                                                                                      
        \getcitedata[issue][#2] to \localissue                                                                                                                                          
        \getcitedata[volume][#2] to \localvolume                                                                                                                                        
        \getcitedata[spremembe][#2] to \localspremembe                                                                                                                                  
        \footnote{\localtitle\ (\localkratko), \localjournal, št. 
\localissue/\localvolume\skip, \localspremembe.}%                                                                     
        \egroup}                                                                                                                                                                        
    \setvalue{zakonkratko:#2}{done}                                                                                                                                                     
    }                                                                                                                                                                                   
                                                                                                                                                                                        
\def\zakonkratko[#1][#2]%                                                                                                                                                               
    {\bgroup                                                                                                                                                                            
    \nocite[#2]%                                                                                                                                                                        
    \getcitedata[kratko][#2] to \localkratko                                                                                                                                            
    \footnote{\skip#1 \localkratko.}%                                                                                                                                                   
    \egroup}                                                                                                                                                                            

\startpublication[k=MESL,
    t=zakon,
    y=1996
]
    \title{Evropska socialna listina (spremenjena)}
    \kratko{MESL}
    \engtitle{European Social Charter (revised)}
    \organization{Svet Evrope}
    \journal{Ur. l. RS-MP}
    \volume{1999}
    \issue{7}
    \pubyear{1999}\month{04}\day{10}
    \yearfiled{1999}\monthfiled{04}\dayfiled{11}
    \biburl{http://www.uradni-list.si/1/objava.jsp?urlmpid=199920}
\stoppublication
------------------>8--

-- 
gsm:	+386 41 849 552
www:	http://matija.suklje.name
xmpp:	matija.suklje at gabbler.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20101103/0f1a330e/attachment.pgp>


More information about the ntg-context mailing list