summaryrefslogtreecommitdiff
path: root/macros/luatex/optex/cite-bib.opm
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/optex/cite-bib.opm')
-rw-r--r--macros/luatex/optex/cite-bib.opm80
1 files changed, 43 insertions, 37 deletions
diff --git a/macros/luatex/optex/cite-bib.opm b/macros/luatex/optex/cite-bib.opm
index 7f5b184d93..44f8dee055 100644
--- a/macros/luatex/optex/cite-bib.opm
+++ b/macros/luatex/optex/cite-bib.opm
@@ -3,7 +3,9 @@
\_codedecl \cite {Cite, Biblioraphy <2020-03-09>} % loaded in format
\_doc -----------------------------
- Registers used by `\cite`, `\bib` macros are declared here
+ Registers used by `\cite`, `\bib` macros are declared here.
+ The \`\bibnum` counts the bibliography items from one.
+ The \`\bibmark` is used when `\nonumcitations` is set.
\_cod -----------------------------
\_newcount\_bibnum % the bibitem counter
@@ -12,15 +14,18 @@
\_public \bibnum \bibmark ;
\_doc -----------------------------
- `\cite [<label>,<label>,...,<label>]` manages <labes> using `\_citeA`
- and prints prints `[<bib-marks>]` using `\_printsavedcites`.
- `\nocite [<label>,<label>,...,<label>]` only manages <labels> but prints nothing.
- `\rcite [<label>,<label>,...,<label>]` behaves like `\cite` but prints
+ \`\cite` `[<label>,<label>,...,<label>]` manages <labes> using `\_citeA`
+ and prints `[<bib-marks>]` using `\_printsavedcites`.
+ \nl
+ \`\nocite` `[<label>,<label>,...,<label>]` only manages <labels> but prints nothing.
+ \nl
+ \`\rcite` `[<label>,<label>,...,<label>]` behaves like `\cite` but prints
<bib-marks> without brackets.
- `\ecite [<label>]{<text>}` behaves like `\rcite [<label>]` but prints
+ \nl
+ \`\ecite` `[<label>]{<text>}` behaves like `\rcite [<label>]` but prints
<text> instead <bib-mark>. The <text> is hyperlinked like <bib-marks>
when `\cite` or `\rcite` is used.
- The emptpty internal macro `\_savedcites` will include the <bib-marks> list to
+ The emptpty internal macro \`\_savedcites` will include the `<bib-marks>` list to
be printed. This list is set by `\_citeA` inside group and it is used by
`\_printsavedcites` in the same group. Each `\cite`/`\rcite`/`\ecite` macro
starts from empty list of <bib-marks> because new group is opened.
@@ -36,16 +41,16 @@
\_public \cite \nocite \rcite \ecite ;
\_doc -----------------------------
- <bib-marks> may be numbers or a special text related to cited bib-entry.
- It depends on `\nonumcitations` and on used bib-style. The mapping from
- <label> to <bib-makr> is done when `\bib` or `\usebib` is processed.
+ `<bib-marks>` may be numbers or a special text related to cited bib-entry.
+ It depends on \`\nonumcitations` and on used bib-style. The mapping from
+ <label> to <bib-mark> is done when `\bib` or `\usebib` is processed.
These macros store the information to
- `\_Xbib{<label>}{<number>}{<nonumber>}` where <number> and <nonumber> are
+ \`\_Xbib``{<label>}{<number>}{<nonumber>}` where <number> and <nonumber> are
two variants of <bib-mark> (numbered or text-like). This information is
read from `.ref` file and it is saved to macros
- \_bib:<label> and \_bibm:<number>. First one includes number and second
+ `\_bib:<label>` and `\_bibm:<number>`. First one includes number and second
one includes <nonumber>. The `\_lastbibnum` macro includes last number of
- bib-entry used in the document. A designer can use it to set apropriate
+ bib-entry used in the document. A designer can use it to set appropriate
indentation when printing the list of all bib-entries.
\_cod -----------------------------
@@ -53,7 +58,7 @@
\_if^#3^\_else\_sdef{_bim:#2}{#3}\_fi\_def\_lastbibnum{#2}}
\_doc -----------------------------
- `\_citeA <label>,` processes one label from list of labels given in the
+ \`\_citeA` `<label>,` processes one label from list of labels given in the
parameter of `\cite`, `\nocite`, `\rcite` or `\ecite` macros. It adds the
<label> to global list `\_citelist` which will be used by `\usebib` (it
must to know what <labels> are used in the document in order to pick-up
@@ -61,19 +66,19 @@
space and not to save the same <label> to `\_citelist` twice, we
distinguish four cases:
\begitems
- * <label> was not declared by `\_Xbib` and it is first such <label> in the
+ * `<label>` was not declared by \^`\_Xbib` and it is first such <label> in the
document: Then `\_bib:<label>` is undefined and we save label using
`\_addcitlist`, write warning on the terminal and define
`\_bib:<label>` as empty.
- * <label> was not declared by `\_Xbib` but it was used previously in the
+ * `<label>` was not declared by \^`\_Xbib` but it was used previously in the
document: Then `\_bib:<label>` is empty and we do nothing (only data to
`\_savedcites` are saved).
- * <label> was declared by `\_Xbib` and it is first such <label> in the
+ * `<label>` was declared by \^`\_Xbib` and it is first such <label> in the
document: Then `\_bin:<label>` includes `\_bibnn{<number>}&` and we
- test this case by `\if &\_bibnn{<number>}&` when `\_bibnn{<number>}`
+ test this case by `\if &\_bibnn{<number>}&`. This is true when `\_bibnn{<number>}`
expands to empty. The <label> is saved by `\_addcitelist` and
`\_bib:<label>` is re-defined directly as <number>.
- * <label> was declared by `\_Xbib` and it was used previously in the
+ * `<label>` was declared by \^`\_Xbib` and it was used previously in the
document. Then we do nothing (only data to `\_savedcites` are saved.
\enditems
The `\_citeA` macro runs repeatedly over whole list of <labels>.
@@ -104,15 +109,16 @@
\_def\_citelist{}
\_doc -----------------------------
- The <bib-marks> (in numeric or text form) are saved in `\_savedcites`
+ The `<bib-marks>` (in numeric or text form) are saved in \^`\_savedcites`
macro separated by commas.
- The `\_printsavedcites` prints them by normal order or sorted if
- `\sortcitations` is specified or condensed if `\shordcitations` is
- specified.
- `\sortcitations` appends the dummy number 300000 and we suppose that normal
+ The \`\_printsavedcites` prints them by normal order or sorted if
+ \`\sortcitations` is specified or condensed if \`\shordcitations` is
+ specified.\nl
+ The `\sortcitations` appends the dummy number 300000 and we suppose that normal
numbers of bib-entries are less than this constant.
This constant is removed after sorting algorithm.
- The macros for <bib-marks> printing folows (sorry, without detail
+ The \`\shortcitations` sets simply `\_lastcitenum=1`.
+ The macros for <bib-marks> printing follows (sorry, without detail
documentation). They are documented in `opmac-d.pdf` (but only in Czech).
\_cod -----------------------------
@@ -173,12 +179,12 @@
\_public \nonumcitations \sortcitations \shortcitations ;
\_doc -----------------------------
- The `\bib [<label>] {<optional bib-mark>}` prints one bib-entry
+ The \`\bib` `[<label>] {<optional bib-mark>}` prints one bib-entry
without reading any database. The bib-enty follows after this command.
This command counts the used `\bib`s from one by `\bibnum` counter and
- saves `\_Xbib{<label>}{\_the\_bibnum}{\_the\_bibmark}` into `.ref` file
+ saves \^`\_Xbib``{<label>}{\_the\_bibnum}{\_the\_bibmark}` into `.ref` file
immediately using `\_wbib`. This is the core of creation of mapping from
- <labels> to <bib-marks>.
+ `<labels>` to `<bib-marks>`.
\_cod -----------------------------
\_def\_bib[#1]{\_def\_tmp{\_isnextchar={\_bibA[#1]}{\_bibmark={}\_bibB[#1]}}%
@@ -196,18 +202,18 @@
\_public \bib ;
\_doc -----------------------------
- The `\_printbib` prints the bib-entry itself. You can re-define it if you
+ The \`\_printbib` prints the bib-entry itself. You can re-define it if you
want different design. The `\_pritbib` starts in horizontal mode after
`\noindent` and after the eventual hyperlink destination is inserted.
By default, the `\_printbib` sets the indentation
by `\hangindent` and prints numeric <bib-marks> by
`\llap{[\the\bibnum]}` If `\nonumcitations` then the `\_citelinkA` is not
empty and <bib-marks> (`\the\bibnum` nor `\the\bibmark`) are not printed.
- The text of bib-entry follows. User can create this text manualy
- using `\bib` command or it is generated automaticaly from a `.bib` database
+ The text of bib-entry follows. User can create this text manually
+ using `\bib` command or it is generated automatically from a `.bib` database
by `\usebib` command.
- The vertical space between bib-entries is controlled by `\_bibskip` macro.
+ The vertical space between bib-entries is controlled by \`\_bibskip` macro.
\_cod -----------------------------
\_def \_printbib {\_hangindent=\_iindent
@@ -216,11 +222,11 @@
\_def \_bibskip {\_ifnum\_bibnum>0 \_smallskip \_fi}
\_doc -----------------------------
- The `\usebib` command is implemted in `usebib.opm` file which is loaded
+ The \`\usebib` command is implemted in `usebib.opm` file which is loaded
when the `\usebib` command is firstly used.
The `usebib.opm` file loads the `librarian.tex` for scaning the `.bib`
- files. This macro is external created by Paul Isambert. This is only one
- such situation where \OpTeX/ macros depends on an external macro.
+ files. See the section~\ref[usebib], where the file `usebib.opm` is
+ documented.
\_cod -----------------------------
\_def\_usebib{\_par \_opinput {usebib.opm} \_usebib}
@@ -231,8 +237,8 @@
before the `\usebib` command is used because `\usebib` prints only such
bib-entries their <labels> are saved in the `\_citelist`. But if some
`\cite` is used after `\usebib`, then `\usebib` sets `\_addcitelist` to
- `\_writeXcite`, so such `\cite` saves the information to the
- `.ref`file in the format `\_Xcite{<label>}`. Such information are copied
+ \`\_writeXcite`, so such `\cite` saves the information to the
+ `.ref`file in the format \`\_Xcite``{<label>}`. Such information are copied
to `\_citelistB` during reading `.ref` file and `\usebib` concats two
lists of <labels> from `\_citelist` and `\_citelistB` and
uses this concatenated list.