General ⇒ Database, List, References
Database, List, References
I would like to create a list with 50 items or so. Each item needs 3 names, for example with
Reference: Number: Item: Description
tag01: 091102S61S01: Push Button: Start sequence
tag02: 091102S61S02: Push Button: Stop sequence
tag03: 091102S61S03: Button Switch: Mode Selector
I want to make references to these, say my text will be:
When operator push /tag01 the machine starts
When operator push /tag02 the machine stops
Actual text should be
When operator push 091102S61S01: Push Button: Start sequence the machine starts
When operator push 091102S61S02: Push Button: Stop sequence the machine stops
I tried with BibTex, but it was not good, too difficult to get the actual text right
Anyone wanna try ? THX
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
Database, List, References
Perhaps show what you tried. Besides BibTeX, you could use biblatex.
Stefan
Database, List, References
What I get is:
When operator push 'start sequence' (1s01) the machine starts
When operator push 'stop sequence' (1s02) the machine stops
I want a form like year:title:author
---------------------------------------------------------------------
MY MAIN
\documentclass{article}
\usepackage{natbib}
\title{test}
\author{test}
\date{\today}
\begin{document}
\maketitle
When operator push \citet{tag01} the machine starts\\
When operator push \citet{tag02} the machine stops
\newpage
\bibliographystyle{apalike}
\bibliography{bibliography.bib}
\end{document}
---------------------------------------------------------------------
MY BIBLIOTGAPHY.bib
@book{tag01,
title={push button},
author={'start sequence'},
volume={},
year={091102s61s01},
publisher={}
}
@book{tag02,
title={push button},
author={'stop sequence'},
volume={},
year={091102s61s02},
publisher={}
}
Database, List, References

- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
Database, List, References
If you find out something, let us please know. I'm interested.
Stefan
Database, List, References
Code: Select all
\documentclass{article}
\usepackage{longtable}
\usepackage[nostyles]{glossaries-extra}
\newcommand*{\newoperation}[4]{%
\newglossaryentry{#1}{name={#2},symbol={#3},description={#4}}%
}
\newcommand*{\operationref}[1]{%
\glsdisp{#1}{\textbf{\glsentryname{#1}: \glsentrysymbol{#1}: `\glsentrydesc{#1}'}}%
}
\newoperation{tag01}{091102S61S01}{Push Button}{Start sequence}
\newoperation{tag02}{091102S61S02}{Push Button}{Stop sequence}
\newoperation{tag03}{091102S61S03}{Button Switch}{Mode Selector}
\newglossarystyle{operation}{%
\renewenvironment{theglossary}%
{\begin{longtable}{lll}}%
{\end{longtable}}%
\renewcommand*{\glossaryheader}{%
\bfseries Number & \bfseries Item & \bfseries Description\tabularnewline
\endhead
}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand{\glossentry}[2]{%
\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
\glossentrysymbol{##1} & \glossentrydesc{##1}\tabularnewline
}%
\renewcommand{\subglossentry}[3]{\glossentry{##2}{##3}}%
\renewcommand*{\glsgroupskip}{}%
}
\begin{document}
When operator push \operationref{tag01} the machine starts
When operator push \operationref{tag02} the machine stops
\printunsrtglossary[title={List of Operations},style=operation]
\end{document}
Since you already have a .bib file, here's another approach using glossaries-extra with bib2gls. If file "testdata.bib" contains:
Code: Select all
@entry{tag01,
operationnumber={091102S61S01},
operationitem={Push Button},
description={Start sequence}
}
@entry{tag02,
operationnumber={091102S61S02},
operationitem={Push Button},
description={Stop sequence}
}
@entry{tag03,
operationnumber={091102S61S03},
operationitem={Button Switch},
description={Mode Selector}
}
Code: Select all
\documentclass{article}
\usepackage{longtable}% needed for custom style
\usepackage[nostyles,% using a custom style
record% using bib2gls
]{glossaries-extra}
\GlsXtrLoadResources[
src={test-data},% entries defined in test-data.bib
field-aliases={% convert custom field names to keys recognised by glossaries-extra.sty
operationnumber=name,
operationitem=symbol
},
sort=letter-case,% case-sensitive character code sort
sort-field=name% sort by 'name' field (which has been obtained from 'operationnumber')
]
\newcommand*{\operationref}[1]{%
\glsdisp{#1}{\textbf{\glsentryname{#1}: \glsentrysymbol{#1}: \glsentrydesc{#1}}}%
}
\newglossarystyle{operation}{%
\renewenvironment{theglossary}%
{\begin{longtable}{lll}}%
{\end{longtable}}%
\renewcommand*{\glossaryheader}{%
\bfseries Number & \bfseries Item & \bfseries Description\tabularnewline
\endhead
}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand{\glossentry}[2]{%
\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
\glossentrysymbol{##1} & \glossentrydesc{##1}\tabularnewline
}%
\renewcommand{\subglossentry}[3]{\glossentry{##2}{##3}}%
\renewcommand*{\glsgroupskip}{}%
}
\begin{document}
When operator push \operationref{tag01} the machine starts
When operator push \operationref{tag02} the machine stops
\printunsrtglossary[title={List of Operations},style=operation]
\end{document}
selection=all
to the resource options:
Code: Select all
\GlsXtrLoadResources[
src={test-data},% entries defined in test-data.bib
field-aliases={% convert custom field names to keys recognised by glossaries-extra.sty
operationnumber=name,
operationitem=symbol
},
sort=letter-case,% case-sensitive character code sort
sort-field=name,% sort by 'name' field (which has been obtained from 'operationnumber')
selection=all
]
Regards
Nicola Talbot
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
Database, List, References
