Difference between revisions of "Template:Arxiv"
blackwiki>Mwtoews (using WP:DOC) |
(Rewrite to allow archive categories with new-style identifiers. Worked around a strange template bug; see comments) |
||
Line 1: | Line 1: | ||
− | [[arXiv]]: | + | [[arXiv]]:{{#if:{{{archive|{{{2|}}}}}} |
− | + | |{{#if:{{#pos:{{{id|{{{2}}}}}}|.}} | |
− | + | |[http://arxiv.org/abs/{{{id|{{{2|}}}}}} {{{id|{{{2|{{{2}}}}}}}}}] [{{{archive|{{{1}}}}}}] | |
− | + | |[http://arxiv.org/abs/{{{archive|{{{1|}}}}}}/{{{id|{{{2|}}}}}} {{{archive|{{{1|{{{1}}}}}}}}}/{{{id|{{{2|{{{2}}} }}}}}}] | |
− | + | }} | |
− | + | |[http://arxiv.org/abs/{{{id|{{{1|}}}}}} {{{id|{{{1|{{{1}}}}}}}}}] | |
− | + | }}<noinclude> | |
− | + | <!-- Explanation of the above line noise: | |
− | - | + | Remember, that the archive is the first, but optional, parameter. |
− | -- | + | The ID is {{{id|{{{2}}}}}} if a section is supplied, but {{{id|{{{1}}}}}} if not. |
+ | A section is supplied if {{{archive|{{{2|}}}}}} is non-empty. There are three cases (bottom to top in the above): | ||
+ | 1) id only. Generate [http://arxiv.org/abs/id id]. | ||
+ | 2) archive, with new-style ID (containing ., searched for using {{#pos:haystack|needle}}) | ||
+ | Generate [http://archiv.org/abs/id id] [archive]. (91 and 93 are [ and ]) | ||
+ | 3) archive and ID, old-style | ||
+ | Generate [http://arxiv.org/abs/archive/id archive/id]. | ||
+ | The trailing conditionals on the innermost parameters (using {{{ and }}} to prevent interpretation as parameters)) appear to be needed to produce sensible output on the template page. Deleting them produces STRANGE results. "{{#if:x|[http://example.com/ {{{1}}}]}}" is a minimal example. The given text is used so the result looks like a missing template parameter. Note that in the URLs, the alternative is simply blank. Wiki-guru requested, but what's there works for now. | ||
+ | --> | ||
{{template doc}} | {{template doc}} | ||
<!-- Add categories and interwikis to the /doc subpage, not here! --> | <!-- Add categories and interwikis to the /doc subpage, not here! --> | ||
</noinclude> | </noinclude> |
Revision as of 07:01, 7 July 2007
![]() | This template is intended for external links. It is not designed for use as a citation template for reliable sources. Please consider using {{Cite arXiv}} for citations. |
Purpose
Provides a uniform method of formatting arXiv links, and makes it simpler to update if the format of those links changes in future.
Usage
This template can be used in the following ways:
The parameters have the following meaning:
|1=
or|id=
or specifies the ID of the particular entry
Examples
Markup | Renders as |
---|---|
[[:Template:MultiReplace]] |
|
[[:Template:MultiReplace]] |
|
[[:Template:MultiReplace]] |
|
[[:Template:MultiReplace]] |
|
[[:Template:MultiReplace]] |
|
[[:Template:MultiReplace]] |
|
Citation Style 1 and Citation Style 2 templates include a |arxiv=
parameter with the same function.
Deprecated usage
These calling sequences were used for before 1 April 2007 when the new identifiers that removed the archive class from the identifiers themselves.
The older entries can still be linked to by removing the delimiting "." and subject class or category specifier from the identifier and delimiting the remaining archive specifier and the rest of the identifier (the dated entry number) with a slash ("/").
The parameters have the following meaning:
|1=
or|archive=
specifies the arXiv archive (full list here) using the abbreviated code|2=
or|id=
specifies the ID of the particular entry
Markup | Renders as |
---|---|
[[:Template:MultiReplace]] |
|
[[:Template:MultiReplace]] |
|
See also
- {{biorxiv}}
- {{Cite arXiv}}
- {{Catalog lookup link}}
The above documentation is transcluded from Template:Arxiv/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |