ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Matija Šuklje" <matija.suklje@rutka.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re:  First document — problems with bib module and layout
Date: Sat, 29 Dec 2007 13:20:40 +0100	[thread overview]
Message-ID: <200712291320.42803.matija.suklje@rutka.net> (raw)
In-Reply-To: <477507E5.6000706@elvenkind.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 2745 bytes --]

Dne petek 28. decembra 2007 je Taco Hoekwater napisal(a):
> Your pf_ul.tex had a spurious (or incomplete) \insert command at
> the end, that is what was causing an error problems "Missing number".

Yes, I figured that out not too long after I posted my files. Sorry about 
that.

> For the footnoted references, this seems to work:

Thanks, I've reused this macro of yours to make it fit my needs better.

> You are operating on the border of what is doable for the current
> bibliographic module, and I have no time to spend a month on a rewrite
> just now, so if this is still not good enough, you are out of luck.

With your help I managed to get together something useable. It's not perfect 
yet, but since the text I'm working on now is not that important and the next 
text where I would need a lot of different types of bibliography is still 
more then half a year away — there is no rush. Not that I would be bold 
enough to call this a bug ...it's more of a "feature request" if you will.

During the process of learning how the bib module in ConTeXt works I came to 
these suggestions:
* an autodetection/setting for \cite (e.g. \setupcitelayout) that works like 
\setuppublicationlayout, but outputs to the "cite field"
* an autodetection/setting for \cite (e.g. in \setupcite) that works similar 
then \*author, \*sep, \*etal and \*etallimit in \setuppublicationlist when it 
comes to many authors in the citation field.
* an autodetection/setting for \cite similar to the above with a script that 
would automatically shorten titles to the first X words, if the title 
exceeded Y characters or words; where X and Y could be set up
* this might  be a tough one — (at least in Slovenia's legal circles) legal 
documents get cited for the first time (e.g. with \cite) the same way as in 
the bibliography (full name, abbrev, journal, all changes etc.), but for each 
next time the same legal act gets cited only it's abbrevation should be used.

Also in connection with that — is it possible (already) to utilise \useskip so 
that not only the empty space of the missing field, but also it's separators 
(e.g. \inserteditor{ed: }{, }{}) are being skipped?

Thanks a million!


Cheers,
Matija

p.s. all I have to do now is get some headers etc. ...but I think that should 
be doable even with my limited skills.
p.p.s. I'm attaching the files a) if anyone finds any obvious faults in it and 
b) for anyone who could make use of the pf_ul.tex definitions.

-- 
gsm: +386 41 849 552
e-mail: matija.suklje@rutka.net
www: http://matija.suklje.name

aim: hookofsilver
icq: 110183360
jabber/g-talk: matija.suklje@gabbler.org
msn: matija.suklje@rutka.net
yahoo: matija_suklje

