Guest User

Untitled

a guest
Jul 5th, 2018
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. \documentclass{article}
  2. \usepackage[utf8]{inputenc}
  3. \usepackage[T1]{fontenc}
  4. \usepackage[american]{babel}
  5. \usepackage[babel]{csquotes}
  6. \usepackage[backend=biber,style=apa,hyperref]{biblatex}
  7. \DeclareLanguageMapping{american}{american-apa}
  8.  
  9. \begin{filecontents}{mybib.bib}
  10. @article{ref1,
  11. author = {Guyon, Isabelle and Elisseeff, Andr\'{e}},
  12. journal = {The Journal of Machine Learning Research},
  13. pages = {1157--1182},
  14. title = {{An introduction to variable and feature selection}},
  15. volume = {3},
  16. year = {2003}
  17. }
  18. @book{ref2,
  19. author = {Michel Goossens and Frank Mittelbach and Alexander Samarin},
  20. title = {The LaTeX Companion},
  21. year = {1993},
  22. publisher = {Addison-Wesley},
  23. address = {Reading, Massachusetts}
  24. }
  25. \end{filecontents}
  26.  
  27. \addbibresource{mybib.bib}
  28.  
  29. \AtBeginDocument{\renewcommand*{\finalandcomma}{}}
  30.  
  31. \AtEveryCitekey{\renewcommand*{\finalnamedelim}{%
  32. \ifthenelse{\value{listcount}>\maxprtauth}
  33. {}
  34. {\ifthenelse{\value{liststop}>2}
  35. {\finalandcomma\addspace\bibstring{and}\space}
  36. {\addspace\bibstring{and}\space}}}}
  37.  
  38. \AtBeginBibliography{\renewcommand*{\finalnamedelim}{%
  39. \ifthenelse{\value{listcount}>\maxprtauth}
  40. {}
  41. {\ifthenelse{\value{liststop}>2}
  42. {\finalandcomma\addspace\bibstring{and}\space}
  43. {\addspace\bibstring{and}\space}}}}
  44.  
  45. \begin{document}
  46. Lorem ipsum dolor sit amet \parencite{ref1}, consectetur adipiscing elit \parencite{ref2}.
  47.  
  48. \printbibliography
  49. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment