<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\chapter{ĺčćçŽ}

ç¨ĺžŽä¸Ľčä¸äşçćçŤ&nbsp;ďźĺžĺžäźéä¸ä¸äşä¸ćçŤ&nbsp;ĺĺŽšĺŻĺç¸ĺłçĺčćçŽăç§ç&nbsp;čŽşćć´ćŻĺŚć­¤ďźçéĄżé˝čŻ´čżčŞĺˇąćŻçŤĺ¨ĺˇ¨äşşçčŠčä¸ĺäşćçăĺčćçŽäžżćŻĺˇ¨äşşăäťťä˝ä¸ä¸Ş \TeX\ çłťçťçä¸ć˘ĺŻšćŻćĺčćçŽćçčżä¸äşĺŽćäťĽč˝ťĺżďźĺŚĺ \TeX\ ć&nbsp;äťĽä¸şç§ććçŽćçč˝ŻäťśäšĺéŠąĺĺ¸čă

\section{\BibTeX}

ĺ¤§ĺ¤ć° \TeX\ çłťçťĺ¨ćçĺčćçŽćśďźçéäžčľ bibtex ç¨ĺşăçą bibtex ĺşäşćçŽć°ćŽćäťśçćĺčćçŽĺčĄ¨äżĄćŻďźçśĺäş¤çą \TeX\ čżčĄćçďźčżä¸čżç¨éĺ¸¸ćŻčŞĺ¨čżčĄçďźĺšśä¸éčŚç¨ćˇäşč§Łĺĺš˛é˘ă\ConTeXt\ ç°ĺ¨ä¸éčŚäžčľ bibtex ç¨ĺşďźĺŽĺˇ˛čŞčşŤĺé¨ĺŽç°äş bibtex çĺ¨é¨ĺč˝ăćŹććĄŁĺ¨č°ĺ \BibTeX ćśďźä¸ťčŚćĺśćçŽć°ćŽć&nbsp;źĺźă

\BibTeX\ ćçŽć°ćŽćäťśćŻçşŻććŹćäťśďźĺśä¸­ĺĺŤçčŽşćăä¸čĺćĺç­ćçŽć°ćŽăäžĺŚďźä¸çŻćĺčŽşćďźĺść°ćŽć&nbsp;źĺźä¸ş

\starttyping
@article{knuth-1984-literate,
  title={Literate programming},
  author={Knuth, Donald Ervin},
  journal={The computer journal},
  volume={27},
  number={2},
  pages={97--111},
  year={1984},
  publisher={Oxford University Press}
}
\stoptyping

\noindent ĺäžĺŚä¸ćŹä¸čďźĺść°ćŽć&nbsp;źĺźä¸ş

\starttyping
@book{knuth-1986-texbook,
  title={The texbook},
  author={Knuth, Donald Ervin and Bibby, Duane},
  volume={1993},
  year={1986},
  publisher={Addison-Wesley Reading, MA}
}
\stoptyping

ç°ĺ¨ďźä¸şäşĺ­Śäš&nbsp; \ConTeXt\ çĺčćçŽćçĺč˝ďźĺŻĺ°ä¸čż°ćçŽć°ćŽäżĺ­ä¸şä¸äť˝ććŹćäťśďźäžĺŚ foo.bibďźĺ°čŻĽćäťśä˝ä¸şćçŽć°ćŽćäťśă

ĺ¨ foo.bib ç¸ĺçŽĺ˝ä¸ďźĺťşçŤ \ConTeXt\ ćşćäťśďźäžĺŚ foo.texďźĺśĺĺŽšä¸ş

\starttyping[option=TEX]
\usebtxdataset[foo.bib] % ĺ&nbsp;č˝˝ foo.bib
\starttext
Knuth ĺşäşćĺ­Śçźç¨\cite[knuth-1984-literate]ććŻĺźĺäş
\TeX\ çłťçť\cite[knuth-1986-texbook]ă
\blank
\placelistofpublications
\stoptext
\stoptyping
\noindent çźčŻ foo.texďźĺŻĺžäťĽä¸çťćďź
\blank[line]
\midaligned{\externalfigure[06/bibtex-example-01.pdf]}
\blank[line]

\section{ćçŽĺčĄ¨ć&nbsp;ˇĺź}

ä¸ä¸čç¤şäžä¸­çćçŽĺčĄ¨ćŻ \ConTeXt\ éťčŽ¤ć&nbsp;ˇĺźďźé¤ć­¤äšĺ¤ďźčżćĺśäťä¸ç§é˘ĺŽäšçćçŽĺčĄ¨ć&nbsp;ˇĺźďźapaďźaps ĺ chicagoďźĺŻĺ¨ \type{\placelistofpublications} äšĺä˝żç¨ \type{\usebtxdefinitions} čżčĄĺć˘ăäžĺŚä˝żç¨ aps ć&nbsp;ˇĺźďź