[-- Attachment #1.1.2: konkurencna_klavzula.tex --]
[-- Type: text/x-tex, Size: 1416 bytes --]

%%%
%%% Splošne definicije
%%%

% za pravila PF UL
\input pf_ul
\def\avtor{Matija Šuklje}
\def\mentor{as. mag. Luka Tičar}
\def\tip{seminarska naloga}
\def\naslov{Konkurenčna klavzula v delovni pogodbi}
\def\kljucnebesede{delovno pravo}

% moji lastni linki
\useURL[author-email][mailto:matija.suklje@rutka.net][][matija.suklje@rutka.net]
\useURL[homepage][http://matija.suklje.name][][matija.suklje.name]

%%%
%%% Začetek teksta
%%%

\starttext
\startstandardmakeup
\title{\naslov}
\stopstandardmakeup

%%%
%%% Kazalo in uvod s povzetki
%%%
\startfrontmatter
\placecontent

	\section[uvod]{Uvod}

	\subsection[povzetek]{Povzetek}

\input knuth

{\en		% začasno spremeni jezik v angleščino
	\subsection[summary]{Summary}

\input knuth
}
\stopfrontmatter

%%%
%%% Vsebina naloge
%%%
\startbodymatter

	\section[1]{Prvo poglavje}

\input tufte

	\subsection[1.1]{podpoglavje}

\input knuth

tuki citiram, veš?

knjiga\citat[, str. 12][pavcnik_teorija] \crlf
več avtorjev ... \citat[, str. 102-232][kusej_uvod] \crlf
članek v zborniku \zbornik[, str. 5][raz_purity] \crlf
pa še en Bavconov članek \clanek[][bavcon_zkp] \crlf
ena Galičeva objava v ZZR \clanek[][galic_vloga] \crlf

pa še zakon\zakon[33. člen][SPZ]

\stopbodymatter

%%%
%%% Appendix
%%%
\startappendices

\page
\completepublications

\stopappendices
\stoptext

[-- Attachment #1.1.3: moja_bibliografija.bbl --]
[-- Type: text/plain, Size: 2807 bytes --]

% definicije dodatnega polja za skrajšane naslove in avtorje
\newbibfield[kratko]
\newbibfield[kjournal]
\newbibfield[kauthor]

% definicije dodatnih polj potrebnih za pravne vire
\newbibfield[engtitle]
\newbibfield[spremembe]

%%%
%%% knjige
%%%

\startpublication[k=pavcnik_teorija,
	a=Pavcnik,
	t=knjiga,
	y=2001,
]
	\title{Teorija prava}
	\kratko{Teorija prava}
	\author{Marijan}[M.]{}{Pavčnik}
	\kauthor{M. Pavčnik}
	\revision{2. izdaja}
	\pubyear{2001}
	\pubname{Cankarjeva založba}
	\city{Ljubljana}
\stoppublication

\startpublication[k=kusej_uvod,
	a=Kusej,
	t=knjiga,
	y=1996
]
	\title{Uvod v pravoznanstvo}
	\kratko{Uvod}
	\author{Gorazd}[G.]{}{Kušej}
	\author{Marijan}[M.]{}{Pavčnik}
	\author{Anton}[A.]{}{Perenič}
	\kauthor{G. Kušej, M. Pavčnik, A. Perenič}
	\revision{ponatis 3. spremenjene in dopolnjene izd.}
	\pubyear{1996}
	\pubname{Uradni list Republike Slovenije}
	\city{Ljubljana}
\stoppublication

%%%
%%% zborniki
%%%

\startpublication[k=raz_purity,
	a=Raz,
	t=zbornik,
	y=1998,
]
	\title{The Purity of the Pure Theory of Law}
	\kratko{The Purity}
	\author{Joseph}[J.]{}{Raz}
	\kauthor{J. Raz}
	\journal{Norms and Normativity — Critcal Perspectives on Kelsenian Themes}
	\kjournal{Norms and Normativity}
	\editor{}[S. L.]{}{Paulson}
	\editor{}[B.]{}{Litschewski Paulson}
	\pubname{Clarendon Press}
	\city{Oxford}
	\pubyear{1998}
	\pages{237-252}
\stoppublication

%%%
%%% članki v revijah
%%%

\startpublication[k=bavcon_zkp,
	a=Bavcon,
	t=clanek,
	y=2003
]
	\title{Na rob peti noveli zakona o kazenskem postopku}
	\kratko{Na rob}
	\author{Ljubo}[L.]{}{Bavcon}
	\kauthor{L. Bavcon}
	\journal{Pravna praksa}
	\volume{22}
	\issue{6/7}
	\pubyear{2003}
	\pages{IV-VI in IX}
\stoppublication

\startpublication[k=galic_vloga,
	a=Galic,
	t=clanek,
	y=2002
]
	\title{Vloga sodnika pri spodbujanju sodnih poravnav}
	\kratko{Vloga sodnika}
	\author{Aleš}[A.]{}{Galič}
	\kauthor{A. Galič}
	\journal{Zbornik znanstvenih razprav}
	\volume{LXII}
	\pubyear{2002}
	\pages{51-72}
\stoppublication

%%%
%%% pravni viri
%%%

%TODO — zlo grdi hack-i na mestih — nekak morš rešt to :/
\startpublication[k=SPZ,
	t=zakon,
	y=2002,
	s=SPZ
]
	\title{Stvarnopravni zakonik}
	\kratko{SPZ}
	\engtitle{Law of Property Code}
	\organization{Državni zbor RS}
	\journal{Ur. l. RS}
	\volume{2002}
	\issue{87}
	\spremembe{18/2007 Skl.US: U-I-70/04-18}
	\pubyear{2002}\month{10}\day{17}% datum objave
	\yearfiled{2003}\monthfiled{1}\dayfiled{1} % datum začetka veljave	%%% TODO — boljšo definicijo
	\biburl{http://www.uradni-list.si/1/ulonline.jsp?urlid=199612&dhid=32248}
\stoppublication

%%%
%%% internet
%%%
%TODO

%TODO — manjkajo odločbe sodišč, ...

[-- Attachment #1.1.4: pf_ul.tex --]
[-- Type: text/x-tex, Size: 7191 bytes --]

%d Tu so ConTeXt definicije oblike ipd., kot so predpisane za seminarske
%d in diplomske naloge na Pravni fakulteti Univerze v Ljubljani
%c Avtor: Matija Šuklje, matija.suklje@rutka.net, http://matija.suklje.name
%c Avtor dovoljuje (in spodbuja) uporabo vsebino tega „dela“ pod pogoji v licenci GPL.

%d This are the ConTeXt definitions of layout etc. as perscribed for writing a thesis
%d on the Law faculty, University of Ljubljana
%c Author: Matija Šuklje, matija.suklje@rutka.net, http://matija.suklje.name
%c The author permits (and encourages) the usage of this "work" under the terms of the GPL licence.

%%%
%%% splošne definicije dokumenta
%%%

% jezik, UTF-8 in velikost papirja
\mainlanguage[sl]
\enableregime[utf8]
\setuppapersize[a4][a4]

%%%
%%% splošna oblika teksta
%%%

\setupindenting[1.5em]
\setupindenting[yes]
\setupwhitespace[medium]

% oštevilčenje strani
\setuppagenumbering[left={stran },right={ od \lastpagenumber},location=right]

% hack, da ni odvečnih praznih strani zadaj. ker, če uporabljaš delitev na front- pa back-matter,
% sklepa, da gre za knjigo in zato avtomatično doda strani, da je sodo število
\setupsectionblock[frontpart][page=no]
\setupsectionblock[bodypart][page=no]
\setupsectionblock[appendix][page=no]
\setupsectionblock[backpart][page=no]

%%%
%%% za informacije v PDF, pobere podatke iz definicij glavnega dokumenta
%%%

% da dela UTF-8 tudi v PDF kazalu in informacijah o dokumentu
\input spec-tst

% pobere iz glavnega dokumenta definicije in jih zapiše v informacije v PDF
\setupinteraction
	[state=start,
	title={\naslov},
	subtitle={\tip},
	author={\avtor},
	keyword={\tip, \kljucnebesede}
	]

% ustvari kazalo v PDF
\placebookmarks[chapter,section,subsection]

%%%
%%% kazalo
%%%

\setupcombinedlist[content][alternative=c]
\setuplist[chapter][style=bold,alternative=b,width=1.5em]
\setuplist[section][margin=1.5em,width=2em]
\setuplist[subsection][margin=3.5em,width=3em]
\setuplist[subsubsection][margin=6.5em,width=4em]

%%%
%%% oblika poglavij ipd.
%%%

% zgenerira okoli naslova prvo stran na podlagi definicij iz glavnega dokumenta in datuma ob generiranju
\setuphead
	[title]
	[align=middle,
	textstyle=\sc,
	style=\bfd,
	before={\startalignment[middle] Univerza v Ljubljani \crlf Pravna fakulteta \vfill},
	after=
		{
		\blank[line]
		(\tip)		% definiraj v dokumentu — npr. \def\tip{diplomska naloga}
		\vfill
		Avtor: \avtor		% definiraj v dokumentu — npr. \def\autor{Matija Šuklje}
		\crlf
		Mentor: \mentor		% definiraj v dokumentu — npr. \def\mentor{preljubi profesor}
		\vfill
		Ljubljana, \currentdate{} \stopalignment \page
		}
	]

% poglavja
\setuphead
	[chapter]
	[header=empty,
	textstyle=\sc,
	style=\bfb,
	before={\page\noindentation\hairline\blank[line]},
	after={\nowhitespace\hairline\blank[4*line]}
	]

% oddelki
\setuphead
	[section]
	[page=yes,
	textstyle=\sc,
	style=\tfa,
	align=right,
	before={\blank[2*line]},
	after={\blank[line]}
	]

% pododdelki
\setuphead
	[subsection]
	[style=\it,
	align=right,
	before={\blank[2*line]},
	after={\blank[line]}
	]

%%%
%%% definicije za citiranje in bibliografijo
%%%

% da sploh dela citiranje in bibliografija in ga poišče v zunanji datoteki
\usemodule[bib]
\input moja_bibliografija.bbl

% definicija novih ukazov za citiranje
% definition by: Taco Hoekwater
\def\citat[#1][#2]%
	{\bgroup
	% this adds the reference to the publication list
	% in the back:
	\nocite[#2]%
	% you can get all single-valued fields with this
	% \commands (title,issue,journal etc.) but not the
	% \author,\artauthor and \editor because they have
	% special arguments:
	\getcitedata[kauthor][#2] to \localavtor
	\getcitedata[kratko][#2] to \localkratko
	\getcitedata[pubyear][#2] to \localyear
	% you may want more fields and/or better formatting:
	\footnote{\localavtor, {\sc\localkratko} (\localyear)#1.}%
	\egroup}
%moja adaptacija le-tega še za zakone
%TODO —	ne najdem kako bi prvič citiral z vsemi info in šele kasneje vedno samo z okrajšavo
%	možna rešitev bi bila, da bi tu definiral vse info in nato vsakič samo uporabljal \footnote za krajše
\def\zakon[#1][#2]%
	{\bgroup
	\nocite[#2]%
	\getcitedata[kratko][#2] to \localkratko
	\footnote{#1 \localkratko.}%
	\egroup}
%moja adaptacija le-tega še za članke 
\def\clanek[#1][#2]%
	{\bgroup
	\nocite[#2]%
	\getcitedata[kauthor][#2] to \localavtor
	\getcitedata[kratko][#2] to \localkratko
	\getcitedata[journal][#2] to \localjournal
	\getcitedata[volume][#2] to \localvolume
	\getcitedata[issue][#2] to \localissue
	\getcitedata[pubyear][#2] to \localyear
	\getcitedata[pages][#2] to \localpages
	\footnote{\localavtor, \localkratko, v: \localjournal, {\localvolume} (\localyear) \localissue\unskip, str. \localpages.}%
	\egroup}
%moja adaptacija le-tega še za zbornike
\def\zbornik[#1][#2]%
	{\bgroup
	\nocite[#2]%
	\getcitedata[kauthor][#2] to \localavtor
	\getcitedata[kratko][#2] to \localkratko
	\getcitedata[kjournal][#2] to \localkjournal
	\getcitedata[volume][#2] to \localvolume
	\getcitedata[issue][#2] to \localissue
	\getcitedata[pubyear][#2] to \localyear
	\getcitedata[pages][#2] to \localpages
	\footnote{\localavtor, \localkratko, v: {\sc \localkjournal} (\localyear) \localissue\unskip, str. \localpages.}%
	\egroup}

% nekakšne splošne nastavitve za bibliografijo
\setupheadtext[sl][pubs={\sca Literatura\blank[line]}]
\setuppublicationlist
	[title={{\sca\naslov} \blank[line]},
% 	totallist=6,
	author=\invertedauthor,
	artauthor=\invertedauthor,
	editor=\invertedauthor,
	namesep={, },
	lastnamesep={ in },
	finalnamesep={ in },
	authoretallimit=10,
	authoretaltext={ in drugi},
	artauthoretallimit=10,
	artauthoretaltext={ in drugi},
	editoretallimit=10,
	editoretaltext={ in drugi},
]

\setuppublications
	[sorttype=cite,
	numbering=yes,
% 	autohang=yes,
	criterium=cite
]

% posebne nastavitve za knjige v bibliografiji
\setuppublicationlayout[knjiga]{
	\insertauthors{}{: }{}%
	\inserttitle{\bgroup\sc}{\egroup}{}%
	\insertrevision{ (}{)}{}%
	\insertpubname{, }{}{\unskip}%
	\insertcity{, }{}{}%
	\insertpubyear{ }{.}{}%
}

% posebne nastavitve za članke v bibliografiji
\setuppublicationlayout[clanek]{
	\insertauthors{}{: }{}%
	\inserttitle{}{}{}%
	\insertjournal{, v: }{}{}%
	\insertvolume{, }{}{}%
	\insertpubyear{ (}{)}{}%
	\insertissue{ }{}{\unskip}%
	\insertpages{, str. }{.}{}%
}

% posebne nastavitve za zbornike v bibliografiji
\setuppublicationlayout[zbornik]{
	\insertauthors{}{: }{}%
	\inserttitle{}{}{}%
	\insertjournal{, v: \bgroup\sc}{\egroup}{}%
	\inserteditors{ (ur. }{)}{\unskip}%
	\insertpubname{, }{}{}%
	\insertcity{, }{}{}%
	\insertpubyear{ }{}{}%
	\insertpages{, str.}{.}{\unskip}%
}

% posebne nastavitve za pravne vire v bibliografiji
\setuppublicationlayout[zakon]{%
	\inserttitle{}{}{}%
	\insertkratko{ (}{)}{\unskip}%
	\insertjournal{, }{, }{}%
	\insertissue{št. }{}{}%
	\insertvolume{/}{ }{}%
	\insertspremembe{}{.}{}%
}


%TODO — prenesi vse kar se le da iz glavnega dokumenta sem

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2007-12-29 12:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-25 22:39 Matija Šuklje
2007-12-26 11:15 ` Taco Hoekwater
2007-12-26 22:50   ` Matija Šuklje
2007-12-27 10:38     ` Matija Šuklje
2007-12-27 10:56       ` Matija Šuklje
2007-12-27 15:46         ` Taco Hoekwater
2007-12-27 18:51           ` Matija Šuklje
2007-12-28 14:27             ` Taco Hoekwater
2007-12-29 12:20               ` Matija Šuklje [this message]
2007-12-29 19:06                 ` Aditya Mahajan
2007-12-29 20:06                   ` Matija Šuklje
2008-04-06 18:51                   ` 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=200712291320.42803.matija.suklje@rutka.net \
    --to=matija.suklje@rutka.net \
    --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).