From: "Matija Šuklje" <matija@suklje.name>
To: ntg-context@ntg.nl
Subject: Difference between \skip and \unskip
Date: Wed, 3 Nov 2010 10:21:41 +0100 [thread overview]
Message-ID: <201011031021.44942.matija@suklje.name> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 6406 bytes --]
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@gabbler.org
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
[-- Attachment #2: Type: text/plain, Size: 486 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next reply other threads:[~2010-11-03 9:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-03 9:21 Matija Šuklje [this message]
2010-11-03 9:32 ` Hans Hagen
2010-11-03 9:38 ` Matija Šuklje
2010-11-03 9:53 ` Wolfgang Schuster
2010-11-03 10:00 ` Matija Šuklje
2010-11-03 10:08 ` Wolfgang Schuster
2010-11-03 10:13 ` Mojca Miklavec
2010-11-03 10:17 ` Matija Šuklje
2010-11-03 10:14 ` Taco Hoekwater
2010-11-03 10:23 ` Matija Šuklje
2010-11-03 10:28 ` Taco Hoekwater
2010-11-03 10:33 ` Matija Šuklje
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201011031021.44942.matija@suklje.name \
--to=matija@suklje.name \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).