\starttyping[option=TEX]
... ... ...
\usebtxdefinitions[aps]
\placelistofpublications
\stoptyping
\blank[line]
\midaligned{\externalfigure[06/bibtex-example-02.pdf]}
\blank[line]

ĺŻšäşé˘ĺŽäšć&nbsp;ˇĺźďźĺŻäťĽčżčĄč°ć´ăäžĺŚďźçźŠĺ°ćçŽĺşĺˇĺççŠşç˝é´čˇďź

\starttyping[option=TEX]
\setupbtxlist[apa][distance=.5em,width=fit]
\stoptyping
\blank[line]
\midaligned{\externalfigure[06/bibtex-example-03.pdf]}

\section{čŞĺŽäšćçŽĺčĄ¨ć&nbsp;ˇĺź}

äščŽ¸ \ConTeXt\ ćäžçĺčćçŽĺčĄ¨ć&nbsp;ˇĺźĺšśä¸çŹŚĺä˝&nbsp;çéćąďźĺ&nbsp;ć­¤ä˝&nbsp;äźĺżä¸ä˝ćłčŞĺˇąĺŽäšä¸ç§ć&nbsp;ˇĺźăĺŻšć­¤ďźćççćłćŻďźćçŽĺčĄ¨ć&nbsp;ˇĺźĺ˝çąćĺçźčžé¨ćä¸čĺşçĺč´č´ŁĺŽäšďźä¸Şäşşć&nbsp;éĺŚć­¤ĺťćăä¸čżďźĺčĽä˝&nbsp;ć­ŁćŻć­¤çąťćşćĺˇĽä˝äşşĺďźéčŚä¸ş \ConTeXt\ ĺŽäšçŹŚĺčŞĺˇąĺä˝čŚćąçćçŽć&nbsp;ˇĺźďźä¸ćäťč˝ä¸şä˝&nbsp;ćäžä¸ä¸ŞçŽĺçç¤şäžďźĺ¸ćĺŻšä˝&nbsp;ććĺ¸ŽĺŠă

ç°ĺ¨ďźĺčŽžćäťŹčŚĺŽäšä¸ç§ĺĺ­ĺŤä˝ foo çćçŽĺčĄ¨ć&nbsp;ˇĺźăéŚĺďźéčŚćç§ \ConTeXt\ çćäťśĺ˝ĺçşŚĺŽďźĺťşçŤä¸¤äť˝ćäťśďźä¸äť˝ćŻ publ-imp-foo.luaďźä¸äť˝ćŻ publ-imp-foo.texă

ĺ¨ publ-imp-foo.lua éĺĺĽäťĽä¸ĺĺŽšďź

\starttyping[option=LUA]
local specification = {
  name      = "foo",
  categories = {},
}
local categories = specification.categories
categories.book = {
  required = { "title" },
  optional = {"author", "editor",
              "year",
              "edition", "series", "volume", "number",
              "address", "publisher",
  },
}
return specification
\stoptyping

\noindent ä¸čż°äťŁç&nbsp;ćŻ Lua äťŁç&nbsp;ďźĺŽäšäşä¸ä¸ŞčĄ¨ă\ConTeXt\ ĺŻéčżčŻĽčĄ¨ćç˝ \BibTeX\ ćçŽć°ćŽéĺŞäşäżĄćŻćŻĺżéĄťçďźĺŞäşäżĄćŻćŻĺŻéçă

ĺ¨ publ-imp-foo.tex ćäťśä¸­ĺĺĽäťĽä¸ĺĺŽš

\starttyping[option=TEX]
\startbtxrenderingdefinitions[foo]
\definebtx
  [foo]
  [default=default,specification=foo]

\definebtxrendering
  [foo]
  [specification=foo,numbering=yes]
\stopbtxrenderingdefinitions
\stoptyping

\noindent ä¸čż°äťŁç&nbsp;ĺŽäšäş foo çŻĺ˘ĺĺśéťčŽ¤ć&nbsp;ˇĺźăć­¤ĺ¤ďź\ConTeXt\ ĺŽéä¸ćŻéčżä¸čż°äťŁç&nbsp;čˇçĽä˝&nbsp;ĺ¨ publ-imp-foo.lua ćäťśéĺŽäšçć°ćŽčĄ¨ă

ä¸é˘ĺ¨ publ-imp-foo.tex ćäťśä¸şćĺčŽşćĺŽäšćçŽĺčĄ¨ć&nbsp;ˇĺźďź

\starttyping[option=TEX]
\startsetups btx:foo:list:article
  \btxdoif {author} {
    \color[blue]{\btxflush{author}}\btxperiod\btxspace
  }
  \btxdoifelse {title} {
     \color[red]{\btxflush{title}}\btxperiod\btxspace
  }{
     No title\btxperiod\btxspace
  }
  \btxdoif {journal} {
    \color[magenta]{\btxflush{journal}}\btxcomma\btxspace
    \btxflush{year}ďź\nospace
    \btxdoifelse {volume} {
      \btxspace
      \btxflush{volume}
      \btxdoif {number} {
        \ignorespaces
        \btxleftparenthesis
        \btxflush{number}
        \btxrightparenthesis
      }
    }{
      \btxdoif {number} {
        \btxlabeltext{default:number}
        \btxspace
        \btxflush{number}
      }
    }
    \btxdoif {pages} {
     \nospace\btxcolon\btxspace\btxflush{pages}
    }
    \btxperiod
  }
  \removeunwantedspaces
\stopsetups
\stoptyping

čżćŻćŹććĄŁćŞć­˘čłć­¤ćä¸şĺ¤ćç \TeX\ äťŁç&nbsp;ďźä˝ćŻćčĄ¨čžžçĺĺŽšéĺ¸¸çŽĺďźäťäťćŻéĺŻšćĺčŽşćčŽžĺŽćçŽĺčĄ¨ĺşĺ˝ĺşç°ä˝čăćçŤ&nbsp;ĺç§°ăćĺĺç§°ăćśé´ăĺˇĺˇăćĺˇäťĽĺéĄľç&nbsp;ç­äżĄćŻăĺśä¸­ďź\type{\btxflush} ĺ˝äť¤ĺŻĺ° \ConTeXt\ äť \BibTeX\ ć°ćŽć&nbsp;źĺźä¸­č§ŁćĺşçäżĄćŻčžĺşĺ°ćççťćä¸­ďź\type{\btxcomma}ďź\type{\btxperiod} äšçąťçĺ˝äť¤çä¸şčĽżćéĺˇďźĺĽĺˇç­ć&nbsp;çšçŹŚĺˇďź\type{\btxspace} ćŻčĽżćçŠşć&nbsp;źďź\type{\btxdoif} äšçąťçĺ˝äť¤ćŻĺ¤ć­ \ConTeXt\ ĺŻš \BibTeX\ ć°ćŽć&nbsp;źĺźçč§Łćçťćä¸­ćŻĺŚĺĺŤćéĄšă

ĺ¨ publ-imp-foo.lua ĺ publ-imp-foo.tex ćäťśĺä¸çŽĺ˝ä¸ďźĺťşçŤćľčŻćäťśďźäžĺŚ foo.texďźĺśĺĺŽšä¸ş

\starttyping[option=TEX]
\usebtxdataset[foo.bib] % ĺ&nbsp;č˝˝ foo.bib
\starttext
Knuth ĺćäşćĺ­Śçźç¨čŻ­č¨ WEB\cite[knuth-1984-literate]ă
\blank
\usebtxdefinitions[foo]
\placelistofpublications
\stoptext
\stoptyping

ç¨äşéŞčŻä¸čż°ĺŽäšĺčćçŽçąťčĄ¨ć&nbsp;ˇĺź foo ćŻĺŚĺŻç¨ăçťćä¸ş

\blank[line]
\midaligned{\externalfigure[06/bibtex-example-04.pdf]}

\section{ĺ°çť}

ĺčćçŽçć&nbsp;ˇĺźďźććťč§ĺžćŻĺ­ŚćŻçćżćĽĺŹäşşçä¸čĽżăĺä¸çŻčŽşćďźĺłä˝żéä¸ĺ&nbsp;ĺçŻĺčćçŽďźç¨ \ConTeXt\ ĺčĄ¨čżčĄćçďźä¸ĺćçŤ&nbsp;ĺĺŽšçćčč´šçćśé´ç¸ćŻďźĺŽĺ¨ĺŻäťĽĺż˝çĽä¸čŽĄăçśčĺ¨ĺ­ŚćŻçďźĺčćçŽĺŚä˝ćçďźĺ´ćäşä¸é¨ĺ­ŚéŽăĺčĽä˝&nbsp;ĺä¸Şĺ°ćśäžçśćŞč˝ĺ­ŚäźĺŚä˝ä¸ş \ConTeXt\ ĺŽäšĺčćçŽć&nbsp;ˇĺźďźćĺťşčŽŽéäžżéä¸ä¸Ş \ConTeXt\ é˘ĺŽäšçć&nbsp;ˇĺźä˝żç¨ăĺžćçŤ&nbsp;ćçťĺŽç¨żĺďźĺćĺˇĽç¨ \ConTeXt\ ĺčĄ¨ĺ°ĺčćçŽĺśä˝ćä˝&nbsp;éčŚçć&nbsp;ˇĺźă</pre></body></html>