Linux command
refer 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Process a document with bibliographic references
refer [document.ms] | troff -ms
Use a specific bibliography database
refer -p [references.bib] [document.ms]
Process with groff
groff -ms -R [document.ms]
Generate references in footnote style
refer -e [document.ms]
说明
refer is a troff preprocessor that handles bibliographic references in documents. It searches bibliography databases for citations and formats them according to specified styles. Citations in the document are marked with . and . delimiters containing keywords that identify the reference. Refer searches the bibliography for matching entries and inserts formatted citations and reference list entries. Bibliography files use a simple format with fields identified by single letters (%A for author, %T for title, %J for journal, etc.). Each reference is separated by blank lines. Refer is typically used in a pipeline with other troff preprocessors (eqn, tbl, pic) and the troff/groff formatter. The -R option to groff invokes refer automatically.
参数
- -p _bibfile_
- Search specified bibliography file (can be repeated)
- -e
- Accumulate references and print at end (endnotes style)
- -n
- Do not search default bibliography file
- -l _m_,_n_
- Label references with m significant letters and n digits
- -a _n_
- Reverse first n author names (last name first)
- -b
- Bare mode; suppress automatic numbering
- -c _fields_
- Capitalize fields as specified
- -k _field_
- Use specified field as citation key
- -s _spec_
- Sort references according to specification
- -B _field.macro_
- Set bibliography mode
- -S
- Produce references compatible with sortbib
FAQ
What is the refer command used for?
refer is a troff preprocessor that handles bibliographic references in documents. It searches bibliography databases for citations and formats them according to specified styles. Citations in the document are marked with . and . delimiters containing keywords that identify the reference. Refer searches the bibliography for matching entries and inserts formatted citations and reference list entries. Bibliography files use a simple format with fields identified by single letters (%A for author, %T for title, %J for journal, etc.). Each reference is separated by blank lines. Refer is typically used in a pipeline with other troff preprocessors (eqn, tbl, pic) and the troff/groff formatter. The -R option to groff invokes refer automatically.
How do I run a basic refer example?
Run `refer [document.ms] | troff -ms` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p _bibfile_ do in refer?
Search specified bibliography file (can be repeated)