Compare commits
7 Commits
ff8d813637
...
cd1601abe0
Author | SHA1 | Date | |
---|---|---|---|
|
cd1601abe0 | ||
|
77de7e82ce | ||
|
9ee5e7efa3 | ||
|
81d9cd4bde | ||
|
c3dd41d8e6 | ||
|
c0460c15a8 | ||
|
f98bd8927e |
|
@ -10,3 +10,6 @@
|
||||||
|
|
||||||
Fixed some minor issues in version numbers and in the manual.
|
Fixed some minor issues in version numbers and in the manual.
|
||||||
|
|
||||||
|
### 2024/04/13: Version 1.1
|
||||||
|
|
||||||
|
Various fixes in the documentation and new convenience macro `\crfnm@declareType`.
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# crossrefenum 2023/02/20 v1.0.2
|
# crossrefenum 2024/04/13 v1.1
|
||||||
|
|
||||||
Smart typesetting of enumerated cross-references for various TeX formats.
|
Smart typesetting of enumerated cross-references for various TeX formats.
|
||||||
|
|
||||||
Copyright (C) 2022-2023
|
Copyright (C) 2022-2024
|
||||||
by Bastien Dumont <bastien.dumont@posteo.net>
|
by Bastien Dumont <bastien.dumont@posteo.net>
|
||||||
|
|
||||||
CTAN: `macros/generic/crossrefenum`
|
CTAN: `macros/generic/crossrefenum`
|
||||||
|
@ -66,7 +66,7 @@ and put in it `crossrefenum.tex` and, if required,
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Copyright 2022-2023 by Bastien Dumont (bastien.dumont@posteo.net)
|
Copyright 2022-2024 by Bastien Dumont (bastien.dumont@posteo.net)
|
||||||
|
|
||||||
crossrefenum.tex is free software: you can redistribute it and/or modify
|
crossrefenum.tex is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -22,7 +22,7 @@ $endif$
|
||||||
|
|
||||||
\setupbodyfontenvironment[default][em=italic]
|
\setupbodyfontenvironment[default][em=italic]
|
||||||
\definefontfamily[mainface][rm][cochineal]
|
\definefontfamily[mainface][rm][cochineal]
|
||||||
\definefontfamily[mainface][ss][linuxbiolinumo]
|
\definefontfamily[mainface][ss][libertinussans]
|
||||||
\definefontfamily[mainface][tt][nimbusmonops][features=none]
|
\definefontfamily[mainface][tt][nimbusmonops][features=none]
|
||||||
\setupbodyfont[mainface,12pt]
|
\setupbodyfont[mainface,12pt]
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ $endif$
|
||||||
$if(license)$
|
$if(license)$
|
||||||
\startlicensepagemakeup
|
\startlicensepagemakeup
|
||||||
\inframed[frame=off, width=0.66\textwidth, align=normal]{%
|
\inframed[frame=off, width=0.66\textwidth, align=normal]{%
|
||||||
Copyright (C) 2022-2023 Bastien Dumont.
|
Copyright (C) 2022-2024 Bastien Dumont.
|
||||||
Permission is granted to copy, distribute and/or modify this document
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
under the terms of the GNU Free Documentation License, Version 1.3
|
under the terms of the GNU Free Documentation License, Version 1.3
|
||||||
or any later version published by the Free Software Foundation;
|
or any later version published by the Free Software Foundation;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
title: "crossrefenum"
|
title: "crossrefenum"
|
||||||
subtitle: "Smart typesetting of enumerated cross-references for various TeX formats"
|
subtitle: "Smart typesetting of enumerated cross-references for various TeX formats"
|
||||||
author: Bastien Dumont
|
author: Bastien Dumont
|
||||||
date: 2023/02/20
|
date: 2024/04/13
|
||||||
lang: en-US
|
lang: en-US
|
||||||
toc: true
|
toc: true
|
||||||
license: true
|
license: true
|
||||||
|
@ -40,7 +40,7 @@ you can do:
|
||||||
|
|
||||||
* `\input{crossrefenum}` (generic);
|
* `\input{crossrefenum}` (generic);
|
||||||
* `\usepackage{crossrefenum}` (LaTeX;
|
* `\usepackage{crossrefenum}` (LaTeX;
|
||||||
must be called after _nameref_ if you use _hyperref_);
|
must be called after _nameref_ if you use _hyperref_`\kern1.5pt`{=context});
|
||||||
* `\usemodule[crossrefenum]` (ConTeXt).
|
* `\usemodule[crossrefenum]` (ConTeXt).
|
||||||
|
|
||||||
## Basic invocation
|
## Basic invocation
|
||||||
|
@ -164,7 +164,7 @@ for instance, you may want to use the word “and”
|
||||||
before the last note number if the reference type is a simple one (`note`),
|
before the last note number if the reference type is a simple one (`note`),
|
||||||
and a comma if it is comes in second in a double reference (e.g. in `pagenote`).
|
and a comma if it is comes in second in a double reference (e.g. in `pagenote`).
|
||||||
To achieve this, you should redefine `\crfnmDefaultEnumDelimInSecond`
|
To achieve this, you should redefine `\crfnmDefaultEnumDelimInSecond`
|
||||||
and `\crfnmDefaultBeforeLastInEnumInSecond`.
|
and `\crfnmDefaultBeforeLastInSecond`.
|
||||||
By default, these macros fall back respectively
|
By default, these macros fall back respectively
|
||||||
on `\crfnmDefaultEnumDelim` and `\crfnmDefaultBeforeLastInEnum`.
|
on `\crfnmDefaultEnumDelim` and `\crfnmDefaultBeforeLastInEnum`.
|
||||||
|
|
||||||
|
@ -215,6 +215,8 @@ use an empty group (e.g. `\def\crfnmPageEnumDelim{}`).
|
||||||
Adding support for new types consists in defining the related macros in your preamble.
|
Adding support for new types consists in defining the related macros in your preamble.
|
||||||
Here is a commented example that would add support for references to lines in ConTeXt
|
Here is a commented example that would add support for references to lines in ConTeXt
|
||||||
if this feature were not already included in _crossrefenum_.
|
if this feature were not already included in _crossrefenum_.
|
||||||
|
We suppose that the labels are inserted in the document using the standard ConTeXt macros,
|
||||||
|
i.e. `\someline` for line references and `\pagereference` for page references.
|
||||||
|
|
||||||
```{.tex}
|
```{.tex}
|
||||||
% Register the types. Take care about capitalization!
|
% Register the types. Take care about capitalization!
|
||||||
|
@ -226,10 +228,8 @@ if this feature were not already included in _crossrefenum_.
|
||||||
\def\crfnm@pageline{Pageline}
|
\def\crfnm@pageline{Pageline}
|
||||||
|
|
||||||
%% Add them to the lists of known types.
|
%% Add them to the lists of known types.
|
||||||
\crfnm@newListFrom[\crfnm@simpleRefTypes][\crfnm@line] -> \crfnm@simpleRefTypes
|
\crfnm@declareType[simple][\crfnm@line]
|
||||||
\crfnm@newListFrom[\crfnm@doubleRefTypes][\crfnm@pageline] -> \crfnm@doubleRefTypes
|
\crfnm@declareType[double][\crfnm@pageline]
|
||||||
\crfnm@newListFrom[\crfnm@supportedTypes][\crfnm@line] -> \crfnm@supportedTypes
|
|
||||||
\crfnm@newListFrom[\crfnm@supportedTypes][\crfnm@pageline] -> \crfnm@supportedTypes
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```{.tex}
|
```{.tex}
|
||||||
|
@ -244,6 +244,7 @@ if this feature were not already included in _crossrefenum_.
|
||||||
|
|
||||||
% Define the macro used by \crossrefenum internally
|
% Define the macro used by \crossrefenum internally
|
||||||
% to retrieve the raw reference number without typesetting it.
|
% to retrieve the raw reference number without typesetting it.
|
||||||
|
% This macro must be purely expandable.
|
||||||
% If you want to support multiple formats,
|
% If you want to support multiple formats,
|
||||||
% see how the macro \crfnm@case is used in crossrefenum.tex.
|
% see how the macro \crfnm@case is used in crossrefenum.tex.
|
||||||
% Note: the Lua function get_raw_ref_number is defined
|
% Note: the Lua function get_raw_ref_number is defined
|
||||||
|
@ -275,7 +276,7 @@ If you have wishes or hints about this, please contact me.
|
||||||
|
|
||||||
## Compatibility issues
|
## Compatibility issues
|
||||||
|
|
||||||
With LaTeX, the _nameref_ package (required by _hyperref_)
|
With LaTeX, the _nameref_ package (required by _hyperref_`\kern1.5pt`{=context})
|
||||||
must be loaded explicitely before _crossrefenum_.
|
must be loaded explicitely before _crossrefenum_.
|
||||||
However, if the links in the output of `\crossrefenum` (not the numbers)
|
However, if the links in the output of `\crossrefenum` (not the numbers)
|
||||||
point to a wrong location, you may wish to patch the macro
|
point to a wrong location, you may wish to patch the macro
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
\def\crfnmName{crossrefenum}
|
\def\crfnmName{crossrefenum}
|
||||||
\def\crfnmShortDesc{Smart typesetting of enumerated cross-references for various TeX formats}
|
\def\crfnmShortDesc{Smart typesetting of enumerated cross-references for various TeX formats}
|
||||||
\def\crfnmAuthor{Bastien Dumont}
|
\def\crfnmAuthor{Bastien Dumont}
|
||||||
\def\crfnmDate{2023/02/20}
|
\def\crfnmDate{2024/04/13}
|
||||||
\def\crfnmVersion{1.0.2}
|
\def\crfnmVersion{1.1}
|
||||||
%
|
%
|
||||||
% Copyright 2022-2023 by Bastien Dumont (bastien.dumont@posteo.net)
|
% Copyright 2022-2024 by Bastien Dumont (bastien.dumont@posteo.net)
|
||||||
%
|
%
|
||||||
% crossrefenum.tex is free software: you can redistribute it and/or modify
|
% crossrefenum.tex is free software: you can redistribute it and/or modify
|
||||||
% it under the terms of the GNU General Public License as published by
|
% it under the terms of the GNU General Public License as published by
|
||||||
|
@ -472,8 +472,7 @@
|
||||||
|
|
||||||
\def\crfnm@newListFrom[#1][#2] -> #3{%
|
\def\crfnm@newListFrom[#1][#2] -> #3{%
|
||||||
% #1 is either a list or a reference.
|
% #1 is either a list or a reference.
|
||||||
% #2 is a reference.
|
% #2 is the reference appended to #1.
|
||||||
% #2 is appended to #1.
|
|
||||||
% #3 is the control sequence which the resulting list will be bound to.
|
% #3 is the control sequence which the resulting list will be bound to.
|
||||||
\crfnm@ifIsList[#1]{%
|
\crfnm@ifIsList[#1]{%
|
||||||
\edef#3{#1{#2}}%
|
\edef#3{#1{#2}}%
|
||||||
|
@ -481,6 +480,12 @@
|
||||||
\edef#3{{#1}{#2}}%
|
\edef#3{{#1}{#2}}%
|
||||||
}%
|
}%
|
||||||
}
|
}
|
||||||
|
\def\crfnm@addToList[#1][#2]{\crfnm@newListFrom[#1][#2] -> #1}
|
||||||
|
\def\crfnm@declareType[#1][#2]{%
|
||||||
|
% #1 is "simple" or "double", #2 is the type
|
||||||
|
\expandafter\crfnm@addToList\expandafter[\csname crfnm@#1RefTypes\endcsname][#2]%
|
||||||
|
\crfnm@addToList[\crfnm@supportedTypes][#2]%
|
||||||
|
}
|
||||||
|
|
||||||
\def\crfnm@replaceFirstInList[#1]#2{%
|
\def\crfnm@replaceFirstInList[#1]#2{%
|
||||||
% #1 is a token, #2 is a list of tokens
|
% #1 is a token, #2 is a list of tokens
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
%D subtitle=Smart typesetting of enumerated cross-references for various TeX formats,
|
%D subtitle=Smart typesetting of enumerated cross-references for various TeX formats,
|
||||||
%D author=Bastien Dumont,
|
%D author=Bastien Dumont,
|
||||||
%D date=2022/11/11,
|
%D date=2022/11/11,
|
||||||
%D url=%TODO,
|
%D url=https://ctan.org/tex-archive/macros/generic/crossrefenum/tex/t-crossrefenum.tex,
|
||||||
%D copyright=Bastien Dumont,
|
%D copyright=Bastien Dumont,
|
||||||
%D license=GNU Public License v. 3.0 or higher]
|
%D license=GNU Public License v. 3.0 or higher]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user