10

I am working on a document in LyX that uses Natbib for reference formatting. I like having author and year for the in-text citations. However, for the specific case of citing references in a table, I would like to use numbers instead then have a column of references showing which references match what numbers.

How can I do this using LyX?

Below is an image of what I want (but of course I don't want to be manually inserting numbers and changing them with every edit.

enter image description here

  • 2
    Personally, i would do stuff like that using table notes and add the references below the table. – Johannes_B Nov 18 '15 at 11:15
  • 1
    @Johannes_B, thanks for the suggestion, but this table will eventually be hundreds of rows and putting all the references at the bottom is untenable. – CephBirk Dec 5 '15 at 15:07
  • 3
    Imho manually numbering would be quite ok as you can (and should) reset the numbering in every row. It would be less work than having to insert \cite in every cell. Beside this I don't think that you can do it with natbib directly. babel. – Ulrike Fischer Dec 7 '15 at 9:29
2
+50

Just to make the very nice answer by Waldheri more precise, you can do:

\documentclass[a4paper,12pt]{article}
    \usepackage[round]{natbib}
    \bibpunct{(}{)}{,}{a}{}{,}
    \usepackage{filecontents}
\begin{filecontents}{mybibb.bib}
@BOOK{book1,
  AUTHOR =       {Alan, F.},
  TITLE =        {The book},
  PUBLISHER =    {The publishing house},
  YEAR =         {2015},
}
@BOOK{book2,
  AUTHOR =       {Zallan, D.},
  TITLE =        {The other book},
  PUBLISHER =    {The other publishing house},
  YEAR =         {2005},
}
\end{filecontents}
\newcommand{\superci}[1]{\textsuperscript{\citenum{#1}}}
\newcommand{\exsuperci}[1]{\superci{#1}\,\citet{#1}}
\begin{document}
\begin{tabular}{ll}
\hline
Observed                       & Reference\\\hline
Italy\superci{book1}           &     \exsuperci{book1}     \\
France\superci{book1,book2}    &     \exsuperci{book1}, \exsuperci{book2} \\
\hline
\end{tabular}
\bibliographystyle{plainnat}
\bibliography{mybibb}
\end{document} 

leading to the following enter image description here

3

Use natbib's \citenum command, as indicated in section 2.4 of Natbib's package manual (available here)

  • IMHO the bounty should go to Waldheri. – Denis Dec 12 '15 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.