diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/dlfltxb |
Initial commit
Diffstat (limited to 'macros/latex/contrib/dlfltxb')
19 files changed, 5609 insertions, 0 deletions
diff --git a/macros/latex/contrib/dlfltxb/README b/macros/latex/contrib/dlfltxb/README new file mode 100644 index 0000000000..b95b67e379 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/README @@ -0,0 +1,212 @@ +% (C) Lars Madsen, daleif@imf.au.dk, 2008/01/17 +% This material is subject to the LaTeX Project Public License. +% See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html +% for the details of that license. + +The dlfltxb bundle consists of (currently) four packages used for my +book "Introduktion til LaTeX" (in Danish, available from +http://www.imf.au.dk/system/latex/bog/). + +One package consists of various home made macros (in the book +presented as code tips), which are also useful for other users. The +remaining three packages are used internally for writing the book. + +At least one more package (dlfltxbsc) will be added to the bundle +later. This is the package used for all the +examples in the book. + + +HISTORY +======= + + * 20070601 added new versions of dlfltxbcodetips and + dlfltxbmarkup-sample.cfg + + * 20070604 made dlfltxbcodetips more compatible with the mathdesign + package by adding the 'noamssymb' option + + * 20070710 bugfix in dlfltxbcodetips (the counter aliasing in + \NewShadedTheorem should now work as intended) + + * 20070711 bugfix in dlfltxbcodetips (coding error in \ArrowBetweenLines) + + * 20080117 added the dlfltxbtocconfig package + + * 20080122 small changes to dlfltxbtocconfig + + * 20080805 changes to several packages + + * 20081030 renamed a file because of confusion + + * 20100304 updated packages for todays releace + +Current file contents for the dlfltxb bundle: +============================================= + +dlfltxbcodetips (v0.5): +----------------------- + + * dlfltxbcodetips.sty + * dlfltxbcodetips.pdf (manual) + * dlfltxbcodetips.tex (source for the manual) + + The dlfltxbcodetips package contains macros: + + * \bigtimes (without the need for extra fonts) + * \nuparrow, \ndownarrow (using graphicx and \nrightarrow and \nleftarrow) + * \InsertTheoremBreak for inserting a 'linebreak' before the start of + a list, when that list is the first part of a theorem text + * a series of macros for helping with alignment in formulas + * \NewShadedTheorem for auto creating shaded theorems with the + ntheorem package (requires the user to load the (x)color and framed + packages and define the shadecolor, and of course using ntheorem) + * \ProvidePGFPagesFourOnOneWithSpaceForNotes provides a + '4 on 1 with space for notes' layout for pgfpages, based on the + standard '8 on 1' + * \OverloadUnderscoreInMath, after which _ will be overloaded in + math-mode, such that X_|max| = X_{\textup{max}} + * \DeclareMathSymbolShorthand and hence \DeclareMathSet for + * creating easy shortcuts to various symbols, such as \setR for + \mathbb{R} (the real numbers), we promote the method of using + shortcuts that have a meaning with out the definition of the + shortcut it self + +Changes +------- + + v0.2 Better implementations of \nuparrow, \ndownarrow and bigtimes, + all due to Enrico Gregorio. Also changed the implementation of + \NewShadedTheorem such that the environment giving the + bagground is now configurable. + v0.23 Made the autoloading of amssymb optional. + v0.25 Bugfix. + v0.26 Bugfix. + v0.30 added \ProvidePGFPagesFourOnOneWithSpaceForNotes + v0.40 added \MoveEqLeft (renamed from \PullBack), + \OverloadUnderscoreInMath, \DeclareMathSet, + \DeclareMathSymbolShorthand + v0.5 Removed \MoveEqLeft, \ArrowBetweenLines, \SwapDeadSpace + They have a new home in the mathtools package + \nuparrow and \ndownarrow delayed until begin document, + such that they can better detect for missing symbols + + + +dlfltxbmarkup (v0.70): +--------------------- + + * dlfltxbmarkup.sty + * dlfltxbmarkup.pdf (manual) + * dlfltxbmarkup.tex (source for the manual) + * dlfltxbmarkup-sample.cfg (sample configuration file, actually the + keys I currently use for the book) + * dlfltxbmarkup-showkeys.tex (a file that can be used to print a list + of category keys and their description) + * dlfltxbmarkup-showkeys.pdf (sample description file showing the + * contents of dlfltxbmarkup-sample.cfg) + + The dlfltxbmarkup package provides: + + * \markup for marking up words etc. in the text. The context is + controlled by user defined category keys. \markup can + automatically write in the text, in the (outer) margin and adding + the word to the index (in several places if so defined in the key + definition) + * \felineGenerateKey for generating category keys + + The dlfltxbmarkup package requires the use of the memoir + class. Currently I do not plan on creating a version the is not + dependant of memoir. + + +Changes +------- + + 20070601 new version of dlfltxbmarkup-sample.cfg + 20080117 new version of dlfltxbmarkup-sample.cfg plus a bug fix + 20080805 use \scriptsize instead of \footnotesize when writing in the + margins. Major cleanup in dlfltxbmarkup-sample.cfg + 20081030 The sample key dlfltxbmarkup-sample.cfg has been renamed to + dlfltxbmarkupbookkeys.sty as to remove confusion + 20100304 several new keys added to dlfltxbmarkupbookkeys.sty + + +dlfltxbmisc (v0.3): +------------------- + + * dlfltxbmisc.sty + * dlfltxbmisc.pdf (manual) + * dlfltxbmics.tex (source for the manual) + + The dlfltxbmisc package provides + + * macros for writing sample LaTeX arguments + * two simple environments for displaying syntax + * the \addurl (bad name) that I use for specially wrapping URLs in + the bibliography + + +Changes +------- + + 2008/01/01 fixed to accommodate changes in mempatch version 4.9 + 2010/03/04 added \CTAN macro + +dlfltxbtocconfig (0.7) +---------------------- + + * dlfltxbtocconfig.sty + * dlfltxbtocconfig.pdf (very short manual) + * dlfltxbtocconfig.tex (source for manual) + + The dlfltxbtocconfig package provides + + * macros for creating the short and long TOC for my LaTeX book + * macros to 'dynamically' change the TOC indentation for subsubsection items + * feature for setting auto-generated numwidths for section and + subsection based on the contents of the .toc file. + (rewritten in version 0.7) + +Changes +------- + + 2008/01/17 Initial release + 2008/01/22 Made the ToC titles configurable using \contentsname and a + provided \shortcontentsname + 2008/08/05 some reconfiguration of the look of the short toc. + 2010/03/04 toc configuration heavyly changed, autoadjusting now use + undocumented features in memoir (benefit of being memoir maintainer ;-) + +package_doc.bib: +---------------- + + Bibliographic information used by all three documentations. + +dlfltxbbibtex.bst, .dbj: +------------------------ + +Bibtex style and makebst driver used for the book. + +If you choose to change the bibtex style using the dbj file, please rename it first. + + + +INSTALLATION: +============= + +Place all *.sty files in + +tex/latex/dlfltxb + +All *.tex *.bib *.pdf and README in + +doc/latex/dlfltxb + +The .bst file in + +bibtex/bst/dlfltxb + + + +/Lars Madsen +daleif@imf.au.dk diff --git a/macros/latex/contrib/dlfltxb/dlfltxbbibtex.bst b/macros/latex/contrib/dlfltxb/dlfltxbbibtex.bst new file mode 100644 index 0000000000..66b85a7557 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbbibtex.bst @@ -0,0 +1,1574 @@ +%% +%% This is file `dlfltxbbibtex.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `head,exlang,ay,nat,lang,ed-au,jnrlst,x2,m2,note-yr,tit-it,atit-u,volp-com,num-xser,pub-date,pub-xpar,isbn,issn,doi,blk-tita,blknt,dansk,pp,ed,ord,and-xcom,url,url-nt,nfss,,{}') +%% dansk.mbs (with options: `exlang,ay,nat,lang,ed-au,jnrlst,x2,m2,note-yr,tit-it,atit-u,volp-com,num-xser,pub-date,pub-xpar,isbn,issn,doi,blk-tita,blknt,dansk,pp,ed,ord,and-xcom,url,url-nt,nfss,,{}') +%% merlin.mbs (with options: `tail,exlang,ay,nat,lang,ed-au,jnrlst,x2,m2,note-yr,tit-it,atit-u,volp-com,num-xser,pub-date,pub-xpar,isbn,issn,doi,blk-tita,blknt,dansk,pp,ed,ord,and-xcom,url,url-nt,nfss,,{}') +%% ---------------------------------------- +%% *** BibTeX stilfil (.bst) hoerende til Feline Projektet *** +%% +%% Copyright 1994-2005 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2005/10/17 4.14 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in + % DANSK + % This is an author-year citation style bibliography. As such, it is + % non-standard LaTeX, and requires a special package file to function properly. + % Such a package is natbib.sty by Patrick W. Daly + % The form of the \bibitem entries is + % \bibitem[Jones et al.(1990)]{key}... + % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... + % The essential feature is that the label (the part in brackets) consists + % of the author names, as they should appear in the citation, with the year + % in parentheses following. There must be no space before the opening + % parenthesis! + % With natbib v5.3, a full list of authors may also follow the year. + % In natbib.sty, it is possible to define the type of enclosures that is + % really wanted (brackets or parentheses), but in either case, there must + % be parentheses in the label. + % The \cite command functions as follows: + % \citet{key} ==>> Jones et al. (1990) + % \citet*{key} ==>> Jones, Baker, and Smith (1990) + % \citep{key} ==>> (Jones et al., 1990) + % \citep*{key} ==>> (Jones, Baker, and Smith, 1990) + % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) + % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) + % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32) + % \citeauthor{key} ==>> Jones et al. + % \citeauthor*{key} ==>> Jones, Baker, and Smith + % \citeyear{key} ==>> 1990 + %--------------------------------------------------------------------- + +ENTRY + { address + author + booktitle + chapter + doi + edition + editor + eid + howpublished + institution + isbn + issn + journal + key + language + month + note + number + organization + pages + publisher + school + series + title + type + url + volume + year + } + {} + { label extra.label sort.label short.list } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + skip$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{norsk.mbs}[2004/05/06 4.2a (RL/PWD)] + + % The language selected here is DANSK + +FUNCTION {bbl.and} +{ "og"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "red." } + +FUNCTION {bbl.editor} +{ "red." } + +FUNCTION {bbl.edby} +{ "redigeret af" } + +FUNCTION {bbl.edition} +{ "udgave" } + +FUNCTION {bbl.volume} +{ "bind" } + +FUNCTION {bbl.of} +{ "af" } + +FUNCTION {bbl.number} +{ "nummer" } + +FUNCTION {bbl.nr} +{ "nr." } + +FUNCTION {bbl.in} +{ "i" } + +FUNCTION {bbl.pages} +{ "pp." } + +FUNCTION {bbl.page} +{ "s." } + +FUNCTION {bbl.chapter} +{ "kapitel" } + +FUNCTION {bbl.techrep} +{ "Teknisk rapport" } + +FUNCTION {bbl.mthesis} +{ "Speciale" } + +FUNCTION {bbl.bachelor} +{ "Bachelorprojekt" } + +FUNCTION {bbl.phdthesis} +{ "ph.d.-afhandling" } + +FUNCTION {bbl.first} +{ "1." } + +FUNCTION {bbl.second} +{ "2." } + +FUNCTION {bbl.third} +{ "3." } + +FUNCTION {bbl.fourth} +{ "4." } + +FUNCTION {bbl.fifth} +{ "5." } + +FUNCTION {bbl.th} +{ "." } +MACRO {jan} {"Januar"} + +MACRO {feb} {"Februar"} + +MACRO {mar} {"Marts"} + +MACRO {apr} {"April"} + +MACRO {may} {"Maj"} + +MACRO {jun} {"Juni"} + +MACRO {jul} {"Juli"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"Oktober"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + + % End module: dansk.mbs +%% Copyright 1994-2005 Patrick W Daly +MACRO {acmcs} {"ACM Computing Surveys"} + +MACRO {acta} {"Acta Informatica"} + +MACRO {cacm} {"Communications of the ACM"} + +MACRO {ibmjrd} {"IBM Journal of Research and Development"} + +MACRO {ibmsj} {"IBM Systems Journal"} + +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} + +MACRO {ieeetc} {"IEEE Transactions on Computers"} + +MACRO {ieeetcad} + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} + +MACRO {ipl} {"Information Processing Letters"} + +MACRO {jacm} {"Journal of the ACM"} + +MACRO {jcss} {"Journal of Computer and System Sciences"} + +MACRO {scp} {"Science of Computer Programming"} + +MACRO {sicomp} {"SIAM Journal on Computing"} + +MACRO {tocs} {"ACM Transactions on Computer Systems"} + +MACRO {tods} {"ACM Transactions on Database Systems"} + +MACRO {tog} {"ACM Transactions on Graphics"} + +MACRO {toms} {"ACM Transactions on Mathematical Software"} + +MACRO {toois} {"ACM Transactions on Office Information Systems"} + +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} + +MACRO {tcs} {"Theoretical Computer Science"} +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ff~}{vv~}{ll}{, jj}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author "author" format.names +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.editor + * + } + if$ +} +FUNCTION {format.isbn} +{ isbn "isbn" bibinfo.check + duplicate$ empty$ 'skip$ + { + "ISBN " swap$ * + } + if$ +} + +FUNCTION {format.issn} +{ issn "issn" bibinfo.check + duplicate$ empty$ 'skip$ + { + "ISSN " swap$ * + } + if$ +} + +FUNCTION {format.doi} +{ doi "doi" bibinfo.check + duplicate$ empty$ 'skip$ + { + "\doi{" swap$ * "}" * + } + if$ +} +FUNCTION {select.language} +{ duplicate$ empty$ + 'pop$ + { language empty$ + 'skip$ + { "{\selectlanguage{" language * "}" * swap$ * "}" * } + if$ + } + if$ +} + +FUNCTION {format.note} +{ + url empty$ + 'skip$ + { "\urlprefix\url{" url * "}" * output } + if$ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + select.language + } + if$ +} +FUNCTION {format.full.names} +{'s := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in + " " * } + +FUNCTION {format.date} +{ year "year" bibinfo.check duplicate$ empty$ + { + "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" + } + 'skip$ + if$ + extra.label * +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + select.language + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s bbl.th * 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ", " * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ 'skip$ + { + ", " * + } + if$ + swap$ * + } + if$ +} +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check + emphasize +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + "," * + " " * + get.bbl.editor + ", " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ +} +FUNCTION {format.thesis.type} +{ type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + year duplicate$ empty$ + { "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" } + { "year" bibinfo.check extra.label * } + if$ + t empty$ address empty$ and + { * } + { ", " swap$ * * } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.title "title" output.check + new.sentence + crossref missing$ + { + journal + "journal" bibinfo.check + emphasize + "journal" output.check + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + format.issn output + format.doi output + new.sentence + format.note output + fin.entry +} +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.number.series output + format.publisher.address output + } + { + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.edition output + format.isbn output + format.doi output + new.sentence + format.note output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + format.title "title" output.check + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.date "year" output.check + format.isbn output + format.doi output + new.sentence + format.note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.btitle "title" output.check + crossref missing$ + { + format.bvolume output + format.chapter.pages "chapter and pages" output.check + format.number.series output + format.publisher.address output + } + { + format.chapter.pages "chapter and pages" output.check + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.edition output + crossref missing$ + { format.isbn output } + 'skip$ + if$ + format.doi output + new.sentence + format.note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.title "title" output.check + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.chapter.pages output + format.publisher.address output + format.edition output + format.isbn output + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + format.doi output + new.sentence + format.note output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.title "title" output.check + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.isbn output + format.issn output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.doi output + new.sentence + format.note output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + format.btitle "title" output.check + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + format.date "year" output.check + format.doi output + new.sentence + format.note output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.btitle + "title" output.check + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.doi output + new.sentence + format.note output + fin.entry +} + +FUNCTION {bachelor} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.btitle + "title" output.check + bbl.bachelor format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.doi output + new.sentence + format.note output + fin.entry +} + + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + format.title output + howpublished "howpublished" bibinfo.check output + format.date "year" output.check + format.doi output + new.sentence + format.note output + fin.entry +} +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.btitle + "title" output.check + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.doi output + new.sentence + format.note output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + format.btitle "title" output.check + format.bvolume output + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.isbn output + format.issn output + format.doi output + new.sentence + format.note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.title + "title" output.check + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.doi output + new.sentence + format.note output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.title "title" output.check + format.date "year" output.check + format.doi output + new.sentence + format.note "note" output.check + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal * + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal * + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + { pop$ "????" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + " " * + namesleft #1 = t "others" = and + { "zzzzz" * } + { t sortify * } + if$ + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} +ITERATE {bib.sort.order} +SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\providecommand{\natexlab}[1]{#1}" + write$ newline$ + "\providecommand{\url}[1]{\texttt{#1}}" + write$ newline$ + "\providecommand{\urlprefix}{URL }" + write$ newline$ + "\expandafter\ifx\csname urlstyle\endcsname\relax" + write$ newline$ + " \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else" + write$ newline$ + " \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" + write$ newline$ + "\providecommand{\selectlanguage}[1]{\relax}" + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `daleif.bst'. diff --git a/macros/latex/contrib/dlfltxb/dlfltxbbibtex.dbj b/macros/latex/contrib/dlfltxb/dlfltxbbibtex.dbj new file mode 100644 index 0000000000..5b6e108eb9 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbbibtex.dbj @@ -0,0 +1,551 @@ +%% Driver file to produce dlfltxbbibtex.bst from merlin.mbs +%% Generated with makebst, version 4.1 (2003/09/08) +%% Produced on 2005/03/19 at 20:06 +%% +\input docstrip + +\preamble +---------------------------------------- +*** BibTeX stilfil (.bst) hoerende til Feline Projektet *** + +\endpreamble + +\postamble +End of customized bst file +\endpostamble + +\keepsilent + +\askforoverwritefalse +\def\MBopts{\from{merlin.mbs}{% +%EXTERNAL FILES: +%Name of language file: \cfile=dansk.mbs. +%No included files. + head,\MBopta} +\from{dansk.mbs}{\MBopta} +\from{merlin.mbs}{tail,\MBopta}} +\def\MBopta{% +%INTERNAL LANGUAGE SUPPORT (if no external language file) +% %: (def) English +% babel,%: Babel +%-------------------- + exlang,%: External language file +%STYLE OF CITATIONS: +% %: (def) Numerical + ay,%: Author-year +% alph,%: Alpha style, Jon90 or JWB90 +% alph,alf-1,%: Alpha style, Jon90 +% alph,alf-f,%: Alpha style, Jones90 +% cite,%: Cite key +%-------------------- +%HTML OUTPUT (if non author-year citations) +% %: (def) Normal LaTeX +% html,%: Hypertext +% html,htlist,%: Hypertext list +% html,htdes,%: Hypertext with keys +%-------------------- +%AUTHOR--YEAR SUPPORT SYSTEM (if author-year citations) + nat,%: Natbib +% %: (def) Older Natbib +% alk,%: Apalike +% har,%: Harvard +% ast,%: Astronomy +% cay,%: Chicago +% nmd,%: Named +% cn,%: Author-date +%-------------------- +%HARVARD EXTENSIONS INCLUDED (if Harvard support selected) +% harnm,%: With Harvard extensions +% %: (def) Older Harvard +%-------------------- +%LANGUAGE FIELD +% %: (def) No language field + lang,%: Add language field +%-------------------- +%ANNOTATIONS: + %: (def) No annotations +% annote,%: Annotations +%-------------------- +%ORDERING OF REFERENCES (if non-author/year and non-alph) +% %: (def) Alphabetical +% seq-no,%: Citation order +% seq-yr,%: Year ordered +% seq-yrr,%: Reverse year ordered +%-------------------- +%ORDERING OF REFERENCES (if author-year citations) + %: (def) Alphabetical +% seq-lab,%: By label +% seq-key,%: By label and cite key +% seq-yr,%: Year ordered +% seq-yrr,%: Reverse year ordered +% seq-no,%: Citation order +%-------------------- +%ORDER ON VON PART (if not citation order) + %: (def) Sort on von part +% vonx,%: Sort without von part +%-------------------- +%AUTHOR NAMES: + ed-au,%: Full, surname last +% nm-revf,%: Full, surname first +% nm-init,ed-au,%: Initials + surname +% nm-rev,%: Surname + initials +% nm-rv,%: Surname + dotless initials +% nm-rvx,%: Surname + pure initials +% nm-rvcx,%: Surname + comma + pure initials +% nm-rvv,%: Surname + spaceless initials +% nm-rev1,%: Only first name reversed, initials +% nm-revv1,%: First name reversed, with full names +%-------------------- +%EDITOR NAMES IN COLLECTIONS (if author names reversed) + %: (def) Editor names NOT reversed +% ed-rev,%: Editor names reversed +%-------------------- +%POSITION OF JUNIOR (if author names reversed) + jnrlst,%: Junior comes last +% %: (def) Junior between +%-------------------- +%JUNIOR PART IN THE CITATION (if author-year citations) + %: (def) No `junior' part in the citations +% jnrlab,%: `Junior' in citations +%-------------------- +%PUNCTUATION BETWEEN AUTHOR NAMES: + %: (def) Author names separated by commas +% aunm-semi,%: Names separated by semi-colon +% aunm-sl,%: Names separated by slash +%-------------------- +%ADJACENT REFERENCES WITH REPEATED NAMES: + %: (def) Author/editor names always present +% nmdash,%: Repeated author/editor names replaced by dash +% nmdash,nmd-2,%: Repeated author/editor names replaced by 2 dashes +% nmdash,nmd-3,%: Repeated author/editor names replaced by 3 dashes +%-------------------- +%NUMBER OF AUTHORS: +% %: (def) All authors +% nmlm,%: Limited authors +%-------------------- + x2,%: Maximum of 2 authors + m2,%: Minimum of 2 authors +%TYPEFACE FOR AUTHORS IN LIST OF REFERENCES: + %: (def) Normal font for author names +% nmft,nmft-sc,%: Small caps authors +% nmft,nmft-it,%: Italic authors +% nmft,nmft-bf,%: Bold authors +% nmft,nmft-def,%: User defined author font +%-------------------- +%FONT FOR FIRST NAMES (if non-default font for authors) +% %: (def) First names same font as surnames +% fnm-rm,%: First names in normal font +% fnm-def,%: First names in user defined font +%-------------------- +%EDITOR NAMES IN INCOLLECTION ETC: +% %: (def) Editors incollection normal font +% nmfted,%: Editors incollection like authors +%-------------------- +%FONT FOR `AND' IN LIST: +% %: (def) `And' in author font +% nmand-rm,%: `And' in normal font +%-------------------- +%FONT OF CITATION LABELS IN TEXT (if author-year citations) + %: (def) Cited authors plain +% lab,lab-it,%: Cited authors italic +% lab,lab-sc,%: Cited authors small caps +% lab,lab-bf,%: Cited authors bold +% lab,lab-def,%: User defined citation font +%-------------------- +%FONT FOR `AND' IN CITATIONS (if non-default font for citation lables) +% %: (def) Cited `and' in author font +% and-rm,%: Cited `and' in normal font +%-------------------- +%FONT OF EXTRA LABEL (The extra letter on the year) + %: (def) Extra label plain +% xlab-it,%: Extra label italic +%-------------------- +%LABEL WHEN AUTHORS MISSING (if author-year citations) +% keyxyr,%: Year blank when KEY replaces missing author + %: (def) Year included when KEY replaces missing author +%-------------------- +%MISSING DATE (if author-year citations) + %: (def) Missing date set to ???? +% blkyear,%: Missing date left blank +%-------------------- +%DATE POSITION: + %: (def) Date at end +% dt-beg,%: Date after authors +% dt-jnl,%: Date part of journal spec. +% dt-end,%: Date at very end +%-------------------- +%DATE FORMAT (if non author-year citations) +% %: (def) Plain month and year +% yr-par,%: Date in parentheses +% yr-brk,%: Date in brackets +% yr-col,%: Date preceded by colon +% yr-per,%: Date preceded by period +% yr-com,%: Date preceded by comma +% yr-blk,%: Date preceded by space +%-------------------- +%SUPPRESS MONTH: +% %: (def) Date is month and year +% xmth,%: Date is year only +%-------------------- +%REVERSED DATE (if including month) +% %: (def) Date as month year +% dtrev,%: Date as year month +%-------------------- +%DATE FORMAT (if author-year citations) + %: (def) Year plain +% yr-par,%: Year in parentheses +% yr-brk,%: Year in brackets +% yr-col,%: Year preceded by colon +% yr-per,%: Year preceded by period +% yr-com,%: Date preceded by comma +% yr-blk,%: Year preceded by space +%-------------------- +%INCLUDE MONTHS: + %: (def) Date is year only +% aymth,%: Include month in date +%-------------------- +%REVERSED DATE (if including month) +% %: (def) Date as month year +% dtrev,%: Date as year month +%-------------------- +%DATE PUNCTUATION (if date not at end) +% %: (def) Date with standard block punctuation +% yrp-col,%: Colon after date +% yrp-semi,%: Semi-colon after date +% yrp-per,%: Period after date +% yrp-x,%: No punct. after date +%-------------------- +%BLANK AFTER DATE: +% %: (def) Space after date +% yrpp-xsp,%: No space after date +%-------------------- +%DATE FONT: + %: (def) Date in normal font +% dtbf,%: Date in bold face +%-------------------- +%TRUNCATE YEAR (if author-year citations) + note-yr,%: Year text full +% %: (def) Year truncated +%-------------------- +%TITLE OF ARTICLE: +% %: (def) Title plain + tit-it,%: Title italic +% tit-qq,qt-s,%: Title and punctuation in single quotes +% tit-qq,%: Title and punctuation in double quotes +% tit-qq,qt-g,%: Title and punctuation in guillemets +% tit-qq,qt-s,qx,%: Title in single quotes +% tit-qq,qx,%: Title in double quotes +% tit-qq,qt-g,qx,%: Title in guillemets +%-------------------- +%COLLECTION/PROCEEDINGS TITLES (if quoted title) +% bt-qq,%: Quote collection and proceedings titles +% %: (def) Collection and proceedings titles not in quotes +%-------------------- +%CAPITALIZATION OF ARTICLE TITLE: +% %: (def) Sentence style + atit-u,%: Title style +%-------------------- +%ARTICLE TITLE PRESENT: + %: (def) Article title present +% jtit-x,%: No article title +%-------------------- +%JOURNAL NAMES: + %: (def) Periods in journal names +% jxper,%: Dotless journal names +%-------------------- +%JOURNAL NAME FONT: + %: (def) Journal name italics +% jttl-rm,%: Journal name normal +%-------------------- +%THESIS TITLE: + %: (def) Thesis titles like books +% thtit-a,%: Thesis title like article +% thtit-x,%: No thesis title +%-------------------- +%TECHNICAL REPORT TITLE: + %: (def) Tech. report title like articles +% trtit-b,%: Tech. report title like books +%-------------------- +%TECHNICAL REPORT NUMBER: + %: (def) Tech. report and number plain +% trnum-it,%: Tech. report and number italic +%-------------------- +%JOURNAL VOLUME: + %: (def) Volume plain +% vol-it,%: Volume italic +% vol-bf,%: Volume bold +% vol-2bf,%: Volume and number bold +%-------------------- +%JOURNAL VOL AND NUMBER: + %: (def) Journal vol(num) +% vnum-sp,%: Journal vol (num) +% vnum-cm,%: Journal vol, num +% vnum-nr,%: Journal vol, no. num +% vnum-h,%: Journal vol, \# number +% vnum-b,%: Journal vol number +% vnum-x,%: Journal vol, without number +%-------------------- +%VOLUME PUNCTUATION: +% %: (def) Volume with colon +% volp-sp,%: Volume with colon and space +% volp-semi,%: Volume with semi-colon + volp-com,%: Volume with comma +% volp-blk,%: Volume with blank +%-------------------- +%YEAR IN JOURNAL SPECIFICATION: + %: (def) Journal year like others +% jdt-v,%: Journal vol(year) +% jdt-vs,%: Journal vol (year) +% jdt-p,%: Year with pages +% jdt-pc,%: Year, comma, pages +%-------------------- +%PAGE NUMBERS: + %: (def) Start and stop page numbers +% jpg-1,%: Only start page number +%-------------------- +%LARGE PAGE NUMBERS: + %: (def) No separators for large page numbers +% pgsep-c,%: Comma inserted over 9999 +% pgsep-s,%: Thin space inserted over 9999 +% pgsep-p,%: Period inserted over 9999 +%-------------------- +%WORD `PAGE' IN ARTICLES: + %: (def) Article pages numbers only +% jwdpg,%: Include `page' in articles +%-------------------- +%POSITION OF PAGES: + %: (def) Pages given mid text +% pp-last,%: Pages at end +%-------------------- +%WORD `VOLUME' IN ARTICLES: + %: (def) Article volume as number only +% jwdvol,%: Include `volume' in articles +%-------------------- +%NUMBER AND SERIES FOR COLLECTIONS: + num-xser,%: Allows number without series +% %: (def) Standard BibTeX +%-------------------- +%POSITION OF NUMBER AND SERIES: + %: (def) After chapter and pages +% numser,%: Just before publisher +%-------------------- +%VOLUME AND SERIES FOR BOOKS/COLLECTIONS: + %: (def) Vol. 23 of Series +% ser-vol,%: Series, vol. 23 +%-------------------- +%POSITION OF VOLUME AND SERIES FOR INCOLLECTIONS: + %: (def) Series and volume after the editors +% ser-ed,%: Series and volume after booktitle +%-------------------- +%JOURNAL NAME PUNCTUATION: + %: (def) Comma after journal +% jnm-x,%: Space after journal +%-------------------- +%BOOK TITLE: + %: (def) Book title italic +% btit-rm,bt-rm,%: Book title plain +%-------------------- +%PAGES IN BOOKS: + %: (def) Pages in book plain +% bkpg-par,%: Pages in book in parentheses +% bkpg-x,%: Pages in book bare +%-------------------- +%TOTAL PAGES OF A BOOK: + %: (def) Total book pages not printed +% pg-bk,%: For book: 345 pages +% pg-bk,pg-pre,%: Total book pages before publisher +%-------------------- +%PUBLISHER ADDRESS: + %: (def) Publisher, address +% add-pub,%: Address: Publisher +%-------------------- +%PUBLISHER IN PARENTHESES: +% %: (def) Publisher as normal block +% pub-par,%: Publisher in parentheses +% pub-date,%: Publisher and date in parentheses +% pub-date,pub-xc,%: Publisher and date in parentheses, no comma + pub-date,pub-xpar,%: Publisher and date without parentheses +% pub-date,pub-xpar,pub-xc,%: Publisher and date, no parentheses, no comma +%-------------------- +%PUBLISHER POSITION: + %: (def) Publisher after chapter, pages +% pre-pub,%: Publisher before chapter, pages +% pre-edn,%: Publisher after edition +%-------------------- +%ISBN NUMBER: + isbn,%: Include ISBN +% %: (def) No ISBN +%-------------------- +%ISSN NUMBER: + issn,%: Include ISSN +% %: (def) No ISSN +%-------------------- +%DOI NUMBER: + doi,%: Include DOI +% agu-doi,doi,%: Insert DOI AGU style +% %: (def) No DOI +%-------------------- +%`EDITOR' AFTER NAMES (EDITED BOOKS WITHOUT AUTHORS): + %: (def) Word `editor' after name +% edpar,%: `Name (editor),' +% edpar,bkedcap,%: `Name (Editor),' +% edparc,%: `Name, (editor)' +% edparc,bkedcap,%: `Name, (Editor)' +% edparxc,%: `Name (editor)' +% edparxc,bkedcap,%: `Name (Editor)' +%-------------------- +%EDITOR IN COLLECTIONS: + %: (def) Same as for edited book +% edby,%: In booktitle, edited by .. +% edby-par,%: In booktitle (edited by ..) +% edby-parc,%: In booktitle, (edited by ..) +% edby,edbyx,%: In booktitle, editor .. +% edby,edbyw,%: In booktitle, (editor) .. +% edby-par,edbyx,%: In booktitle (editor..) +% edby-parc,edbyx,%: In booktitle, (editor..) +% edby,edbyy,%: In booktitle, .., editor +% edby-par,edbyy,%: In booktitle (.., editor) +%-------------------- +%CAPITALIZE `EDITOR' OR `EDITED BY' (if editor capitalizable) +% %: (def) `(editor,..)' or `(edited by..)' +% edcap,%: `(Editor,..)' or `(Edited by..)' +%-------------------- +%PUNCTUATION BETWEEN SECTIONS (BLOCKS): +% %: (def) \newblock after blocks +% blk-com,%: Comma between blocks +% blk-com,com-semi,%: Semi-colon between blocks +% blk-com,com-blank,%: Blanks between blocks +% blk-tit,%: Period after titles of articles, books, etc +% blk-tit,tit-col,%: Colon after titles of articles, books, etc + blk-tita,%: Period after titles of articles +% blk-tita,tit-col,%: Colon after titles of articles +%-------------------- +%PUNCTUATION BEFORE NOTES (if not using \newblock) +% %: (def) Notes have regular punctuation + blknt,%: Notes preceded by period +%-------------------- +%PUNCTUATION AFTER AUTHORS: + %: (def) Author block normal +% au-col,%: Author block with colon +%-------------------- +%PUNCTUATION AFTER `IN': + %: (def) Space after `in' +% in-col,%: Colon after `in' +% in-it,%: Italic `in' +% in-col,in-it,%: Italic `in' and colon +% in-x,%: No word `in' +%-------------------- +%`IN' WITH JOURNAL NAMES (if using 'in' with collections) + %: (def) No `in' before journal name +% injnl,%: Add `in' before journal name +%-------------------- +%FINAL PUNCTUATION: + %: (def) Period at very end +% fin-bare,%: No period at end +%-------------------- +%ABBREVIATE WORD `PAGES' (if not using external language file) +% %: (def) `Page(s)' +% pp,%: `Page' abbreviated +% ppx,%: `Page' omitted +%-------------------- +%ABBREVIATE WORD `EDITORS': +% %: (def) `Editor(s)' +% ed,%: `Editor' abbreviated +%-------------------- +%OTHER ABBREVIATIONS: +% %: (def) No abbreviations +% abr,%: Abbreviations +%-------------------- +%ABBREVIATION FOR `EDITION' (if abbreviating words) +% %: (def) `Edition' abbreviated as `edn' +% ednx,%: `Edition' abbreviated as `ed' +%-------------------- +%MONTHS WITH DOTS: +% %: (def) Months with dots +% mth-bare,%: Months without dots +%-------------------- +%EDITION NUMBERS: +% xedn,%: Editions as in database +% %: (def) Write out editions +% ord,%: Numerical editions +%-------------------- +%Reading external language file \cfile=dansk.mbs + dansk,%: Danish language +%ABBREVIATE WORD `PAGES': +% %: (def) `Side(r)' + pp,%: `Side' abbreviated +% ppx,%: `Side' omitted +%-------------------- +%ABBREVIATE WORD `EDITORS': +% %: (def) `Redakt{\o}r(er)' + ed,%: `Redakt{\o}r' abbreviated +%-------------------- +%OTHER ABBREVIATIONS: + %: (def) No abbreviations +% abr,%: Abbreviations +%-------------------- +%EDITION NUMBERS: +% xedn,%: Editions as in database +% %: (def) Write out editions + ord,%: Numerical editions +%-------------------- +%STORED JOURNAL NAMES: + %: (def) Full journal names +% jabr,%: Abbreviated journal names +% jabr,jaa,%: Abbreviated with astronomy shorthands +%-------------------- +%AMPERSAND: + %: (def) Use word `and' +% amper,%: Use ampersand +% varand,%: Use \BIBand +%-------------------- +%COMMA BEFORE `AND': +% %: (def) Comma before `and' + and-xcom,%: No comma before `and' +% and-com,%: Comma even with 2 authors +%-------------------- +%COMMA BEFORE `AND' EVEN FOR COLLECTION EDITORS (if using comma before `and' with authors) +% and-com-ed,%: Comma with 2 editors +% %: (def) Two editors without comma +%-------------------- +%NO `AND' IN REFERENCE LIST: + %: (def) With `and' +% xand,%: No `and' +%-------------------- +%FONT OF `ET AL': + %: (def) Plain et al +% etal-it,%: Italic et al +% etal-rm,%: Roman et al +%-------------------- +%ADDITIONAL REVTeX DATA FIELDS: + %: (def) No additional fields +% revdata,eprint,url,url-blk,%: Include REVTeX data fields +%-------------------- +%E-PRINT DATA FIELD: (without REVTeX fields) + %: (def) Do not include eprint field +% eprint,%: Include eprint and archive fields +%-------------------- +%URL ADDRESS: (without REVTeX fields) +% %: (def) No URL +% url,url-blk,%: Include URL + url,url-nt,%: URL as note +% url,url-nl,%: URL on new line +%-------------------- +%REFERENCE COMPONENT TAGS: + %: (def) No reference component tags +% bibinfo,%: Reference component tags +%-------------------- +%EMPHASIS: (affects all so-called italics) + %: (def) Use emphasis +% em-it,%: Use true italics +% em-x,%: No italics +% em-ul,%: Underlining +%-------------------- +%COMPATIBILITY WITH PLAIN TEX: + nfss,%: Use LaTeX commands +% plntx,%: Use only Plain TeX +%-------------------- +,{% + }} +\generate{\file{daleif.bst}{\MBopts}} +\endbatchfile diff --git a/macros/latex/contrib/dlfltxb/dlfltxbcodetips.pdf b/macros/latex/contrib/dlfltxb/dlfltxbcodetips.pdf Binary files differnew file mode 100644 index 0000000000..b06415ed09 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbcodetips.pdf diff --git a/macros/latex/contrib/dlfltxb/dlfltxbcodetips.sty b/macros/latex/contrib/dlfltxb/dlfltxbcodetips.sty new file mode 100644 index 0000000000..1e6af37180 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbcodetips.sty @@ -0,0 +1,306 @@ +\ProvidesPackage{dlfltxbcodetips}[2010/03/04 v0.5 by Lars 'daleif' Madsen] + +% this pacakge collects some macros presented as code tips in my LaTeX +% book: "Introduktion til LaTeX". As the macros might be useful for +% other than the normal readers of my book, the longer macros are +% collected in this package. + +% This package be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Lars Madsen (daleif@imf.au.dk). +%% + + +% HISTORY +% +% 20070601 Added better implementation of \nuparrow, \ndownarrow and +% \bigtimes, all due to Enrico Gregorio +% also made the environment uded inside \NewShadedTheorem +% configurable. +% 20070604 Karl Ove Hufthammer mentioned that mathdesign does not like +% amssymb, and _does_ implement \nleftarrow \nrightnarrow. The +% package option 'noamssymb' now disables loading amssymb +% 20070606 alternative konstruction of \NewShadedTheorem, now using +% ntheorem konstructions internally +% 20070710 bug fix regarding shadedtheorems, the counter aliasing did +% not work correctly +% 20070711 Bug fixed in \ArrowBetweenLines, the \ifin@ should go +% inside the \noalign, not outside. +% 20080617 added \DeclareMathSymbolShorthand and \DeclareMathSet +% 20080618 redesigned and renamed \PullBack to \MoveEqLeft +% 20080828 added better implementation of \MakeDeclareMathSetCommand +% 20100304 updated for latest release + +\newif\ifdlf@do@load@amssymb +\dlf@do@load@amssymbtrue + +\DeclareOption{noamssymb}{\dlf@do@load@amssymbfalse} + +\ProcessOptions\relax + +\RequirePackage{amsmath} + + + +% \InsertTheoremBreak removes the spacing above the first item, +% \InsertTheoremBreak* does not +\newcommand\InsertTheoremBreak{% + \@ifstar{\item[\vbox{\null}]}{% + \begingroup % keep changes local + \setlength\itemsep{0pt}% + \setlength\parsep{0pt}% + \item[\vbox{\null}]% + \endgroup% + }} + + + +% for making theorems with shaded background +% requires the use of ntheorem, (x)color and framed +% currently only ntheorem is supported (perhaps support for amsthm or +% theorem will be added later) +% has the same syntax as \newtheorem +% +% redesigned 2007/06/06 +\def\theoremframecommand{} +\newcommand\NewShadedTheorem[1]{% + \@ifnextchar[{\NST@levelii{#1}}{\NST@levelii{#1}[]}} +\def\NST@levelii#1[#2]#3{% + \@ifnextchar[{\NST@leveliii{#1}[#2]{#3}}{\NST@leveliii{#1}[#2]{#3}[]}} +\newcommand\NST@helper[1]{% + \edef\@tempa{c@#1}\edef\@tempb{c@#1@inner}% + \expandafter\let\csname\@tempa\expandafter\endcsname\csname\@tempb\endcsname% + \edef\@tempa{p@#1}\edef\@tempb{p@#1@inner}% + \expandafter\let\csname\@tempa\expandafter\endcsname\csname\@tempb\endcsname% + \edef\@tempa{cl@#1}\edef\@tempb{cl@#1@inner}% + \expandafter\let\csname\@tempa\expandafter\endcsname\csname\@tempb\endcsname% + \edef\@tempa{the#1}\edef\@tempb{the#1@inner}% + \expandafter\let\csname\@tempa\expandafter\endcsname\csname\@tempb\endcsname% +} +\def\NST@leveliii#1[#2]#3[#4]{% + \ifx\\#2\\% i.e. no common counter + \ifx\\#4\\% i.e. no dominant counter + \newshadedtheorem{#1@inner}{#3}% + \NST@helper{#1}% + \else% i.e. dominant counter + \newshadedtheorem{#1@inner}{#3}[#4]% + \NST@helper{#1}% + \fi% + \else% i.e. common counter + \newshadedtheorem{#1@inner}[#2]{#3}% + \fi% + \newenvironment{#1}{% + % code stolen from ntheorem.sty + \thm@topsepadd \theorempostskipamount + \ifvmode \advance\thm@topsepadd\partopsep\fi + \trivlist + \@topsep \theorempreskipamount + \@topsepadd \thm@topsepadd + \item + \setlength\theorempreskipamount{0pt}% + \setlength\theorempostskipamount{0pt}% + \begin{#1@inner} + }{\end{#1@inner}\endtrivlist\@endparenv}% + } + + + + +% this implements a stack that holds a user build mathindent +% not easy to explain in words see the documentation +\newtoks\dlf@STACK +\def\dlf@Prepend#1(to:)#2{\toks0={#1}% + \global\edef\act{\global\noexpand#2={\the\toks0 \the#2}}% + \act} +\def\dlf@PopOff#1{\global\edef\act{\global\noexpand\dlf@SplitOff\the#1% + (tail:)\noexpand#1}\act} +\def\dlf@SplitOff#1#2(tail:)#3{#3={#2}} +\newlength\MathIndentLength +\newcommand\MathIndent{\kern\MathIndentLength} +\newcommand\PopMathIndent{% + \@ifstar{\@PopMathIndent\relax}{\@PopMathIndent\MathIndent}} +\newcommand\@PopMathIndent[1]{\dlf@PopOff\dlf@STACK + \settowidth\@tempdimc{\ensuremath{\displaystyle\phantom{\the\dlf@STACK}}} + \setlength{\global\MathIndentLength}{\@tempdimc}#1} +\newcommand\SetMathIndent[1]{\dlf@STACK={}\dlf@Prepend{{#1}}(to:)\dlf@STACK + \settowidth\@tempdimc{\ensuremath{\displaystyle\phantom{\the\dlf@STACK}}} + \setlength{\global\MathIndentLength}{\@tempdimc}#1} +\newcommand\AddtoMathIndent[1]{\dlf@Prepend{{#1}}(to:)\dlf@STACK + \settowidth\@tempdimc{\ensuremath{\displaystyle\phantom{\the\dlf@STACK}}} + \setlength{\global\MathIndentLength}{\@tempdimc}#1} + + +% this constructs a version of \bigtimes. The version here is due to +% Enrico Gregorio, presented in http://groups.google.com/group/comp.text.tex/msg/9685c9405df2ff94 + +\newcommand\dlf@b@gtimes[1]{% + \vcenter{\hbox{#1$\m@th\mkern-2mu\times\mkern-2mu$}}} +\newcommand\dlf@bigtimes{% + \mathchoice{\dlf@b@gtimes\huge} % display style + {\dlf@b@gtimes\LARGE} % text style + {\dlf@b@gtimes{}} % script style + {\dlf@b@gtimes\footnotesize} % script script style +} +\newcommand\bigtimes{\mathop{\dlf@bigtimes}\displaylimits} + + + +\ifdlf@do@load@amssymb + \RequirePackage{amssymb} +\fi + +\RequirePackage{graphicx} + +% better construction for \nuparrow and \ndownarrow, se also +% http://groups.google.com/group/comp.text.tex/msg/689cc8bd604fdb51 +% again due to Enrico Gregorio +% construction requires graphicx +\def\dlf@nrotarrow#1#2{% + \setbox0=\hbox{$\m@th#1\uparrow$}\dimen0=\dp0 + \setbox0=\hbox{% + \reflectbox{\rotatebox[origin=c]{90}{$\m@th#1\mkern2.22mu #2$}}}% + \dp0=\dimen0 \box0 \mkern2.3965mu +} + +% needs to delay things +\AtBeginDocument{ + \@ifundefined{nrightarrow}{% + \PackageWarning{dlfltxbcodetips}{\string\nrightarrow\space not found,^^J + \string\nuparrow\space will not be defined} + }{ + \def\nuparrow{\mathrel{\mathpalette\dlf@nrotarrow\nrightarrow}} + } + + \@ifundefined{nleftarrow}{% + \PackageWarning{dlfltxbcodetips}{\string\nleftarrow\space not found,^^J + \string\ndownarrow\space will not be defined} + }{ + \def\ndownarrow{\mathrel{\mathpalette\dlf@nrotarrow\nleftarrow}} + } +} + + + +\newcommand\ProvidePGFPagesFourOnOneWithSpaceForNotes{% + \@ifpackageloaded{pgfpages}{% + \pgfpagesdeclarelayout{4 on 1 with space for notes} + { \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default + \edef\pgfpageoptionwidth{\the\paperheight} + \def\pgfpageoptionborder{0pt}} + { \pgfpagesphysicalpageoptions{logical pages=4,% + physical height=\pgfpageoptionheight,% + physical width=\pgfpageoptionwidth} + \ifdim\paperheight>\paperwidth\relax + % put side-by-side + \pgfpageslogicalpageoptions{1}{% + border shrink=\pgfpageoptionborder,% + resized width=.25\pgfphysicalwidth,% + resized height=.5\pgfphysicalheight,% + center=\pgfpoint{.125\pgfphysicalwidth}{.75\pgfphysicalheight}}% + \pgfpageslogicalpageoptions{2}{% + border shrink=\pgfpageoptionborder,% + resized width=.25\pgfphysicalwidth,% + resized height=.5\pgfphysicalheight,% + center=\pgfpoint{.625\pgfphysicalwidth}{.75\pgfphysicalheight}}% + \pgfpageslogicalpageoptions{3}{% + border shrink=\pgfpageoptionborder,% + resized width=.25\pgfphysicalwidth,% + resized height=.5\pgfphysicalheight,% + center=\pgfpoint{.125\pgfphysicalwidth}{.25\pgfphysicalheight}}% + \pgfpageslogicalpageoptions{4}{% + border shrink=\pgfpageoptionborder,% + resized width=.25\pgfphysicalwidth,% + resized height=.5\pgfphysicalheight,% + center=\pgfpoint{.625\pgfphysicalwidth}{.25\pgfphysicalheight}}% + \else % stack on top of one another + \pgfpageslogicalpageoptions{1}{% + border shrink=\pgfpageoptionborder,% + resized width=.5\pgfphysicalwidth,% + resized height=.25\pgfphysicalheight,% + center=\pgfpoint{.25\pgfphysicalwidth}{.875\pgfphysicalheight}}% + \pgfpageslogicalpageoptions{2}{% + border shrink=\pgfpageoptionborder,% + resized width=.5\pgfphysicalwidth,% + resized height=.25\pgfphysicalheight,% + center=\pgfpoint{.25\pgfphysicalwidth}{.625\pgfphysicalheight}}% + \pgfpageslogicalpageoptions{3}{% + border shrink=\pgfpageoptionborder,% + resized width=.5\pgfphysicalwidth,% + resized height=.25\pgfphysicalheight,% + center=\pgfpoint{.25\pgfphysicalwidth}{.375\pgfphysicalheight}}% + \pgfpageslogicalpageoptions{4}{% + border shrink=\pgfpageoptionborder,% + resized width=.5\pgfphysicalwidth,% + resized height=.25\pgfphysicalheight,% + center=\pgfpoint{.25\pgfphysicalwidth}{.125\pgfphysicalheight}}% + \fi + } + }{% + \PackageError{dlfltxbcodetips}{\string\ProvidePGFPagesFourOnOneWithSpaceForNotes^^J + can only be used after the pgfpages package have been loaded}{} +}} + + + +\begingroup +\catcode`\_=\active +\gdef\OverloadUnderscoreInMath{% + \protected\gdef_{\@ifnextchar|\subtextup\sb} + \gdef\subtextup|##1|{\sb{\textup{##1}}} + \AtBeginDocument{\catcode`\_=12 \mathcode`\_=32768 } +} +\endgroup +\@onlypreamble\OverloadUnderscoreInMath + + +\@ifundefined{DeclareMathSymbolShorthand}{ + \usepackage{keyval} +\newcommand*\DeclareMathSymbolShorthand[2]{% #1=keyvals, #2=arg. + \begingroup + \setkeys{DMSS}{name=#2,#1}% + \if\DMSS@overwrite % check for overwrite? + \else + \expandafter\@ifdefinable\csname \DMSS@prefix\DMSS@name\endcsname{% + \def\DMSS@overwrite{00}% okay to redefine. + }% + \fi% + \if\DMSS@overwrite % Do definition or not. + \expandafter\@firstofone% + \else\expandafter\@gobble\fi% + {\protected\expandafter% + \xdef\csname \DMSS@prefix\DMSS@name \endcsname{% + \unexpanded\expandafter{\DMSS@format{#2}}}}% + \endgroup} +\define@key{DMSS}{format}{\let\DMSS@format#1} +\define@key{DMSS}{format*}{\def\DMSS@format{\expandafter#1\@firstofone}} +\define@key{DMSS}{name}{\def\DMSS@name{#1}} +\define@key{DMSS}{prefix}{\def\DMSS@prefix{#1}} +\define@key{DMSS}{overwrite}[true]{% + \edef\DMSS@overwrite{\csname if#1\endcsname 00\else 01\fi}} +\setkeys{DMSS}{overwrite=false} +\setkeys{DMSS}{format*=} +\newcommand\MakeDeclareMathSetCommand[3]{% + % #1 = command name + % #2 = default prefix name + % #3 = default format + % make format macro for eacy reference + \expandafter\MakeDeclareShorthandCommandAux\csname math#2format\endcsname + {#1}{#2}{#3}} +\def\MakeDeclareShorthandCommandAux#1#2#3#4{% + \newcommand*#1{#4}% + \newcommand*#2[2][]{% + \DeclareMathSymbolShorthand{format=#1,prefix=#3,##1}{##2}% + }} +\MakeDeclareMathSetCommand{\DeclareMathSet}{numbers}{\mathbb} +}{} % is defined already so do nothing + + + diff --git a/macros/latex/contrib/dlfltxb/dlfltxbcodetips.tex b/macros/latex/contrib/dlfltxb/dlfltxbcodetips.tex new file mode 100644 index 0000000000..fb5316d2de --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbcodetips.tex @@ -0,0 +1,465 @@ +\RequirePackage{etex} +\documentclass[11pt,oneside,a4paper,oldfontcommands,danish,english,article]{memoir} +\usepackage[latin1]{inputenc} +\usepackage{babel} +\usepackage[T1]{fontenc} +\usepackage[widespace]{fourier} + +\setlxvchars[\normalfont] + +\settypeblocksize{*}{1.3\lxvchars}{1.618} + +\setlrmargins{*}{*}{0.7} +\setulmargins{*}{*}{1} +\setlength\marginparwidth{3.5cm} + +\checkandfixthelayout + + +\hfuzz=30pt + +\setfootnoterule[\vfill]{3pt}{0.4\columnwidth}{\normalrulethickness} + +\usepackage{color} +\usepackage[colorlinks,breaklinks]{hyperref} +\definecolor{linkcolour}{rgb}{0,0.2,0.6} +\definecolor{citecolour}{rgb}{0,0.6,0.2} +\definecolor{urlcolour} {rgb}{0.8,0,0.8} +\definecolor{nicered}{rgb}{.647,.129,.149} + + +\hypersetup{ + pdftitle={The dlfltxbcodetips package}, + pdfauthor={Copyright \textcopyright\ \number\year\ Lars Madsen}, + linkcolor=linkcolour,citecolor=citecolour, + filecolor=urlcolour,urlcolor=urlcolour, + plainpages=false, +} + +\ifpdf\else\usepackage{breakurl}\fi +\usepackage{memhfixc} + +\clubpenalty=300 +\widowpenalty=300 + +\usepackage{microtype} + +\usepackage{amsmath,amssymb} +\usepackage[amsmath,thmmarks,framed]{ntheorem} +\usepackage[round]{natbib} + +\usepackage{dlfltxbcodetips} +\OverloadUnderscoreInMath + +\usepackage[loadsampleconfig]{dlfltxbmarkup} +\renewcommand\felineMarginAdjustment{\RaggedLeft} + + + +\usepackage{dlfltxbmisc} +\usepackage{graphicx} + +\chapterstyle{article} + +\setsecheadstyle{\normalfont\large\bfseries\raggedright} + + +\reversemarginpar +\reversesidepartrue + +\definecolor{shadecolor}{gray}{0.8} +\theorembodyfont{\normalfont} +\theoremseparator{.} +\def\theoremframecommand{\colorbox{shadecolor}} + +\theoremstyle{nonumberplain} + +\NewShadedTheorem{caveat}{Caveat} + +\NewShadedTheorem{remark}{Remark} + +% until dlfltxbsd is released we will have to use the following +% construction + +\usepackage{fancyvrb} +\fvset{fontsize=\footnotesize} + +\newcommand\verbfile{\jobname.vrb} +\newenvironment{sourcedisplay}{% +\par\vskip0.5\baselineskip\noindent +\VerbatimOut{\verbfile}}{% +\endVerbatimOut% +\noindent +\begin{minipage}{0.48\linewidth} +\VerbatimInput{\verbfile} +\end{minipage} +\hfill +\begingroup% +\begin{minipage}{0.48\linewidth} +\begin{framed} +\input{\verbfile} +\end{framed} +\end{minipage} +\endgroup\vskip0.5\baselineskip} + + +\newenvironment{Sourcedisplay}{% +\par\vskip0.5\baselineskip\noindent +\VerbatimOut{\verbfile}}{% +\endVerbatimOut% +\noindent +\begin{minipage}{\linewidth} +\VerbatimInput{\verbfile} +\end{minipage} +\par\bigskip\noindent +\begin{minipage}{\linewidth} +\begin{framed} +\input{\verbfile} +\end{framed} +\end{minipage} +\vskip0.5\baselineskip} + + +\pagestyle{plain} +\newcommand\note[1]{\textcolor{nicered}{\sffamily #1}} + + +\hyphenation{Provide-PGF-Pages-Four-On-One-With-Space-For-Notes} +\hyphenation{Overload-Underscore-In-Math} + +\begin{document} + +\title{Code tips from ``Introduktion til \LaTeX''\thanks{Version: 0.2}\\{\normalsize Or just the + \textsf{\jobname} package}} +\author{Lars Madsen\thanks{Web: + \url{http://home.imf.au.dk/daleif}\qquad Email: \url{daleif@imf.au.dk}}} +\maketitle + +\tableofcontents* + +\setsecnumdepth{part} + +\chapter{Introduction} +\label{cha:introduction} + +In my \LaTeX\ book \citep{ltxb} we present some macros that might be +helpful to the readers. Some of these extra macros might be useful to +others as well so these macros have been included in the +\markup[nomk,sty]{dlfltxbcodetips} package. The package is published on \textsc{ctan} and the +package is released under the normal lppl license. + +The >>\texttt{dlfltxb}<< part of the name simply stands for >>daleif<< +and \LaTeX\ book. The \markup[nomk,sty]{dlfltxbcodetips} package is the first +package in the >>\texttt{dlfltxb}<<-bundle which, over time, will +contain most of the home made packages that I use to create my book +(though not the book source itself). + +Some of the macros might be better of included in the +\markup[nomk,sty]{mathtools} package by Morten Høgholm, but he is quite busy +elsewhere at the moment. + +\bigskip + +%\newpage +\noindent +\emph{Note:} The macro \verb+\dbx+ will often be used to simulate some +text or mathematical material. + +\setsecnumdepth{section} + +\chapter{Extra symbols} +\label{cha:extra-symbols} + +\section{\texorpdfstring{A big version of \cs{times}}{A big version of + \textbackslash times}} +\label{sec:big-version-cstimes} + + + +A few extra symbols have been created. First of is \markup{bigtimes} +which is a large operator version of \markup[nomk]{times}, but without +having to load special fonts.\footnote{Updated version due to Enrico Gregorio.} +\begin{sourcedisplay} +$\bigtimes_{n=1}^k A_n$ +\[ \bigtimes_{n=1}^k A_n \] +\end{sourcedisplay} + +\section{Negated up- and downarrows} +\label{sec:negat-up-down} + +The package creates \markup{nuparrow} and \markup{ndownarrow} by +rotating and reflecting \markup[nomk]{nrightarrow} and +\markup[nomk]{nleftarrow} +respectively.\addtocounter{footnote}{-1}\footnotemark +\begin{sourcedisplay} +$ A \nuparrow B$ \qquad +$ B \ndownarrow C$ +\end{sourcedisplay} + +\begin{remark} + The \markup[nomk,sty]{mathdesign} package is incompatible with + \markup[nomk,sty]{amssymb}, but it does define the symbols we need + from it to define \cs{nuparrow} and \cs{ndownarrow}. Use + \begin{syntax} + \verb|\usepackage[noamssymb]{dlfltxbcodetips}| + \end{syntax} + to disable the autoloading of \markup[nomk,sty]{amssymb}, and + remember to load \markup[nomk,sty]{dlfltxbcodetips} \emph{after} + \markup[nomk,sty]{mathdesign}. +\end{remark} + + +\chapter{Fun with theorems} +\label{cha:fun-with-theorems} + +\section{Shaded or framed theorems with the ntheorem package} +\label{sec:shaded-theorems-with} + +The \markup[nomk,sty]{ntheorem} pacakge can create shaded or framed +theorems, but they take up to much space (in my opinion). So we make +our own macro \markup{NewShadedTheorem}. It has exactly the same +syntax as the ordinary \markup[nomk]{newtheorem}. Requirements: the +\markup[nomk,sty]{framed}, \markup[nomk,sty]{ntheorem} (loaded with +the \texttt{framed} option), and \markup[nomk,sty]{color} or +\markup[nomk,sty]{xcolor}. You will have to redefine +\markup{theoremframecommand} to get a background color or a +frame. This package initialises \markup[nomk]{theoremframecommand} to +do nothing. +\begin{caveat} + The theorem environment constructed will not have a stared companion + as \markup[nomk,sty]{ntheorem}s normal \markup[nomk]{newtheorem} does. +\end{caveat} +\begin{sourcedisplay} +\def\theoremframecommand{\fboxsep=10pt\fbox} +\NewShadedTheorem{sthm}{Theorem}[chapter] +\def\theoremframecommand{% +\colorbox{red}} +\NewShadedTheorem{slemma}[sthm]{Lemma} +\newtheorem{prop}[sthm]{Proposition} +\begin{sthm} + normal test. +\end{sthm} +\begin{slemma} + a lemma. +\end{slemma} +\begin{prop} + a theorem with no background. +\end{prop} +\end{sourcedisplay} + +\theoremstyle{plain} +\newtheorem{thm}{Theorem} + +\section{Theorems that start with a list} +\label{sec:theorems-that-start} + +A theorem that starts with a list looks odd because the first item +comes directly after the heading.\footnote{Depends on the + configuration.} +\begin{sourcedisplay} +\begin{thm} + \begin{enumerate} + \item \dbx[2cm] + \item \dbx[2cm] + \item \dbx[2cm] + \end{enumerate} +\end{thm} +\end{sourcedisplay} +The macro \markup{InsertTheoremBreak} helps. +\begin{sourcedisplay} +\begin{thm} + \InsertTheoremBreak + \begin{enumerate} + \item \dbx[2cm] + \item \dbx[2cm] + \item \dbx[2cm] + \end{enumerate} +\end{thm} +\begin{thm} + \InsertTheoremBreak* + \begin{enumerate} + \item \dbx[2cm] + \item \dbx[2cm] + \item \dbx[2cm] + \end{enumerate} +\end{thm} +\end{sourcedisplay} +\noindent The un-stared version remove the space above the list, the +stared version does not. + +\begin{caveat} + If the theorem comes too close to a page break it is quite likely + that the page break will end up between the theorem header and the + start of the list. +\end{caveat} + +\chapter{Various features regarding alignment} +\label{cha:vari-feat-regard} + + + +\section{Alignment with material encased in delimiters on different lines} +\label{sec:alignm-with-mater} + +Swanson also recommends that if one has material encased with +delimiters and the delimiters are on different lines, then if space +permits, the material should be indented such that the relationship is +evident. Usually we would use a \markup[nomk]{phantom} to do this, +such as in the next example. +\begin{sourcedisplay} +\begin{align*} + \dbx[5mm]&= \dbx[5mm]\bigl[{} \dbx[3cm]\\ + &\phantom{=\dbx[5mm]\bigl[{}} + \times \dbx[3cm]{}\\ + &\phantom{=\dbx[5mm]\bigl[{}} + - \dbx[3cm]{}\bigr]\\ + &=\dbx[3cm] +\end{align*} +\end{sourcedisplay} +The problem with this is that it gets tedious and prone to human +error. How about instead maintaining a stack of material determining +the indentation together with tools to reset, add to and pop the +stack. For this you can use the following macros +\begin{syntax} + \markup{MathIndent} + \markup{SetMathIndent}\marg{math code} + \markup{AddtoMathIndent}\marg{math code} + \markup{PopMathIndent} + \markup{PopMathIndent*} +\end{syntax} +\markup[nomk]{MathIndent} is used to set a space corresponding to the +current indentation saved on the stack. \markup[nomk]{SetMthIndent} +takes its argument and saves it on the stack, calculates the current +math indent length and ends by typesetting the given argument, i.e. no +need to copy anything. Similarly the \markup[nomk]{AddtoMathIndent} +adds it argument to the stack and adds the length of it to the saved +math indent. So instead of copying code, now we simply encase it with +either \markup[nomk]{SetMathIndent} (for the initialisation) or +\markup[nomk]{AddtoMathIndent}. \markup[nomk]{PopMathIndent} is +similar to \markup[nomk]{MathIndent}, in that it sets a blank space +corresponding to the contents of the stack after we have popped off +the top item. \markup[nomk]{PopMathIndent*} pops the stack but does +\emph{not} set any space. + + +Now, an illustrative example might be in order: +\begin{Sourcedisplay} +\begin{align*} +\dbx ={} & \SetMathIndent{\dbx[1cm] \Bigl[} \dbx[6cm] \\ + & \MathIndent + \dbx[7cm] \\ + & \MathIndent + \AddtoMathIndent{{} + \dbx \Bigl\{} + \AddtoMathIndent{\dbx[2cm] + \Bigl(} \dbx[4cm] \\ + & + \MathIndent + \dbx[4cm] \Bigr) \\ + & \PopMathIndent + \dbx[6cm] \Bigr\} \\ + & \PopMathIndent + \dbx[6cm] \Bigr] +\end{align*} +\end{Sourcedisplay} +Notice the dual use of \markup[nomk]{AddtoMathIndent} such that we can +return to the indentation set by the >>\texttt{\{}<<. + +Of course, non-balanced \markup[nomk]{left}--\markup[nomk]{right} +constructions may not be used. + + + + +\chapter{Declaring sets} +\label{cha:declaring-sets} + +\emph{This still needs some work} + + +It is a good idea to avoid the one (or two) letter shortcuts for sets +etc., e.g.\ \verb+\R+ for \verb+\mathbb{R}+, it can cause problems +when co-writing articles with people with other naming habits. + +To help with this we provide +\begin{syntax} +\markup{DeclareMathSet}\oarg{options}\marg{identifier} +\end{syntax} +By default it can be used as +\begin{Sourcedisplay} +\DeclareMathSet{R}% => \numbersR = \mathbb{R} +$ \numbersR $ +\end{Sourcedisplay} +But we have several options to change things. Options +(\Arg{key}=\Arg{value} style, note that \Arg{identifier} is what is +given to the formating macro). +\begin{description}\firmlist +\item[format] the macro used to format the output, default: \verb|\mathbb| +\item[name] this defaults to \Arg{identifier}, but can be used to + change a part of the macro name, + e.g. \verb+\DeclareMathSet[name=Cat,format=\matcal]{C}+ results in + \verb+\setCat=\mathcal{C}+. +\item[prefix] this defaults to \verb+set+, but one might want to use + \begin{syntax} + \verb+\DeclareMathSet[prefix=group,format=\mathrm]{U}+ + \end{syntax} +to get + \verb+\groupU+, the unitary group. +\item[overwrite] boolean, if true, then you can overwrite an existing + macro, otherwise it will throw an error. + +\end{description} +Note that for sets it is not a good idea to declare them as math +operators, as some mathematical operations take sets as their +argument, so the spacing before an operator would be wrong in that +case. + +\note{Note that this will also be added to the mathtools package, and + then removed from this package} + +\chapter{Misc} +\label{cha:misc} + +\section{Additional layout for the \textsf{pfgpages} package} +\label{sec:addit-layo-textsfpfg} + +The macro \markup{ProvidePGFPagesFourOnOneWithSpaceForNotes} will +activate a \linebreak >>\verb*+4 on 1 with space for notes+<< layout to be used +with the \markup[sty,nomk]{pgfpages} package. It is basically the same +as the >>\verb*+8 on 1+<< layout but leaving the second column empty +for reader to fill in their own notes. + +\section{Overloading \texttt{\_} in math-mode} +\label{sec:overl-texttt_-math} + +Placing \markup{OverloadUnderscoreInMath} in the preamble will +overload the \texttt{\_} character in math-mode such that +\begin{Sourcedisplay} +\[ + X_{ab} = X_|max| +\] +\end{Sourcedisplay} +that is \verb+_|...|+ is that same as \verb+_{\textup{...}}+. + +\bibliographystyle{plainnat} +\bibliography{package_doc} + + + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% TeX-source-specials-mode: t +%%% TeX-PDF-mode: nil +%%% End: + + + + + + + + + + + + + + + diff --git a/macros/latex/contrib/dlfltxb/dlfltxbmarkup-showkeys.pdf b/macros/latex/contrib/dlfltxb/dlfltxbmarkup-showkeys.pdf Binary files differnew file mode 100644 index 0000000000..c6e23a2dd4 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbmarkup-showkeys.pdf diff --git a/macros/latex/contrib/dlfltxb/dlfltxbmarkup-showkeys.tex b/macros/latex/contrib/dlfltxb/dlfltxbmarkup-showkeys.tex new file mode 100644 index 0000000000..7449c59615 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbmarkup-showkeys.tex @@ -0,0 +1,29 @@ +\documentclass[a4paper,twocolumn]{memoir} +\setlrmarginsandblock{2.5cm}*1 +\checkandfixthelayout +\newoutputstream{showkeys} +\openoutputfile{\jobname.keys}{showkeys} +\addtostream{showkeys}{\protect\begin{description}} +\newcommand\felineMarkupDescription[5]{% + \addtostream{showkeys}{\protect\item[#1] #2 }% +} +\usepackage[loadsampleconfig]{dlfltxbmarkup} +%\usepackage{dlfltxbmarkup} +\usepackage{calc,enumitem} +\setdescription{style=nextline,font=\ttfamily} +\addtostream{showkeys}{\protect\end{description}} +\closeoutputstream{showkeys} +\pagestyle{plain} +\addtolength\columnsep{1cm} +\setlength\columnseprule{0.4pt} +\begin{document} +\raggedright +\twocolumn[\section*{Key descriptions for the current setting of the + \texttt{dlfltxbmarkup} package}] +\input{\jobname.keys} +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/macros/latex/contrib/dlfltxb/dlfltxbmarkup.pdf b/macros/latex/contrib/dlfltxb/dlfltxbmarkup.pdf Binary files differnew file mode 100644 index 0000000000..c652254d17 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbmarkup.pdf diff --git a/macros/latex/contrib/dlfltxb/dlfltxbmarkup.sty b/macros/latex/contrib/dlfltxb/dlfltxbmarkup.sty new file mode 100644 index 0000000000..a94d4e3011 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbmarkup.sty @@ -0,0 +1,289 @@ +\ProvidesPackage{dlfltxbmarkup}[2008/08/05 v0.70 by daleif] + +% This package be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Lars Madsen (daleif@imf.au.dk). +%% + + + +\@ifclassloaded{memoir}{}{% + \PackageError{felinemarkup}{This package depends on several internal + components of the memoir class and therefore need the memoir + class}{Use the memoir class} +} + + + +\RequirePackage{keyval} +\RequirePackage{ragged2e} + + +\DeclareOption{loadsampleconfig}{\AtEndOfPackage{ + %\InputIfFileExists{dlfltxbmarkup-sample.cfg}{}{} + \IfFileExists{dlfltxbmarkupbookkeys.sty}{ + \RequirePackage{dlfltxbmarkupbookkeys} + }{ + \PackageError{dlfltxbmarkup}{Sample configuration package + 'dlfltxbmarkupbookkeys' not found, option 'loadsampleconfig' + is useless.}{} + } +}} + +\ProcessOptions\relax + + + +% HISTORY +% <2007 this package dates back to at least 2004 +% 2007/03/20 added \color{black} to the margin writing devices, since +% color at a line boundary may extend out into the margin +% 2007/03/21 added inputenc keyword +% 2007/03/21 added counter keyword +% 2007/03/21 added length keyword +% 2007/03/22 added gauss keyword +% 2007/03/23 added tabs keyword +% 2007/03/23 added nbop keyword +% 2007/03/24 fixed a bug in tabs +% 2007/03/24 fixed loads more index errors +% 2007/04/27 added \hspace{0pt} to \MarkWMargin to activate automatic hyphenation +% 2007/04/30 added \feline@MWM@inner to get better source re-use +% 2007/05/05 fixed a margin placement problem by adding \leavevmode +% in front of \checkoddpage in \feline@MWM@inner, fix +% supplied by Peter Wilson, after I submitted a bug report +% about it. +% 2007/05/10 started adding support for key explanations, planning to +% make it possible to print a generated overview of the +% regisered keys +% 2007/05/14 all keys for my book project have now been moved to +% felinemarkup.cfg, which wil be loaded at the end of the +% package, if the 'loadfelinemarkupconfig' package option +% is given +% 2007/05/15 \feline@index@cmd renamed to \felineIndexCmd +% 2007/05/16 package renamed to dlfltxbmarkup +% 2008/01/10 added a strut inside the macro that writes in the margin, +% 2008/10/30 'sample configuration' has been renamed + + + +% this boolean is meant to be used for example inside constructions +% that will not permit the use of \marginpar, for example the +% environments 'framed' and 'shaded', then \MarkWMargin will use +% \sidepar instead of \marginpar + +\@ifundefined{ifNoMarginparAvail}{% + \newif\ifNoMarginparAvail + \NoMarginparAvailfalse +}{} + + +\newcommand\felineMarginAdjustment{% + \ifoddpage\RaggedRight\else\RaggedLeft\fi} + + +% typesets the material in the margin +% we use \checkoddpage (assuming the use of \strictpagechecktrue) to +% perform a rigid test on whether or not we are on an odd page +% \RaggedRight \RaggedLeft is used to get the test 'mashed' up against +% the text, and to permit hyphenation. If the material in #1 is using +% typewriter font, then it is #1's responsability to ensure that +% hyphenation is possible in that font +\newcommand\feline@MWM@inner[1]{% + \parbox[t]{\marginparwidth}{% + \leavevmode\checkoddpage% needs \leavevmode since \checkoddpage + % leaves a whatsit +% \ifoddpage\RaggedRight\else\RaggedLeft\fi% + \felineMarginAdjustment% + {\slshape\scriptsize\strut\hspace{0pt}\color{black} #1\strut\par}}} + +% this might not belong here, but we will leave it for now +\strictpagechecktrue% +\reversesideparfalse% + +% the main macro to write in the margin with +\newcommand\felineWriteInMargin[1]{% + \ifNoMarginparAvail% + \sidepar{\feline@MWM@inner{#1}}% + \else% + \if@feline@forcesidepar% + \sidepar{\feline@MWM@inner{#1}}% + \else% + \marginpar{\feline@MWM@inner{#1}}% + \fi% + \fi% +}% + + +% because of a possible babel use, and its active charecters (in +% danish, " is an active character, it seems that we cannot directly +% add automatic english hyphenation to \cs and \css, in most cases it +% can be added by hand to the macros specified in \FelineKeyGenerator +% see felinemarkup.cfg +\DeclareRobustCommand\cs[1]{% + \textnormal{\texttt{\symbol{'134}#1}}} + +\@ifpackagewith{babel}{english}{ + \DeclareRobustCommand\css[1]{% + \textnormal{\texttt{% + \protect\makebox[0pt][r]{\symbol{'134}}% + \foreignlanguage{english}{\cs{\hyphenchar\font=`\-#1}}}}} +}{ + \DeclareRobustCommand\css[1]{% + \textnormal{\texttt{% + \protect\makebox[0pt][r]{\symbol{'134}}% + {#1}}}} +} + +% indexing commands, first just two alias macros +\newcommand\textitindex[1]{\textit{#1}} +\newcommand\textbfindex[1]{\textbf{#1}} +% then two different indexing macros, one for italic index entries and +% one for bold. we use them like this to avoid expansion problems (or +% at least try to) +\newcommand\itindex[1]{\index{#1|textitindex}} +\newcommand\bfindex[1]{\index{#1|textbfindex}} +% default indexing command, we change this using the idxit, idxbf keys +\newcommand\felineIndexCmd{\index} + + +% --------------------------------------------------------------------------- + + + +% just initial definitions +\newcommand*\feline@margin[1]{\par margin: #1\par} +\newcommand*\feline@index[1]{\par index: #1\par} +\newcommand*\feline@text[1]{\par text: #1\par} + +% just a shortcut, amsmath makes the same one +\let\@xp\expandafter + +\define@key{FelineIndex}{empty}[]{% + \renewcommand*\feline@margin[1]{\par margin: ##1\par}% + \renewcommand*\feline@index[1]{\par index: ##1\par}% + \renewcommand*\feline@text[1]{\par text: ##1\par}% +} + +% whether or not to write the text part +\newif\if@feline@txt \@feline@txttrue +% whether or not to write in the margin +\newif\if@feline@mrgn \@feline@mrgntrue +% whether or not to add to the index +\newif\if@feline@idx \@feline@idxtrue +% force the use of sidepar instead of the usual marginpar +\newif\if@feline@forcesidepar +% whether or not to let \markup add a \hspace{0pt} in the text +% don't know it this is still needed +\newif\if@feline@hsp + +% basically stolen from another package +\newcommand*\dlf@M@setbool[2]{% + \csname #2\ifx\relax#1\relax true \else #1\fi\endcsname} + +% switch off keys +\define@key{FelineIndex}{notxt} []{\@feline@txtfalse} % = nowr +\define@key{FelineIndex}{nowr} []{\@feline@txtfalse} % no writing in text +\define@key{FelineIndex}{nomk} []{\@feline@mrgnfalse} % no mark in margin +\define@key{FelineIndex}{noidx} []{\@feline@idxfalse} % no adding index + +\define@key{FelineIndex}{hsp} []{\@feline@hsptrue} + +% locally use a different index command +\define@key{FelineIndex}{idxit} []{\renewcommand\felineIndexCmd{\itindex}} +\define@key{FelineIndex}{idxbf} []{\renewcommand\felineIndexCmd{\bfindex}} +\define@key{FelineIndex}{idxn} []{\renewcommand\felineIndexCmd{\index}} + +% \sidepar's are non-floating objects so they does not move by them +% self, we need to help if needed, the argument should be a number +% (the unit will be \onelineskip) +\newlength\feline@spvs@addto +\setlength\feline@spvs@addto{0pt} +\define@key{FelineIndex}{addtospvrt}{\addtolength{\feline@spvs@addto}{#1\onelineskip}} +\define@key{FelineIndex}{vaddtosp} {\addtolength{\feline@spvs@addto}{#1\onelineskip}} + +% force the use of \sidepar, don't think I've ever used this +\define@key{FelineIndex}{forcesidepar}[true]{\dlf@M@setbool{#1}{@feline@forcesidepar}} + +% by default this macro does nothing, the idea behind it is to use +% this in an external document to generate a list of key names and +% descriptions (using the first two arguments) +\providecommand\felineMarkupDescription[5]{} + +% key generator macro, has the following arguments +% #1: name of the key +% #2: description of what this key is for +% #3: code for margin command +% #4: code for index command +% #5: code for text command +% and does the following: +% * creates \feline@margin@<key>, \feline@index@<key> and +% \feline@text@<key> +% * the \define@key part then performs three \let's: +% \let\feline@margin\feline@margin@<key> etc. +% when using \FelineKeyGenerator, #1 refers to the main argument given +% to \markup +\newcommand\felineKeyGenerator[5]{% + \felineMarkupDescription{#1}{#2}{#3}{#4}{#5}% + \global\define@key{FelineIndex}{#1}[]{% + \global\@xp\@xp\@xp\let\@xp\@xp\@xp\feline@margin\@xp\csname feline@margin@#1\endcsname% + \global\@xp\@xp\@xp\let\@xp\@xp\@xp\feline@index\@xp\csname feline@index@#1\endcsname% + \global\@xp\@xp\@xp\let\@xp\@xp\@xp\feline@text\@xp\csname feline@text@#1\endcsname% + }% + \@namedef{feline@margin@#1}##1{#3}% + \@namedef{feline@index@#1}##1{#4}% + \@namedef{feline@text@#1}##1{#5}% +} + +% standard key er lavet ned i \setkeys, da \markup[notxt]{...} ellers ikke vil +% vaere det samme som \markup[macro,notxt]{...} + +% this is the main macro, take two arguments, a optional argument for +% key controls and the mandatory arguments for the think we want to +% markup +% note the it starts by setting the \feline@std@key which will be the +% stadard key used if the optional argument is empty or the other keys +% does not alter the \feline@margin, \feline@text and \feline@index +\newcommand\markup[2][]{% +% \@bsphack + \begingroup% + \setkeys{FelineIndex}{\felineStandardKey}% + \setkeys{FelineIndex}{#1}% + \ifdim\feline@spvs@addto>0pt% + \addtolength\sideparvshift{\feline@spvs@addto}% + \fi% + \if@feline@txt\feline@text{#2}\fi% + \if@feline@idx\phantomsection\feline@index{#2}\fi% + \if@feline@mrgn\if@feline@hsp\hspace{0pt}\fi\feline@margin{#2}\fi% + \@feline@txttrue% + \@feline@mrgntrue% + \@feline@idxtrue% + \endgroup% +% \@esphack +} + +% default generated key used by \markup, in the example setup 'macro' +% is used +\def\felineStandardKey{test} + +% test key +\felineKeyGenerator{test} + {test key, does not do anything useful}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1}}% + {\emph{#1}} + + + +\InputIfFileExists{dlfltxbmarkup.cfg}{}{} + + + + diff --git a/macros/latex/contrib/dlfltxb/dlfltxbmarkup.tex b/macros/latex/contrib/dlfltxb/dlfltxbmarkup.tex new file mode 100644 index 0000000000..2fc969ca62 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbmarkup.tex @@ -0,0 +1,333 @@ +\RequirePackage{etex} +\documentclass[11pt,oneside,a4paper,oldfontcommands,danish,english,article]{memoir} +\usepackage[T1]{fontenc} +\usepackage[widespace]{fourier} +\usepackage{babel} +\usepackage{calc} +\usepackage[round]{natbib} + +\makeatletter +\DeclareRobustCommand{\LaTeX}{L\kern-.28em% + {\sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\sf@size\z@ + \math@fontsfalse\selectfont + A}% + \vss}% + }% + \kern-.15em% + \TeX} +\makeatother + +\setlxvchars[\normalfont] + +\settypeblocksize{*}{1.3\lxvchars}{1.618} + +% for print +\setlrmargins{*}{*}{1.6} +\setulmargins{*}{*}{1.3} + +% for online +\setlrmargins{*}{*}{0.7} +\setulmargins{*}{*}{1} +\setlength\marginparwidth{4cm} + +\checkandfixthelayout + + +\hfuzz=30pt + +\newif\ifhyperlinks +\hyperlinksfalse +\hyperlinkstrue + +\ifhyperlinks +\usepackage{nameref} +\fi + +\ifhyperlinks + \usepackage{color} + \usepackage[colorlinks,breaklinks]{hyperref} + \definecolor{linkcolour}{rgb}{0,0.2,0.6} + \definecolor{citecolour}{rgb}{0,0.6,0.2} + % \definecolor{filecolor}{rgb}{0,0.2,0.6} + \definecolor{urlcolour} {rgb}{0.8,0,0.8} + + \hypersetup{ + pdftitle={The dlfltxbmarkup package}, + pdfauthor={Copyright \textcopyright\ number\year\ Lars Madsen}, + linkcolor=linkcolour,citecolor=citecolour, + filecolor=urlcolour,urlcolor=urlcolour, + plainpages=false, + } + + \ifpdf\else\usepackage{breakurl}\fi + \usepackage{memhfixc} +\fi + +\clubpenalty=300 +\widowpenalty=300 + + +\ifpdf +\usepackage[protrusion=true,expansion=true]{microtype} +\else +\usepackage[protrusion=true]{microtype} +\fi + +\makeatother + + +\usepackage[loadsampleconfig]{dlfltxbmarkup} +\usepackage{dlfltxbmisc} + +\renewcommand\felineMarginAdjustment{\RaggedLeft} + +\setlength\marginparsep{2em} +\setlength\marginparwidth{3cm} + +\chapterstyle{article} + +\setsecheadstyle{\normalfont\large\bfseries\raggedright} + + +\reversemarginpar +\reversesidepartrue +\twocolumnfootnotes + +\setsecnumdepth{part} + +\pagestyle{plain} + +\hyphenation{felineWrite-InMargin felineMargin-Adjustment} + +\begin{document} + +\title{The \textsf{dlfltxbmarkup} package\thanks{Version: 0.6}} +\author{Lars Madsen\thanks{Email: daleif@imf.au.dk}} +\maketitle + +\noindent +This package implements the \markup[nomk]{markup} features that are +used extensively in \cite{ltxb}. + + +\section{Requirements} +\label{sec:requirements} + +This package depends on several \markup[nomk,cls]{memoir} internals so +it can only be used together with the \markup[nomk,cls]{memoir} +class. Further requirements are \markup[nomk,sty]{keyval} and +\markup[nomk,sty]{ragged2e}. + + +\section{Usage} +\label{sec:usage} + +The \markup[nomk]{markup} macro is intended to be used for +categorising various types of keywords. These can then be +automatically written in the text as well as in the (outer) margin and +added to the index. +\begin{syntax} + \markup{markup}\oarg{keys}\marg{text} +\end{syntax} +The key list is a mix of control keys and user defined category +keys. How to created the user defined keys are explained later. +The control keys are listed below. +\begingroup +\renewcommand\descriptionlabel[1]{% + \hspace\labelsep% + \settowidth\unitlength{\texttt{#1}}% + \addtolength\unitlength{\labelsep}% + \ifdim\unitlength>\leftmargin% + \parbox[t]{\textwidth}{\normalsize\texttt{#1}}% + \else% + \parbox[t]{\leftmargin-\labelsep}{\normalsize\texttt{#1}}% + \fi% +} +\begin{description}\firmlist\firmlist +\small +%\define@key{FelineIndex}{notxt} []{\@feline@txtfalse} % = nowr +\item[notxt] do not write anything in the text + +%\define@key{FelineIndex}{nowr} []{\@feline@txtfalse} % no writing in text +\item[nowr] alias for \texttt{notxt} +%\define@key{FelineIndex}{nomk} []{\@feline@mrgnfalse} % no mark in margin +\item[nomk] do not write anything in the margin +%\define@key{FelineIndex}{noidx} []{\@feline@idxfalse} % no adding index +\item[noidx] do not add anything to the index +%\define@key{FelineIndex}{hsp} []{\@feline@hsptrue} +%\item[hsp] secret +% locally use a different index command +%\define@key{FelineIndex}{idxit} []{\renewcommand\feline@index@cmd{\itindex}} +\item[idxit] index entry in italic (i.e. page number in italic) +%\define@key{FelineIndex}{idxbf} []{\renewcommand\feline@index@cmd{\bfindex}} +\item[idxbf] index entry in bold face +%\define@key{FelineIndex}{idxn} []{\renewcommand\feline@index@cmd{\index}} +\item[idxn] normal index entry + +%\define@key{FelineIndex}{addtospvrt}{\addtolength{\feline@spvs@addto}{#1\onelineskip}} +\item[addtospvrt=\Arg{number}] to be used in situations where we use + \markup[nomk]{sidepar} instead of \markup[nomk]{marginpar}. This key + will move the text further down in the margin. It is a unit-less + number (\markup[length,nomk]{onelineskip} is the unit). + +%\define@key{FelineIndex}{vaddtosp} {\addtolength{\feline@spvs@addto}{#1\onelineskip}} + +\item[vaddtosp=\Arg{number}] alias for \texttt{addtospvrt} + +% force the use of \sidepar, don't think I've ever used this +%\define@key{FelineIndex}{forcesidepar}[true]{\dlf@M@setbool{#1}{@feline@forcesidepar}} + \item[forcesidepar] forces the use of \markup[nomk]{sidepar} instead + of \markup[nomk]{marginpar} + +\end{description} +\endgroup +\noindent +The package has one option >>\texttt{loadsampleconfig}<< which +will auto load the\linebreak >>\path{dlfltxbmarkup-sample.cfg}<< sample file (which +actually contains the categories that I use for the creation of +\cite{ltxb}). + + +\section{Defining your own categories} +\label{sec:defining-your-own} + +The main macro for defining your own category keys are +\begin{syntax*} + \markup{felineKeyGenerator}\marg{key}\marg{description}\marg{margin + code}\marg{index code}\marg{text code} +\end{syntax*} +In each of the last three arguments >>\texttt{\#1}<< will refer to the +mandatory argument given to \markup[nomk]{markup}. The reason for +adding the \Arg{description} part will be explained later. For the +code to be used in the three last arguments we have a few helper +macros that might be useful +\begin{syntax} + \markup{cs}\marg{text} +\end{syntax} +for writing the name of \LaTeX\ macros. +\begin{syntax} + \markup{css}\marg{text} +\end{syntax} +like \markup[nomk]{cs} but to be used in the index, it will typeset +the >>\verb+\+<< in the left margin. +\begin{syntax} + \markup{felineWriteInMargin}\marg{text} +\end{syntax} +Depending on whether \markup{NoMarginparAvail} is true or not, +it will use \markup[nomk]{sidepar} (when \markup[nomk]{marginpar} is +unavailable) and \markup[nomk]{marginpar} otherwise (unless of course the +>>\texttt{forcesidepar}<< key is in effect). A +\markup[nomk]{marginpar} can for example not be used from inside a +\markup[nomk,env]{framed} or \markup[nomk,env]{shaded} environment. So +in such an environment one can just make sure that +\markup[nomk]{NoMarginparAvail} is set to true and then we will still +have some thing in the margin. It is recommended to use +\begin{syntax} + \markup{strictpagechecktrue} +\end{syntax} +in order to get more rigorous side checking. Internally we use +\markup[nomk]{checkoddpage} and \markup[nomk]{ifodd} to test whether +we are in the left or right margin. We also use +\begin{syntax} + \markup{felineMarginAdjustment} +\end{syntax} +to ensure that the margin text has the correct adjustment. The default +setting is +\begin{verbatim} +\newcommand\felineMarginAdjustment{% + \ifoddpage\RaggedRight\else\RaggedLeft\fi} +\end{verbatim} +In this documentation which is not twosided, it has been redefined to +be \markup[nomk]{RaggedLeft}. + + +For index entries we recommend the use of +\begin{syntax} + \markup{felineIndexCmd} +\end{syntax} +which initially is defined to be \markup[nomk]{index}. The +>>\texttt{idxit}<< control key redefines it to be +\markup[nomk]{itindex}, which is +\begin{verbatim} +\newcommand\itindex[1]{\index{#1|textitindex}} +\end{verbatim} +where \markup[nomk]{textitindex} is just +\markup[nomk]{textit}. Similar for >>\texttt{idxbf}<<. + +Let us now create a category key for \LaTeX\ packages. +\begin{verbatim} +\felineKeyGenerator{sty}% + {for registering package names}% + {\felineWriteInMargin{\foreignlanguage{english}{#1}}}% + {\felineIndexCmd{#1 (package)@#1 (package)}% + \felineIndexCmd{packages!#1}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} +\end{verbatim} +The rather odd last line is to ensure that the package name is written +under English hyphenation rules, and the +>>\verb+\hyphenchar\font=`\-+<< is to ensure that we can get +hyphenation in the typewriter font. As you can see we create two index +entries, one for the name it self (marking it as the name of a +package) and one as a sub item to a list of mentioned packages. + +Here is another key for mathematical symbols +\begin{verbatim} +\def\felinenameuse#1{\@nameuse{#1}} +\felineKeyGenerator{msym}% + {mathematical symbols} + {\felineWriteInMargin{\cs{#1} \textnormal{($\@nameuse{#1}$)}}}% + {\felineIndexCmd{#1@\protect\css{#1} ($\protect\felinenameuse{#1}$)}}% + {\cs{#1}} +\end{verbatim} +\verb+\@nameuse+ is used to transform the name of the macro into the +macro it self (for those that didn't already know +\verb+\@nameuse+). The shortcut \markup[nomk]{felinenameuse} is used +here because \verb+\@nameuse+ might not be permissible in the index +(because of the >>\texttt{@}<<. + +You can place these keys either in your preamble or in +>>\path{dlfltxbmarkup.cfg}<< which will be auto loaded if found. If +you have used the package option >>\texttt{loadsampleconfig}<< +then >>\texttt{dlfltxbmarkup-sample.cfg}<< will be loaded at the very end of +the package, i.e. \emph{after} >>\texttt{dlfltxbmarkup-sample.cfg}<<. + +The default category key to be used by \markup[nomk]{markup} is +controlled by +\begin{syntax} + \markup{felineStandardKey} +\end{syntax} +Just redefine it to be the key you want. Notice that by using +>>\texttt{loadsampleconfig}<< the default key is set to +>>\texttt{macro}<<. + +\section{The descriptions} +\label{sec:descriptions} + +For a long project like \cite{ltxb} the list of category keys may grow +quite big, and one might loose track of the keys and what they should +be used for. Under normal use of the this package, the description is +ignored. But internally in \markup[nomk]{felineKeyGenerator} we call +the macro \markup{felineMarkupDescription} with all five arguments. By +default it does nothing. But the user can define it to do something +before loading the package. + +Located with this manual you should find the file +>>dlfltxbmarkup-showkeys.tex<< which will print a new document showing +they keys and their description. If you move a \texttt{\%} in that +file you will get a list of the keys used for \cite{ltxb}. + + +\bibliographystyle{plainnat} +\bibliography{package_doc} + + +\end{document} + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: + diff --git a/macros/latex/contrib/dlfltxb/dlfltxbmarkupbookkeys.sty b/macros/latex/contrib/dlfltxb/dlfltxbmarkupbookkeys.sty new file mode 100644 index 0000000000..f26039444e --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbmarkupbookkeys.sty @@ -0,0 +1,644 @@ +\ProvidesPackage{dlfltxbmarkupbookkeys}[20101/03/04 by Lars madsen] + +% the original name for the dlfltxbmarkup package was 'felinemarkup', +% and in my book I use the following generated keys + +% This file be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Lars Madsen (daleif@imf.au.dk). +%% + + +% HISTORY +% +% <2007/05/25 added various stuff +% 2007/05/25 added the mltbib, bbtpc and bbtpcenv keys +% 2007/??/?? added sistyle key +% 2007/06/20 added acronym key +% 2008/06/27 fixed some settings +% 2008/20/30 file renamed because of problems regarding TeXLive +% 2010/03/04 several new keys added since last release + + +\@ifpackageloaded{dlfltxbmarkup}{}{ + \PackpageError{dlfltxbmarkupbookkeys}{This package depends on the + 'dlfltxbmarkup' package and can thus only be used if loaded AFTER + that package}{}} + + + +% default key +\def\felineStandardKey{macro} +% +\def\ENcs#1{{\foreignlanguage{english}{\cs{\hyphenchar\font=`\-#1}}}} +% til makroer +\felineKeyGenerator{macro} + {for normal macros (this is the default key)}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1@\protect\css{#1}}}% + {\ENcs{#1}} + + +\felineKeyGenerator{m}% + {just an alias for macro}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1@\protect\css{#1}}}% + {\ENcs{#1}} + + + +% pakker, sty nemt at huske +\felineKeyGenerator{sty}% + {for registering package names}% + {\felineWriteInMargin{\foreignlanguage{english}{#1}}}% + {\felineIndexCmd{#1 (pakke)@#1 (pakke)}\felineIndexCmd{pakker!#1}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} + +\felineKeyGenerator{nsty}% + {non-recommended packages}% + {\felineWriteInMargin{\foreignlanguage{english}{#1}}}% + {\felineIndexCmd{#1 (pakke, brug ikke)@#1 (pakke, brug ikke)}% + \felineIndexCmd{pakker!#1 (brug ikke)}% + \felineIndexCmd{ikke anbefalede pakker!#1}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} + + + +% dokumentklasser +\felineKeyGenerator{cls}% + {for registering class names}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (klasse)@#1 (klasse)}\felineIndexCmd{dokumentklasser!#1}}% + {\foreignlanguage{english}{\textsf{\textit{#1}}}} + +% pagestyles +\felineKeyGenerator{ps}% + {for the names of page styles}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (pagestyle)}\felineIndexCmd{pagestyles!#1}}% + {\textsf{\textbf{#1}}} + +% environments +\felineKeyGenerator{env}% + {registering the name of environments} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (environment)@#1 (environment)}% + \felineIndexCmd{environments!#1}}% + {\foreignlanguage{english}{\textit{\textbf{#1}}}} + + +% lister +\felineKeyGenerator{list}% + {names of lists} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (liste)}\felineIndexCmd{lister!#1}\felineIndexCmd{environments!#1}}% + {\textit{\textbf{#1}}} + +% almindelige ord og fraser +\felineKeyGenerator{w}% + {normal words and frases} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1}} + {#1} + +% programmer +\felineKeyGenerator{prog}% + {for commandline programs} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (program)@\texttt{#1} (program)}\felineIndexCmd{programmer!#1@\texttt{#1}}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} + +% matematiske symboler +\def\felinenameuse#1{\@nameuse{#1}} +\felineKeyGenerator{msym}% + {mathematical symbols} + {\felineWriteInMargin{\ENcs{#1} \textnormal{($\@nameuse{#1}$)}}}% + {\felineIndexCmd{#1@\protect\css{#1} ($\protect\felinenameuse{#1}$)}% + }% + {\ENcs{#1}} + + +% textcomp symboler +\felineKeyGenerator{tcsym}% + {textcomp symbols} + {\felineWriteInMargin{\ENcs{#1} \textnormal{(\@nameuse{#1})}}}% + {% + \felineIndexCmd{#1 (textcomp)@\protect\css{#1} (\protect\felinenameuse{#1}, textcomp)}% + \felineIndexCmd{textcomp (pakke)@textcomp (pakke)!@\protect\css{#1} (\protect\felinenameuse{#1})}% + }% + {\ENcs{#1}} + + +% store matematiske symboler +\felineKeyGenerator{bigmsym}% + {operator symbols, like sum etc.} + {\felineWriteInMargin{\ENcs{#1} \textnormal{($\@nameuse{#1}$)}}}% + {\felineIndexCmd{#1@\protect\css{#1} ($\protect\felinenameuse{#1}$)}% + \felineIndexCmd{store symboler!#1@\protect\css{#1} ($\protect\felinenameuse{#1}$)}% + % + }% + {\ENcs{#1}} + +% log-like konstruktioner +\felineKeyGenerator{mlog}% + {log-like functions} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1@\protect\css{#1} (mat. operator)}% + \felineIndexCmd{navngivne operatorer!#1@\protect\css{#1}}% + % + }% + {\ENcs{#1}} + + + +% almindelige symboler +\felineKeyGenerator{sym}% + {text symbols} + {\felineWriteInMargin{\ENcs{#1} \textnormal{(\@nameuse{#1})}}}% + {\felineIndexCmd{#1@\protect\css{#1} (\@nameuse{#1})}}% + {\ENcs{#1}} + +% delimiters/hegn +\felineKeyGenerator{delim}% + {delimiters / fences} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1@#1 (delimiter)}\felineIndexCmd{delimiters!#1}}% + {\ensuremath{#1}} + +% delimiters speciel +\felineKeyGenerator{delims}% + {special delimiters (no idea what this is used for)} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1@\protect\css{#1}}}% + {\ensuremath{\ENcs{#1}}} + +% ntheorem makroer +\felineKeyGenerator{nthm}% + {ntheorem macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{ntheorem (pakke)@ntheorem (pakke)!\protect\css{#1}}% + \felineIndexCmd{#1 (ntheorem)@\protect\css{#1} + (ntheorem)}}% + {\ENcs{#1}} + +% ntheorem theoremstyles +\felineKeyGenerator{nthmstl}% + {ntheorem theorem styles} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{ntheorem (pakke)!theoremstyle!#1}% + \felineIndexCmd{#1 (theoremstyle, nthm)}% + \felineIndexCmd{theoremstyle (ntheorem)@\protect\css{theoremstyle} (ntheorem)!#1}% + }% + {\textbf{#1}} + +% XY pic makroer +\felineKeyGenerator{xym}% + {Xy-pic macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1@\protect\css{#1}}\felineIndexCmd{XY-pic@\protect\Xy-pic!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +% Xy-pic pile +\felineKeyGenerator{xymar}% + {Xy-pic arrows} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{ar@\protect\css{ar}!#1}\felineIndexCmd{XY-pic@\protect\Xy-pic!ar@\protect\css{ar}!#1}}% + {#1} + +% mathtool environments +\felineKeyGenerator{mtoolsenv}% + {mathtools environments} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (environment)}\felineIndexCmd{environments!#1}% + \felineIndexCmd{mathtools (pakke)@mathtools (pakke)!#1}}% + {\textit{\textbf{#1}}} + +% figur/billed formater +\felineKeyGenerator{ftype}% + {figure formats} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1}\felineIndexCmd{figur format!#1}}% + {\textsc{#1}} + +% fejlmeddelelser, dette er vist ikke avendet til noget +\felineKeyGenerator{err}% + {for error messages, currently un-used} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1}\felineIndexCmd{fejlmeddelelser!#1}}% + {\textsf{#1}} + +% natbib makroer +\felineKeyGenerator{nb}% + {natbib macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (natbib)@\protect\css{#1} (natbib)}\felineIndexCmd{natbib (pakke)@natbib (pakke)!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +% natbib options +\felineKeyGenerator{nbop}% + {natbib package options} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (natbib option)}% + \felineIndexCmd{natbib (pakke)@natbib (pakke)!pakke options!#1}}% + {\texttt{#1}} + + +% bibtex felt +\felineKeyGenerator{bibfelt}% + {BibTeX fields} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (bibtex felt)@#1 (\protect\BibTeX{} felt)}\felineIndexCmd{bibtex@\protect\BibTeX!felter!#1}}% + {\texttt{#1}} + +% bibtex type +\felineKeyGenerator{bibtype}% + {BibTeX types} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (bibtex type)@#1 (\protect\BibTeX{} type)}\felineIndexCmd{bibtex@\protect\BibTeX!typer!#1}}% + {#1} + +% bibtex stil +\felineKeyGenerator{bibstyle}% + {BibTeX style} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (bibtex stil)@#1 (\protect\BibTeX{} stil)}\felineIndexCmd{bibtex@\protect\BibTeX!stile!#1}}% + {\texttt{#1}} + +% memoir specifik makro +\felineKeyGenerator{mem}% + {memoir specific macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (memoir)@\protect\css{#1} (memoir)}% + \felineIndexCmd{memoir (klasse)!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + +% memoir specifik environment +\felineKeyGenerator{menv}% + {memoir specific environments} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (env, memoir)@#1 (env, memoir)}% + \felineIndexCmd{environments!#1}\felineIndexCmd{memoir (klasse)@memoir (klasse)!#1}}% + {\textit{\textbf{#1}}} + +% memoir chapterstyle +\felineKeyGenerator{chapstyle}% + {memoir chapter styles} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (chapter style)}% + \felineIndexCmd{chapterstyle@\protect\css{chapterstyle} (memoir)!#1} + \felineIndexCmd{memoir (klasse)!chapterstyle@\protect\css{chapterstyle}!#1}}% + {\textsf{#1}} + +% booktabs makroer +\felineKeyGenerator{bt}% + {booktabs macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1@\protect\css{#1} (booktabs)}% + \felineIndexCmd{booktabs (pakke)@booktabs (pakke)!#1@\protect\css{#1}}% + \felineIndexCmd{memoir (klasse)!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + +% longtable makroer +\felineKeyGenerator{lt}% + {longtable macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (longtable)@\protect\css{#1} (longtable)}% + \felineIndexCmd{longtable@longtable (pakke)!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + +% colortbl makroer +\felineKeyGenerator{ctbl}% + {colortbl macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (colortabl)@\protect\css{#1} (colortbl)}% + \felineIndexCmd{colortbl@colortbl (pakke)!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + +% dokumentklasse options +\felineKeyGenerator{dop}% + {document class options} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (klasse option)}\felineIndexCmd{dokumentklasse!options!#1}% + }% + {\textsf{\textit{#1}}} + +\felineKeyGenerator{mdop}% + {memoir class options} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (memoir klasse option)}% + \felineIndexCmd{dokumentklasse!options!#1 (memoir)}% + }% + {\textsf{\textit{#1}}} + + +% fixme makroer +\felineKeyGenerator{fixme}% + {fixme macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{fixme (pakke)!#1@\protect\css{#1}}% + \felineIndexCmd{#1 (fixme)@\protect\css{#1} (fixme)}% + }% + {\ENcs{#1}} + +% varioref makroer +\felineKeyGenerator{vario}% + {varioref macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{varioref (pakke)!#1@\protect\css{#1}}% + \felineIndexCmd{#1 (varioref)@\protect\css{#1} (varioref)}% + }% + {\ENcs{#1}} + + +% fancyhdr pakke makroer +\felineKeyGenerator{fnchdr}% + {fancyhdr macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{fancyhdr (pakke)!#1@\protect\css{#1}}% + \felineIndexCmd{#1 (fancyhdr)@\protect\css{#1} (fancyhdr)}% + }% + {\ENcs{#1}} + + +% memoir specifikke pagestyles +\felineKeyGenerator{memps}% + {memoir specific page styles} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (pagestyle, memoir)}% + \felineIndexCmd{pagestyles!#1 (memoir)}}% + {\textsf{\textbf{#1}}} + +% options til \includegraphics +\felineKeyGenerator{inclgrfopt}% + {options for includegraphics} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (graphicx)}% + \felineIndexCmd{graphicx (pakke)!includegraphics@\protect\css{includegraphics}!#1}% + \felineIndexCmd{includegraphics@\protect\css{includegraphics}!#1}}% + {\textsf{#1}} + +% caption pakke makroer +\felineKeyGenerator{cap}% + {caption pacakge macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{caption (pakke)!#1@\protect\css{#1}}% + \felineIndexCmd{#1 (caption)@\protect\css{#1} (caption)}% + }% + {\ENcs{#1}} + +% subfig makroer +\felineKeyGenerator{subfig}% + {subfig macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{subfig (pakke)!#1@\protect\css{#1}}% + \felineIndexCmd{#1 (subfig)@\protect\css{#1} (subfig)}% + }% + {\ENcs{#1}} + +% KOMA-script kalsser +\felineKeyGenerator{clskoma}% + {KOMA script classes} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (klasse)}% + \felineIndexCmd{dokumentklasser!KOMA-script@\textsf{KOMA}-script!#1}}% + {\textsf{\textit{\mbox{#1}}}} + +% grafik format (hmm, dem er det saa to af????) +\felineKeyGenerator{grffmt}% + {graphics format (hmm, two of these???)} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (grafik format)}% + \felineIndexCmd{grafik format!#1}}% + {\textsc{#1}} + +% enumitem makroer +\felineKeyGenerator{ei}% + {enumitem macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{enumitem (pakke)!#1@\protect\css{#1}}% + \felineIndexCmd{#1 (enumitem)@\protect\css{#1} (enumitem)}}% + {\ENcs{#1}} + +% enumitem options +\felineKeyGenerator{eio}% + {enumimte options} + {\felineWriteInMargin{#1}}% enumitem option + {\felineIndexCmd{enumitem (pakke)!#1}% + \felineIndexCmd{#1 (enumitem)}}% + {\texttt{#1}} + +% input encoding options +\felineKeyGenerator{inputenc}% + {inputencodings} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{inputencoding!#1}% + \felineIndexCmd{#1 (inputencoding)}}% + {\texttt{#1}} + +% counter options +\felineKeyGenerator{counter}% + {name of counters} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{t\ae ller!#1}% + \felineIndexCmd{#1 (t\ae ller)}}% + {\texttt{#1}} + +% memoir counter options +\felineKeyGenerator{mcounter}% + {name of memoir counters} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{t\ae ller!#1 (memoir)}% + \felineIndexCmd{#1 (t\ae ller, memoir)}}% + {\texttt{#1}} + + +% laengde options +\felineKeyGenerator{length}% + {name of lengths} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{l\ae ngde!#1@\protect\css{#1}}% + \felineIndexCmd{#1 (l\ae ngde)@\protect\css{#1} (l\ae ngde)}}% + {\ENcs{#1}} + +\felineKeyGenerator{gauss}% + {gauss package macros} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1@\protect\css{#1} (gauss)}% + \felineIndexCmd{gauss (pakke)@gauss (pakke)!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +\felineKeyGenerator{tabs}% + {column specifiers for tabular etc.} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (s\o jle specifier)}% + \felineIndexCmd{s\o jle specifier!#1}}% + {\texttt{#1}} + +\felineKeyGenerator{mltbib}% + {macros related to the multibib pacakge} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1@\protect\css{#1}}% + \felineIndexCmd{multibib (pakke)!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +\felineKeyGenerator{bbtpc}% + {macros related to the bibtopic package} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1@\protect\css{#1}}% + \felineIndexCmd{bibtopic (pakke)!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +\felineKeyGenerator{bbtpcenv}% + {environment related to the bibtopic package} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (environment)}% + \felineIndexCmd{bibtopic (pakke)!#1}% + \felineIndexCmd{environments!#1 (bibtopic)}}% + {\foreignlanguage{english}{\textit{\textbf{#1}}}} + +\felineKeyGenerator{sistyle}% + {macros from the sistye package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (sistyle)@\protect\css{#1} (sistyle)}% + \felineIndexCmd{sistyle (pakke)!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +\felineKeyGenerator{sux}% + {macros from the siunitx package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (siunitx)@\protect\css{#1} (siunitx)}% + \felineIndexCmd{siunitx (pakke)!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +\felineKeyGenerator{suxu}% + {unit from the siunitx package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (siunitx enhed)@\protect\css{#1} (siunitx enhed)}% + \felineIndexCmd{siunitx (pakke)!enhed!#1@\protect\css{#1}}% + \felineIndexCmd{enhed (siunitx)!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + +\felineKeyGenerator{suxsu}% + {short unit from the siunitx package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (siunitx enhed)@\protect\css{#1} (siunitx enhed)}% + \felineIndexCmd{siunitx (pakke)!forkortet enhed!#1@\protect\css{#1}}% + \felineIndexCmd{enhed (siunitx)!forkortet!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + + + +\felineKeyGenerator{suxp}% + {prefixes from the siunitx package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (siunitx prefix)@\protect\css{#1} (siunitx prefix)}% + \felineIndexCmd{siunitx (pakke)!prefix!#1@\protect\css{#1}}% + \felineIndexCmd{enhedsprefix (siunitx)!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + +\felineKeyGenerator{suxpp}% + {power from the siunitx package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (siunitx potens)@\protect\css{#1} (siunitx prefix)}% + \felineIndexCmd{siunitx (pakke)!potens!#1@\protect\css{#1}}% + \felineIndexCmd{enhedspotens (siunitx)!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + + +\felineKeyGenerator{acronym}% + {macros from the acronym package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (acronym)@\protect\css{#1} (acronym)}% + \felineIndexCmd{acronym (pakke)!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +\felineKeyGenerator{beamerenv} + {environment related to the beamer class} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (environment)}% + \felineIndexCmd{beamer (klasse)!#1}% + \felineIndexCmd{environments!#1 (beamer)}}% + {\foreignlanguage{english}{\textit{\textbf{#1}}}} + +\felineKeyGenerator{beamer}% + {macros related to the beamer class} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1@\protect\css{#1} (beamer)}% + \felineIndexCmd{beamer (klasse)!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +\felineKeyGenerator{beamerclsopt}% + {class options for beamer related to the beamer class} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (beamer)}% + \felineIndexCmd{beamer (klasse)!#1}}% + {\texttt{#1}} + +\felineKeyGenerator{beamertheme}% + {beamertheme} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (beamer)}% + \felineIndexCmd{beamer (klasse)!#1}}% + {\texttt{#1}} + +\felineKeyGenerator{xiftst}% + {Test from the xifthen package} + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (xifthen)@\protect\css{#1} (xifthen)}% + \felineIndexCmd{xifthen (pakke)!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +\felineKeyGenerator{tl}% + {program from TeX Live} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (program, texlive)@\texttt{#1} (program, texlive)}\felineIndexCmd{programmer!#1@\texttt{#1}}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} + +\felineKeyGenerator{editor}% + {editors}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (editor)@\texttt{#1} (editor)}\felineIndexCmd{editorer!#1@\texttt{#1}}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} + +\felineKeyGenerator{leditor}% + {linux editors}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (editor, linux)@\texttt{#1} (editor, linux)}% + \felineIndexCmd{editorer!#1 (linux)@\texttt{#1} (linux)}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} + +\felineKeyGenerator{weditor}% + {windows editors}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (editor, windows)@\texttt{#1} (editor, windows)}% + \felineIndexCmd{editorer!#1 (windows)@\texttt{#1} (windows)}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} + +\felineKeyGenerator{meditor}% + {mac editors}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (editor, mac)@\texttt{#1} (editor, mac)}% + \felineIndexCmd{editorer!#1 (mac)@\texttt{#1} (mac)}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} + +\felineKeyGenerator{viewer}% + {viewers}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (fremviser)@\texttt{#1} (fremviser)}\felineIndexCmd{fremvisere!#1@\texttt{#1}}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} diff --git a/macros/latex/contrib/dlfltxb/dlfltxbmisc.pdf b/macros/latex/contrib/dlfltxb/dlfltxbmisc.pdf Binary files differnew file mode 100644 index 0000000000..dfb38c7f00 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbmisc.pdf diff --git a/macros/latex/contrib/dlfltxb/dlfltxbmisc.sty b/macros/latex/contrib/dlfltxb/dlfltxbmisc.sty new file mode 100644 index 0000000000..5788d06adb --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbmisc.sty @@ -0,0 +1,162 @@ +\ProvidesPackage{dlfltxbmisc}[2010/03/04 v0.3 by Lars Madsen] + +% This package be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Lars Madsen (daleif@imf.au.dk). +%% + + + +% if memoir is not loaded we will need the chngpage to get adjustwidth +\@ifclassloaded{memoir}{}{ + \RequirePackage{chngpage} +} + +\RequirePackage{ragged2e} +\RequirePackage{url} +\RequirePackage{calc} + +\@ifundefined{marg}{\newcommand\marg{}}{} +\@ifundefined{oarg}{\newcommand\oarg{}}{} +\@ifundefined{parg}{\newcommand\parg{}}{} + + +\newcommand*\Arg@s[1]{\textnormal{\texttt{#1}}}% +\newcommand*\Arg@n[1]{\textnormal{$\langle$\textit{#1}$\rangle$}}% +\newcommand*\Arg{\@ifstar{\Arg@s}{\Arg@n}}% + +\newcommand*\marg@s[1]{\textnormal{\texttt{\{#1\}}}} +\newcommand*\marg@n[1]{% + \textnormal{\texttt{\{}$\langle$\textit{#1}$\rangle$\texttt{\}}}% +} +\renewcommand*\marg{\@ifstar{\marg@s}{\marg@n}} + +\newcommand*\oarg@s[1]{\textnormal{\texttt{[#1]}}} +\newcommand*\oarg@n[1]{% + \textnormal{\texttt{[}$\langle$\textit{#1}$\rangle$\texttt{]}}% +} +\renewcommand*\oarg{\@ifstar{\oarg@s}{\oarg@n}} + +\newcommand*\parg@s[1]{\textnormal{\texttt{(#1)}}} +\newcommand*\parg@n[1]{% + \textnormal{\texttt{(}$\langle$\textit{#1}$\rangle$\texttt{)}}% +} +\renewcommand*\parg{\@ifstar{\parg@s}{\parg@n}} + +\newcommand\malign[2][2pt]{% + \makebox[0pt][l]{\kern#1\smash{\rule[-1.5mm-#2\baselineskip]{0.01pt}{5mm+#2\baselineskip}}}% +} + + +\newenvironment{syntax}{% + \vskip.5\baselineskip\allowbreak% + \begin{adjustwidth}{\parindent}{0pt} + \parindent=0pt% + \obeylines% + \let\\=\relax% + }{% + \end{adjustwidth}% + \vskip.5\baselineskip% +} +\newenvironment{syntax*}{% + \vskip.5\baselineskip% + \begin{adjustwidth}{\parindent}{0pt} + \parindent=0pt% + }{% + \end{adjustwidth}% + \vskip.5\baselineskip% +} + +\let\syntaks=\syntax +\let\endsyntaks=\endsyntax + +% macro used in several math examples to show the structure. It acts +% like some text but only displays a box. +\newcommand\@dbx[1]{{\fboxsep=0pt\fboxrule=0.4pt\,\fbox{\phantom{\rule[-0.6mm]{#1}{3mm}}}\,}} +\newcommand\dbx[1][5mm]{\ifmmode\mathord{\@dbx{#1}}\else\@dbx{#1}\fi} + + +% powerfull macro by Morten H\o gholm, this enables you to measure the +% length of the previous paragraf. +\newdimen\lastlinedim +\def\getlastlinesize{% + \begingroup\frozen@everydisplay{}% + $$ + \abovedisplayskip=\z@skip \abovedisplayshortskip=\z@skip + \belowdisplayskip=\z@skip \belowdisplayshortskip=\z@skip + \global\lastlinedim=\dimexpr\predisplaysize-2em\relax + \halign{##\cr}% + $$ + \mbox{}% + \endgroup% +} + +% this is a very special little macro to be used in the 'note' field +% of bibtex entries. It eats up the added '.' and typesets the main +% argument (an URL) in a raggedright manner, wrapped up into the +% previous paragraph. It looks pretty cool. +\newcommand\addurl[3][\textsf{URL}:]{% + \getlastlinesize{}% + \vskip-2\baselineskip% + \begingroup% + \urlstyle{sf} + \def\UrlNoBreaks{\do\(\do\[\do\{\do\<\do\:\do\.}%\] + \RaggedLeft% + \fussy% + \hbadness=10000% cheating + \addtolength\lastlinedim{-\bibhang}% + \fboxsep=0pt% + \fboxrule=0pt% + \fbox{\hbox to \lastlinedim{\hfill \footnotesize \strut \hfill}}% + \ifdim \lastlinedim > 0.6\linewidth\relax% we break + \nopagebreak\vskip-3pt% + \else% + % special thanks to Dan Luecking for this, since my original + % \hspace{\fill} failed miserably + \hskip1em plus 5em minus .7em + \fi% + {\footnotesize #1~~{\url{#2}}} % + \par% + \endgroup% +} + +\AtBeginDocument{\providecommand\href[2]{#2}} + +\DeclareUrlCommand\mypath{\urlstyle{sf}} +%\urlstyle{rm} +\newcommand\addCTAN[3][\textsf{CTAN}:]{% + \getlastlinesize{}% + \vskip-2\baselineskip% + \begingroup% +% \urlstyle{rm} + \def\UrlNoBreaks{\do\(\do\[\do\{\do\<\do\:\do\.}%\] + \RaggedLeft% + \fussy% + \hbadness=10000% cheating + \addtolength\lastlinedim{-\bibhang}% + \fboxsep=0pt% + \fboxrule=0pt% + \fbox{\hbox to \lastlinedim{\hfill \footnotesize \strut \hfill}}% + \ifdim \lastlinedim > 0.6\linewidth\relax% we break + \nopagebreak\vskip-3pt% + \else% + % special thanks to Dan Luecking for this, since my original + % \hspace{\fill} failed miserably + \hskip1em plus 5em minus .7em + \fi% + {\footnotesize + \href{http://mirror.ctan.org/#2}{#1~~{\mypath{#2}}}} % + \par% + \endgroup% +} + +\newcommand\CTAN[1]{% + {\footnotesize\href{http://mirror.ctan.org/#1}{\textsf{CTAN:}~{\mypath{#1}}}}} diff --git a/macros/latex/contrib/dlfltxb/dlfltxbmisc.tex b/macros/latex/contrib/dlfltxb/dlfltxbmisc.tex new file mode 100644 index 0000000000..0454d2a2a0 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbmisc.tex @@ -0,0 +1,213 @@ +\RequirePackage{etex} +\documentclass[11pt,oneside,a4paper,oldfontcommands,danish,english,article]{memoir} +\usepackage[T1]{fontenc} +\usepackage[widespace]{fourier} +\usepackage{babel} +\usepackage{calc,amsmath} +\usepackage[round]{natbib} + +\makeatletter +\DeclareRobustCommand{\LaTeX}{L\kern-.28em% + {\sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\sf@size\z@ + \math@fontsfalse\selectfont + A}% + \vss}% + }% + \kern-.15em% + \TeX} +\makeatother + +\setlxvchars[\normalfont] + +\settypeblocksize{*}{1.3\lxvchars}{1.618} + +\setlrmargins{*}{*}{0.7} +\setulmargins{*}{*}{1} +\setlength\marginparwidth{4cm} + +\checkandfixthelayout + +\hfuzz=30pt + +\usepackage{color} +\usepackage[colorlinks,breaklinks]{hyperref} +\definecolor{linkcolour}{rgb}{0,0.2,0.6} +\definecolor{citecolour}{rgb}{0,0.6,0.2} +\definecolor{urlcolour} {rgb}{0.8,0,0.8} + +\hypersetup{ + pdftitle={The dlfltxbmisc package}, + pdfauthor={Copyright \textcopyright\ \number\year\ Lars Madsen}, + linkcolor=linkcolour,citecolor=citecolour, + filecolor=urlcolour,urlcolor=urlcolour, + plainpages=false, +} + +\ifpdf\else\usepackage{breakurl}\fi +\usepackage{memhfixc} + +\clubpenalty=300 +\widowpenalty=300 + +\usepackage{microtype} + + +\usepackage[loadsampleconfig]{dlfltxbmarkup} +\usepackage{dlfltxbmisc} + +\renewcommand\felineMarginAdjustment{\RaggedLeft} + +\setlength\marginparsep{2em} +\setlength\marginparwidth{3cm} + +\chapterstyle{article} + +\setsecheadstyle{\normalfont\large\bfseries\raggedright} + +\reversemarginpar +\reversesidepartrue +\twocolumnfootnotes + +\setsecnumdepth{part} + +\pagestyle{plain} + + +\begin{document} + +\title{The \textsf{dlfltxbmisc} package\thanks{Version: 0.3}} +\author{Lars Madsen\thanks{Email: daleif@imf.au.dk}} +\maketitle + +\noindent +This package provides a variety of macros that are used for +\cite{ltxb}. + +\section{For typesetting arguments} + +\begin{flushleft} + \NoMarginparAvailtrue + \begin{tabularx}{\textwidth}{XX} + \markup{Arg}\marg{text} & \Arg{text} \\ + \markup{Arg*}\marg{text} & \Arg*{text} \\ + \markup{marg}\marg{text} & \marg{text} \\ + \markup{marg*}\marg{text} & \marg*{text} \\ + \markup{oarg}\marg{text} & \oarg{text} \\ + \markup{oarg*}\marg{text} & \oarg*{text} \\ + \markup{parg}\marg{text} & \parg{text} \\ + \markup{parg*}\marg{text} & \parg*{text} \\ + \end{tabularx} +\end{flushleft} + +\section{Syntax} +\label{sec:syntax} + + + +Environments \markup[env]{syntax} and \markup[env]{syntax*} for +explaining syntax. In the unstared version \markup[nomk]{obeylines} is +in effect and \cs{}\cs{} is disabled. In the stared version we are in +a normal situation and \cs{}\cs{} has its normal line changing +behavior. Text contents of the two environments are indented by +\markup[nomk,length]{parindent}. + +\section{Special wrapping urls in bibliographies} +\label{sec:spec-wrapp-urls} + +In the bibliography of \cite{ltxb} we refer to a lot of \LaTeX\ +packages and their URLs on \textsc{ctan}. In order to make those URLs +look nice and space some space the URL wraps it self up into the +bibliography item above. The effect can be seen here: +\medskip +\noindent +\begin{adjustwidth}{\bibhang}{0pt} + text text text text text text + text text text text text\qquad + \addurl{http://www.imf.au.dk/system/latex/bog/}{} +\end{adjustwidth} + +The effect is achieved with the macro +\begin{syntax} + \markup{addurl}\oarg{pre text}\marg{url}\marg{see below} +\end{syntax} +\markup[nomk]{addurl} is only intended to be used in bibliographies, +i.e. inside the \markup[nomk]{thebibliography} environment (it uses +\markup[nomk,length]{bibhang} internally). The macro was created to +be used with Bib\TeX, where one adds it as the very last item in the +>>\texttt{note}<< field. As most Bib\TeX\ styles add a >>\texttt{.}<< +at the end of the entry we simply let \markup[nomk]{addurl} `eat' that +>>\texttt{.}<< by just specifying the first argument. So if you use +this macro by hand (i.e.\ not using Bib\TeX), you will need to specify +the last argument as an empty argument. By default \oarg{pre text} is +set to >>\verb+\textsc{url}:+<<. + +\markup[nomk]{addurl} works this way: +\begin{enumerate}[(i)] +\item \label{item:1} We start a new paragraph and measure the length + of the last line in the preceding paragraph. +\item In the new paragraph we set everything + \markup[nomk]{RaggedLeft}, and start the text by setting a + phantom-like width corresponding to the measured length found + in~\eqref{item:1}. If the measured length is larger than + 0.6\markup[nomk]{linewidth}, then we do not activate the wrapping, + instead the URL is just typeset ragged left below the bibliographic + entry. +\item Then we simply typeset the URL using \markup[nomk]{url}. +\end{enumerate} + +There is one small problem with \markup[nomk]{addurl}: If we get close +to a page break the wrapping URL may be moved to the next page. One +method for fixing this is to make \markup[nomk,length]{itemsep} more +flexible inside the \markup[nomk,env]{thebibliography}, for example +using +\begin{verbatim} +\let\oldthebibliography\thebibliography +\renewcommand\thebibliography[1]{% + \oldthebibliography{#1}% + \setlength\itemsep{10pt plus 3pt minus 5pt} +} +\end{verbatim} + +Additionally, we also have a \markup[nomk]{addCTAN} macro where the +argument will be replaced by (if using \markup[nomk,sty]{hyperref}) +\begin{verbatim} +\href{http://mirror.ctan.org/#2}{#1\path{#2}} +\end{verbatim} +e.g. \verb+\addCTAN{/fonts/kpfonts/}+ $\to$ +\begin{verbatim} +\href{http://mirror.ctan.org/fonts/kpfonts}{\textsc{ctan}:\path{#2}} +\end{verbatim} + +Since \verb?\addCTAN? is also useful in the regular text, we also +support a \markup{CTAN}\marg{path} macro. + + +\section{Example text in math} +\label{sec:example-text-math} + +In \cite{ltxb} we use the macro \markup{dbx}\oarg{width} to illustrate +some math instead of writing random formulas. It just typesets \dbx\ +where the width is adjustable using the optional argument. + + +\section{Acknowledgement} +\label{sec:acknodlegement} + +Special thanks to Morten H\o gholm and Dan Luecking for their help +with various parts of \markup[nomk]{addurl}. + + +\bibliographystyle{plainnat} +\bibliography{package_doc} + + +\end{document} + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: + diff --git a/macros/latex/contrib/dlfltxb/dlfltxbtocconfig.pdf b/macros/latex/contrib/dlfltxb/dlfltxbtocconfig.pdf Binary files differnew file mode 100644 index 0000000000..9fe0cd8df1 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbtocconfig.pdf diff --git a/macros/latex/contrib/dlfltxb/dlfltxbtocconfig.sty b/macros/latex/contrib/dlfltxb/dlfltxbtocconfig.sty new file mode 100644 index 0000000000..c0ae6d04b5 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbtocconfig.sty @@ -0,0 +1,635 @@ +\ProvidesPackage{dlfltxbtocconfig}[2010/03/04 v0.7 by Lars Madsen] + +% This package be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Lars Madsen (daleif@imf.au.dk). +%% + + +% HISTORY +% +% 20071227 a few internal macros changed to reflect changes in +% mempatch 4.9 +% 20080122 made the toc titlenames configurable (\contentsname and \shortcontentsname) +% 20080131 bugfix, the \ToCSubsectionIndentsPullBack and +% \ToCSubsectionIndentsBackToNormal should also set toc +% levels, otherwise hyperref bookmarks comes out wrong. +% 20080207 bugfix, \spart renamed to \specialpart, end the bookmark +% for it is removed +% 20080708 small cosmetic changes +% 20081121 tried a look with a line under the part entries in the toc +% 20100304 updated to use undocumented features from the memoir class + +% we need to be running under the memoir class +\@ifclassloaded{memoir}{}{% + \PackageError{dlfltxbtoconfig}{This package is build to run under + the memoir class, no other class will work}{}} + +% test for features present in mempatch 4.9 +\@ifundefined{cftinsertcode}{ + \PackageError{dlfltxbtoconfig}{Macro \string\cftinsertcode is missing. + We need features from mempatch version 4.9 or newer, please + upgrade memoir and mempatch.}{} +}{} + + +% add a \par to the end of the TOC +\AtEndDocument{\addtocontents{toc}{\par}} + +% we will use a special specialpart in the short ToC only the short ToC uses +% this so we define it to do nothing +\providecommand\l@specialpart[2]{} +% similar to \part but only adds something to the ToC +\newcommand\specialpart[1]{\cleartorecto\phantomsection\addcontentsline{toc}{specialpart}{\protect\partnumberline{}#1}} +% apparently a bookmark level of 100 removes it from the list of book marks +\newcommand\toclevel@specialpart{100}% + + +% trick with new memoir + + +\newcommand\mem@cft@alt@indents@setter[3]{% + % #1 = level (section, and down, chapter is special) + % #2 = name of level above + % #3 = numwidth + \expandafter\setlength{\@nameuse{cft#1numwidth}}{#3} + \expandafter\setlength{\@nameuse{cft#1indent}}{\@nameuse{cft#2indent}} + \expandafter\addtolength{\@nameuse{cft#1indent}}{\@nameuse{cft#2numwidth}} +} + +% \newlength\maxpnumformatted +% \newcommand\checkwidest[1]{% +% \expandafter\renewcommand\csname cft#1formatpnumhook\endcsname[1]{% +% \settowidth\@tempdimc{{\@nameuse{cft#1pagefont}##1}}% +% \ifdim\@tempdimc>\maxpnumformatted\global\maxpnumformatted=\@tempdimc\fi}% +% } +% \checkwidest{chapter} + +\newlength\widestchapter +\renewcommand\chapternumberlinehook[1]{% + \settowidth\@tempdimc{\@nameuse{cftchapterfont}#1}% + \ifdim\@tempdimc>\widestchapter\global\widestchapter=\@tempdimc\fi% +} +\newlength\widestsection +\newlength\widestsubsection +\newlength\widestsubsubsection +\newlength\widestfigure +\newlength\widesttable + +\def\mem@list{section,subsection,subsubsection,paragraph,subparagraph,figure,table} + +\newcommand\mem@wrec[2]{% + \expandafter\nametest\expandafter{\cftwhatismyname}{#1}% + \ifsamename% + \settowidth\@tempdimc{\@nameuse{cft\cftwhatismyname font}#2}% + \@ifundefined{widest#1}{% + %\typeout{\string\widest#1 not defined, ignoring} + }{% + \ifdim\dimexpr\@tempdimc>\@nameuse{widest#1}\relax% + \global\@nameuse{widest#1}=\@tempdimc\fi% + }% + \fi% +} + +\renewcommand\numberlinehook[1]{% + \@for\hest:=\mem@list\do{% + \expandafter\mem@wrec\expandafter{\hest}{#1}% + }% +} + +\def\@mem@storer#1#2{\global\@namedef{mem@stored@#1}{#2}} +\newcommand\memStoreValue[2]{% + \@bsphack% + \immediate\write\@mainaux{% + \string\@mem@storer{#1}{#2}}% + \@esphack} + +\newcommand\memRetrieveStored[1]{% + \@ifundefined{mem@stored@#1}{0pt}{\@nameuse{mem@stored@#1}}}% + +\newcommand\memRetrieveStoredInto[2]{% + \edef#1{\@ifundefined{mem@stored@#2}{}{\@nameuse{mem@stored@#2}}}} + +\AtBeginDocument{ + \AtEndDocument{ + \typeout{widest chapter: \the\widestchapter} + \typeout{widest section: \the\widestsection} + \typeout{widest subsection: \the\widestsubsection} + \typeout{widest subsubsection: \the\widestsubsubsection} + \memStoreValue{wchapter}{\the\widestchapter} + \memStoreValue{wsection}{\the\widestsection} + \memStoreValue{wsubsection}{\the\widestsubsection} + \memStoreValue{wsubsubsection}{\the\widestsubsubsection} + \memStoreValue{wfigure}{\the\widestfigure} + % \memStoreValue{wpnum}{\the\maxpnumformatted} + } +} + +\newcommand\cftsetindenttoedge[2]{% + % #1 = name of level + % #2 = numwidth + % this sets the indent to zero for this level, just a call to + % \cftsetindents + \cftsetindents{#1}{0pt}{#2}% +} + +\newcommand\cftsetindentsalt[2]{% + % #1 = name of entry + % #2 = numwidth + % we will create the indent with the data from the level above + % supported: chapter, section, subsection, subsubsection, paragraph + % and subparagraph + % indents above chapter is set to zero + \nametest{#1}{chapter} + \ifsamename + \cftsetindenttoedge{#1}{#2} + \else + \nametest{#1}{section} + \ifsamename + \mem@cft@alt@indents@setter{#1}{chapter}{#2} + \else + \nametest{#1}{subsection} + \ifsamename + \mem@cft@alt@indents@setter{#1}{section}{#2} + \else + \nametest{#1}{subsubsection} + \ifsamename + \mem@cft@alt@indents@setter{#1}{subsection}{#2} + \else + \nametest{#1}{paragraph} + \ifsamename + \mem@cft@alt@indents@setter{#1}{subsubsection}{#2} + \else + \nametest{#1}{subparagraph} + \ifsamename + \mem@cft@alt@indents@setter{#1}{paragraph}{#2} + \else + \@memerror{'#1' is not (yet) supported}{} + \fi + \fi + \fi + \fi + \fi + \fi +} + + + + + +%\newlength\dlf + + + + +% \AtBeginDocument{ +% \newcommand\dlf{\ifdim\dimexpr \memRetrieveStored{wchapter}+0pt > +% \memRetrieveStored{wsection}+0pt\relax% +% \memRetrieveStored{wchapter}\else\memRetrieveStored{wsection}\fi} +% \cftsetindentsalt{chapter}{\dlf+0.5em} +% \cftsetindenttoedge{section}{\dlf+0.5em} +% \cftsetindentsalt{subsection}{\memRetrieveStored{wsubsection}+0.5em} +% \cftsetindentsalt{subsubsection}{\memRetrieveStored{wsubsubsection}+0.5em} +% \cftsetindents{figure}{0pt}{\memRetrieveStored{wfigure}+0.5em} +% \setpnumwidth{\memRetrieveStored{wpnum}} +% % \setlength\@tempdima{\memRetrieveStored{wpnum}+0pt} +% % \addtolength\@tempdima{1em} +% % \setrmarg{\the\@tempdima} +% } + + + + +% used for calculating the widest section and sunsection numbers +% we reset them back to zero in the ToC preprocessor +\newlength\secwidest +%\settowidth\secwidest{999.999} +\newlength\subsecwidest +%\settowidth\subsecwidest{999.999} + +% the name of the ToC file, just such that one can use it on sample +% data by just redefining this macro +\def\feline@includetocfile{\@starttoc{toc}} + +%\PackageWarning{dlfltxbtocconfig}{ToCfile: \feline@tocfile} + +% LoT and LoF handling +\cftsetindents{figure} {0em} {3.0em} +\cftsetindents{table} {0em} {3.0em} +\renewcommand{\cftfiguredotsep} {\cftnodots} +\renewcommand{\cfttabledotsep} {\cftnodots} + + +%%%%%%%%%%%%%%%%%%%% +%% %% +%% MakeShortToC %% +%% %% +%%%%%%%%%%%%%%%%%%%% + +\providecommand\shortcontentsname{Kort oversigt} + +% This macro is used to print the two ToCs +\newcommand\MakeShortToC{ + \begingroup + + \DeclareRobustCommand{\LaTeX}{L\kern-.25em% + {\sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\sf@size\z@ + \math@fontsfalse\selectfont + A}% + \vss}% + }% + \kern-.05em% + \TeX} + + + \renewcommand{\contentsname}{\shortcontentsname} + \setcounter{tocdepth}{0} + % no precis' + \renewcommand\precistoctext[1]{} + % mess with internal command + \renewcommand\changetocdepth[1]{} + \renewcommand\cftchapterfont{\normalfont\itshape\sffamily} + \renewcommand\cftchapterpagefont{\normalfont\itshape\sffamily} + \renewcommand\cftchapterleader{\enspace\textperiodcentered\enspace} + % no part numbers + \renewcommand\partnumberline[1]{} + % no parts + \renewcommand\l@part[2]{} + % we will use specialpart ToC entries and ignore parts + \renewcommand\l@specialpart[2]{% + \noindent +% \qquad\qquad\hrulefill\par% + \vskip5pt\par + \noindent% +% \raisebox{-3pt}[0pt][0pt]{\qquad\qquad\parbox[t]{0.35\textwidth}{\itshape\bfseries ##1}}% +% \raisebox{-4pt}[0pt][0pt]{\qquad\qquad\parbox[t]{0.35\textwidth}{##1}}% + \raisebox{-4pt}[0pt][0pt]{\parbox[t]{0.35\textwidth}{% + \raggedleft\bfseries\sffamily ##1} \qquad\qquad}% + \vskip-\baselineskip + \par + } + % no chapternumbers + \renewcommand\chapternumberline[1]{} + % reconfigure the way chapters and appendices are presented + \renewcommand*{\l@chapapp}[3]{% + \ifnum \c@tocdepth >\m@ne + \cftchapterbreak + \vskip \cftbeforechapterskip + { +% \leftskip -10pt%\cftchapterindent\relax +% \rightskip 0\textwidth%\@tocrmarg + \leftskip \fill + \rightskip 0pt + \parfillskip 0pt%-\rightskip + \parindent 0pt + \@afterindenttrue + \interlinepenalty\@M + \leavevmode + \def\@chapapp@head{##3}% + {\cftchapterpagefont ##2}\nobreak% + \cftchapterfillnum% + {##1}% + }% + \fi} + % it is best not have have long chapter title, but in case they are + % long, we will put them into a box + \renewcommand*\cftchapterfillnum[1]{% + {\cftchapterleader}\nobreak + {\parbox[t]{0.5\textwidth}{\raggedright\cftchapterfont ##1}}\par + } + % set the distance between chapters + \setlength\cftbeforechapterskip{4pt} + % set the title of the short ToC + \@nameuse{@tocmaketitle} + % add the short ToC to the ToC + \phantomsection + \addcontentsline{toc}{chapter}{\contentsname} + % reag in the ToC + \makeatletter +% \input\feline@tocfile +\feline@includetocfile + \endgroup + \cleartorecto +} + + + +%%%%%%%%%%%%%%%%%%%%% +%% %% +%% MakeNormalToC %% +%% %% +%%%%%%%%%%%%%%%%%%%%% + + + +\newcommand\cftdlfsubsubseccomma{% + \@ifundefined{aldinesmall}{% + , \hskip .5em plus 3pt minus 3pt% + }{% +% \hskip .5em plus 3pt minus 3pt\aldinesmall\nolinebreak% +\hskip .3em plus 2pt minus 2pt\textperiodcentered%\nolinebreak% + \hskip .3em plus 2pt minus 2pt\nopagebreak% + }} + +\newcommand\NormalTocPartFont{\Large\bfseries\itshape\sffamily} +\newcommand\NormalTocPartPrefix{% + \@ifundefined{aldinesmall}{}{ + {\hbox to \cftsectionnumwidth{\aldinesmall}}}} + +% This macro is used to print the two ToCs +\newcommand\MakeNormalToC{ + \begingroup + + \DeclareRobustCommand{\LaTeX}{L\kern-.25em% + {\sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\sf@size\z@ + \math@fontsfalse\selectfont + A}% + \vss}% + }% + \kern-.05em% + \TeX} + + + + + % if someone wrote \bfseries or similar in the title of a + % subsubsection, we will remove it + \let\feline@oldnumberline\numberline + \let\oldbfseries=\bfseries + \let\oldem=\em + \let\oldttfamily=\ttfamily + \renewcommand{\cftsubsubsectionfont}{\footnotesize\itshape\sffamily} + \renewcommand{\cftsubsubsectionpagefont}{\footnotesize\sffamily} + \renewcommand{\cftsubsectionfont}{\sffamily} + \renewcommand{\cftsubsectionpagefont}{\sffamily} + \let\cftsectionfont\cftsubsectionfont + \let\cftsectionpagefont\cftsubsectionpagefont + \renewcommand\cftchapterfont{\sffamily\bfseries} + \renewcommand\cftchapterpagefont{\sffamily\bfseries} + + + + \newcommand\feline@partToCtext[1]{% + \begingroup% + \fboxsep=2pt% + {\parbox{\linewidth-2\fboxsep-2\fboxrule}% + {\NormalTocPartFont\strut{\NormalTocPartPrefix ##1}\hfill\strut}}% + \par\vskip-0.35\baselineskip% + \settowidth\@tempdimc{\Large\itshape ##1}% +% \strut\hfill\rule{3.5cm}{0.9pt}\hfill\strut% + \par\vskip4mm + \endgroup% + } + + + % no pagenumbers for part + \cftpagenumbersoff{part} + + \DeclareRobustCommand\precistoctext[1]{% + {\nopagebreak\leftskip\cftsectionnumwidth\relax + % \advance\leftskip\cftchapternumwidth\relax +%% \rightskip\@tocrmarg plus 0em \relax +%% \noindent\parbox[t]{\linewidth-\cftsectionnumwidth-1em}% +%% {\precistocfont\raggedright\footnotesize ##1}\par}\vskip5pt} + \noindent\parbox[t]{\linewidth-\cftsectionnumwidth-\@pnumwidth}% + {\precistocfont\RaggedRight% + \footnotesize\sffamily ##1}\par}\vskip5pt} + + + + % reconfiguring the way parts will appear + \renewcommand*{\l@part}[2]{% + \ifnum \c@tocdepth >-2\relax + \cftpartbreak% + \vskip\cftbeforepartskip% + \begingroup + {% + \leftskip 0pt%\cftpartindent\relax + \rightskip 0pt%\@tocrmarg + \parfillskip -0pt%\rightskip + \parindent 0pt\relax\@afterindenttrue% + \interlinepenalty\@M% + \leavevmode% + \feline@partToCtext{##1}% + \par% + }\nopagebreak + \global\@nobreaktrue + \everypar{\global\@nobreakfalse\everypar{}}% + \endgroup + \fi} + % it is good to break begore a part instead of having a part at the + % bottom of a page + \renewcommand\cftpartbreak{\par%\addpenalty{-\@highpenalty} + \if@nobreak\else + \vskip\z@\@plus\bottomsectionskip + \penalty\z@ + \vskip\z@\@plus -\bottomsectionskip + \fi + } + % no part numbers + \renewcommand\partnumberline[1]{} + + + % need more space for ToC page numbers + \setpnumwidth{2.55em} + \setrmarg{3.55em} + % need more space for ToC section numbers, we will use calculated numbers +% \cftsetindents{section} {0em} {\secwidest+0.5em} + % \cftsetindents{subsection} {\secwidest+0.5em} {\subsecwidest+0.5em} + % \cftsetindents{subsubsection}{\secwidest+\subsecwidest+1em}{0em} + + + \newcommand\dlf{\ifdim\dimexpr \memRetrieveStored{wchapter}+0pt > + \memRetrieveStored{wsection}+0pt\relax% + \memRetrieveStored{wchapter}\else\memRetrieveStored{wsection}\fi} + \cftsetindentsalt{chapter}{\dlf+0.5em} + \cftsetindenttoedge{section}{\dlf+0.5em} + \cftsetindentsalt{subsection}{\memRetrieveStored{wsubsection}+0.5em} + \cftsetindents{subsubsection}{\memRetrieveStored{wsection}+0.5em}{0em}% +% \cftsetindentsalt{subsubsection}{\memRetrieveStored{wsection}+0.5em} + \cftsetindents{figure}{0pt}{\memRetrieveStored{wfigure}} + \cftsetindents{table}{0pt}{\memRetrieveStored{wtable}} + + + + +% % need more space for LoF & LoT numbers + %remove the dotted leaders +% \renewcommand{\cftsectiondotsep} {\cftnodots} +% \renewcommand{\cftsubsectiondotsep} {\cftnodots} +% \renewcommand{\cftsubsubsectiondotsep}{\cftnodots} +% \renewcommand{\cftparagraphdotsep} {\cftnodots} +% \renewcommand{\cftsubparagraphdotsep} {\cftnodots} + + +% \renewcommand{\cftsubsubsectionpagefont}{\footnotesize\itshape\scshape} + % reconfigure the way subsubsectins are displayed + \renewcommand{\l@subsubsection}[2]{% + \ifnum \c@tocdepth > 2\relax% + \let\bfseries\relax% + \let\em\relax% + \let\ttfamily\relax% + % \def\numberline##1{\textit{##1}~}% % numbers + \def\numberline####1{}% % no numbers + \leftskip=\cftsubsubsectionindent% +% \settowidth\@tempdima{\textbf{99}}% + \settowidth\@tempdima{\@pnumwidth}% + \rightskip=\@tempdima plus 1em +% \parfillskip=\fill% + \parfillskip=2em plus 1fil + \nopagebreak% added 20060713 + % instead of using a comma to separate entries we will use a leaf + % (requires the fourier package + \ifhmode \cftdlfsubsubseccomma\else\noindent\fi% +% \noindent + \ignorespaces% + {\cftsubsubsectionfont ##1}~~{\cftsubsubsectionpagefont ##2}% + \let\numberline\feline@oldnumberline\ignorespaces% + \let\bfseries\oldbfseries\ignorespaces% + \let\em\oldem\ignorespaces% + \let\ttfamily\oldttfamily\ignorespaces% + \fi% + } + + % getting chapternames and appendix names into the ToC +% \renewcommand\cftchaptername{\chaptername~~} +% \renewcommand\cftappendixname{\appendixname~~} + + \setlength\cftchapternumwidth{\cftsectionnumwidth} + + +% \renewcommand{\contentsname}{Indholdsfortegnelse} + \setcounter{tocdepth}{3} % subsections + \addtodef{\cftchapterbreak}{\par}{} + \renewcommand{\cftchapterleader}{\cftdotfill{\cftchapterdotsep}} + +% \setlength\cftbeforechapterskip{2.5em plus 1em minus 0.5em} + \setlength\cftbeforepartskip{2.5em plus 1em minus 1.5em} + + % handle some added hooks + \cftinsertcode{A}{ + \renewcommand\cftchapterfont{\normalfont\sffamily} + \renewcommand\cftchapterpagefont{\normalfont\sffamily} + \setlength\cftbeforechapterskip{0pt} + \renewcommand{\cftchapterdotsep} {\cftdotsep} + } + + \cftinsertcode{B}{ + \renewcommand\cftchapterfont{\bfseries\sffamily} + \renewcommand\cftchapterpagefont{\bfseries\sffamily} + \addtolength\cftbeforechapterskip{1.25em plus 0.7em minus 1em} + \renewcommand{\cftchapterdotsep} {\cftnodots} + } + + \cftinsertcode{C}{\setlength\cftbeforechapterskip{0pt}} + + + % \renewcommand\cftchapterleader{} +% \renewcommand\cftchapterafterpnum{\cftparfillskip} + +% \let\cftsectionleader\cftchapterleader +% \let\cftsubsectionleader\cftchapterleader +% \let\cftsectionafterpnum\cftchapterafterpnum +% \let\cftsubsectionafterpnum\cftchapterafterpnum + + + % set the title of the short ToC + \@nameuse{@tocmaketitle} + % add the short ToC to the ToC + \phantomsection + \addcontentsline{toc}{chapter}{\contentsname} + % reag in the ToC + \makeatletter +% \input\feline@tocfile + \feline@includetocfile + \endgroup + \cleartorecto +} + +%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% ToC preprocessor %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%% + + + +% this macro preprocesses the ToC and figures out which section and +% subsection numbers are the widest, these will be saved into +%\secwidest and \subsecwidest +\newcommand\preprocessToC{ + \begingroup +% \newif\ifshortToC + \makeatletter + \let\l@part=\@gobbletwo + \let\l@chapapp=\@gobbletwo + \let\l@subsubsection=\@gobbletwo + + \setlength{\global\secwidest}{0pt} + \setlength{\global\subsecwidest}{0pt} + + \def\PARSER##1##2##3##4\END{%\typeout{##2} + \settowidth\unitlength{##3}% + \ifdim\unitlength>##1% + \settowidth{\global##1}{##3}% + \fi% + } + \renewcommand\l@section[2]{% + \PARSER\secwidest##1\END% + } + \renewcommand\l@subsection[2]{% + \PARSER\subsecwidest##1\END% + } + \let\precistoctext\@gobble + +% \input\feline@tocfile + \feline@includetocfile +% \typeout{widest section: \the\secwidest} +% \typeout{widest subsection: \the\subsecwidest} + \endgroup +} + + +% the internal macros tha lives inside the ToC file +\def\cftSubsectionIndentsBackToNormal{% +% \cftsetindents{subsubsection}{\secwidest+\subsecwidest+1em}{0em}% +% \cftsetindents{subsubsection}{\memRetrieveStored{wsection}+0.5em}{0em}% +% \cftsetindents{subsubsection}{\secwidest+0.5em}{0em}% +} +\def\cftSubsectionIndentsPullBack{% + %\cftsetindents{subsubsection}{\secwidest+0.5em}{0em}% +% \cftsetindents{subsubsection}{\memRetrieveStored{wsection}+0.5em}{0em}% +} + +\newcommand\ToCSubsectionIndentsPullBack{% + \addtocontents{toc}{\protect\cftSubsectionIndentsPullBack}% + \renewcommand\toclevel@subsubsection{2}% +} + +\newcommand\ToCSubsectionIndentsBackToNormal{% + \addtocontents{toc}{\protect\cftSubsectionIndentsBackToNormal}% + \renewcommand\toclevel@subsubsection{3}% +} + +% preserving some old syntax +\let\RedofelineEmulSubSubSec\ToCSubsectionIndentsBackToNormal +\let\felineEmulSubSubSec\ToCSubsectionIndentsPullBack + +% figures + +\renewcommand\cftfigurefont{\sffamily} +\renewcommand\cftfigurepagefont{\sffamily} +\renewcommand\cfttablefont{\sffamily} +\renewcommand\cfttablepagefont{\sffamily} diff --git a/macros/latex/contrib/dlfltxb/dlfltxbtocconfig.tex b/macros/latex/contrib/dlfltxb/dlfltxbtocconfig.tex new file mode 100644 index 0000000000..ee7735b848 --- /dev/null +++ b/macros/latex/contrib/dlfltxb/dlfltxbtocconfig.tex @@ -0,0 +1,165 @@ +\RequirePackage{etex} +\documentclass[11pt,oneside,a4paper,oldfontcommands,danish,english,article]{memoir} +\usepackage[latin1]{inputenc} +\usepackage{babel} +\usepackage[T1]{fontenc} +\usepackage[widespace]{fourier} + +\setlxvchars[\normalfont] + +\settypeblocksize{*}{1.3\lxvchars}{1.618} + +\setlrmargins{*}{*}{0.7} +\setulmargins{*}{*}{1} +\setlength\marginparwidth{4cm} + +\checkandfixthelayout + + +\hfuzz=30pt + +\setfootnoterule[\vfill]{3pt}{0.4\columnwidth}{\normalrulethickness} + +\usepackage{color} +\usepackage[colorlinks,breaklinks]{hyperref} +\definecolor{linkcolour}{rgb}{0,0.2,0.6} +\definecolor{citecolour}{rgb}{0,0.6,0.2} +\definecolor{urlcolour} {rgb}{0.8,0,0.8} + +\hypersetup{ + pdftitle={The dlfltxbtocconfig package}, + pdfauthor={Copyright \textcopyright\ \number\year\ Lars Madsen}, + linkcolor=linkcolour,citecolor=citecolour, + filecolor=urlcolour,urlcolor=urlcolour, + plainpages=false, +} + +\ifpdf\else\usepackage{breakurl}\fi +\usepackage{memhfixc} + +\clubpenalty=300 +\widowpenalty=300 + +\usepackage{microtype} + +\usepackage{amsmath,amssymb} +\usepackage[amsmath,thmmarks,framed]{ntheorem} +\usepackage[round]{natbib} + +\usepackage{dlfltxbcodetips} +\usepackage[loadsampleconfig]{dlfltxbmarkup} +\renewcommand\felineMarginAdjustment{\RaggedLeft} + + + +\usepackage{dlfltxbmisc} +\usepackage{graphicx} + +\chapterstyle{article} + +\setsecheadstyle{\normalfont\large\bfseries\raggedright} + + +\reversemarginpar +\reversesidepartrue + +\definecolor{shadecolor}{gray}{0.8} +\theorembodyfont{\normalfont} +\theoremseparator{.} +\def\theoremframecommand{\colorbox{shadecolor}} + +\theoremstyle{nonumberplain} + +\NewShadedTheorem{caveat}{Caveat} + +\NewShadedTheorem{remark}{Remark} + +% until dlfltxbsd is released we will have to use the following +% construction + +\usepackage{fancyvrb} +\fvset{fontsize=\footnotesize} + +\newcommand\verbfile{\jobname.vrb} +\newenvironment{sourcedisplay}{% +\par\vskip0.5\baselineskip\noindent +\VerbatimOut{\verbfile}}{% +\endVerbatimOut% +\noindent +\begin{minipage}{0.48\linewidth} +\VerbatimInput{\verbfile} +\end{minipage} +\hfill +\begingroup% +\begin{minipage}{0.48\linewidth} +\begin{framed} +\input{\verbfile} +\end{framed} +\end{minipage} +\endgroup\vskip0.5\baselineskip} + + +\newenvironment{Sourcedisplay}{% +\par\vskip0.5\baselineskip\noindent +\VerbatimOut{\verbfile}}{% +\endVerbatimOut% +\noindent +\begin{minipage}{\linewidth} +\VerbatimInput{\verbfile} +\end{minipage} +\par\bigskip\noindent +\begin{minipage}{\linewidth} +\begin{framed} +\input{\verbfile} +\end{framed} +\end{minipage} +\vskip0.5\baselineskip} + + +\pagestyle{plain} + +\begin{document} + +\title{The \textsf{\jobname} package} +\author{Lars Madsen\thanks{Email: \url{daleif@imf.au.dk}}} +\maketitle + + +\setsecnumdepth{part} + + +\chapter{Contents of this package} + +This package is not really meant for public use. It is used in the +preparation of +\emph{\href{http://www.imf.au.dk/system/latex/bog}{Introduktion til + \LaTeX}} my (Danish) \LaTeX\ user +manual. + +The package takes care of configuring the two main table of contents +used in the book. People should use the code for inspiration (be +aware, it is quite messy) for their own ToC configurations. + +One interesting feature used in this version of the package: In the +latest memoir (as of February 2010) there are some added hooks in the +ToC macros that aren't documented in the memoir user manual. In this +package we use these hooks to measure the widest section numbers and +such in the ToC, save it to the main aux file, and then on the next +run, use it to auto adjust the width of the section number boxes. + +A new release of the \emph{memoir experimental} package will explain +more about how this works. + + + + + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% TeX-source-specials-mode: t +%%% TeX-PDF-mode: nil +%%% End: + diff --git a/macros/latex/contrib/dlfltxb/package_doc.bib b/macros/latex/contrib/dlfltxb/package_doc.bib new file mode 100644 index 0000000000..193cb6e76d --- /dev/null +++ b/macros/latex/contrib/dlfltxb/package_doc.bib @@ -0,0 +1,31 @@ + +@Booklet{ltxb, + title = {Introduktion til {\LaTeX}}, + OPTkey = {}, + author = {Lars Madsen}, + howpublished = {\url{http://www.imf.au.dk/system/latex/bog/}}, + OPTaddress = {}, + OPTmonth = {}, + year = {2010}, + note = {The current version of the book is 3rd edition beta.}, + OPTannote = {} +} + +@Book{swanson, + author = {Swanson, Ellen}, + ALTeditor = {}, + title = {Mathematics into {T}ype}, + publisher = {American Mathematical Society}, + year = {1999}, + OPTkey = {}, + OPTvolume = {}, + OPTnumber = {}, + OPTseries = {}, + OPTaddress = {}, + OPTedition = {}, + OPTmonth = {}, + note = { + An set of old notes, updated in 1999 by + Arlene O'Sean og Antoinette Schleyer.}, + OPTannote = {} +} |