Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom class for bibliography style #4482

Merged
merged 11 commits into from
Dec 12, 2023
18 changes: 16 additions & 2 deletions Docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import sys
import urllib.request

import pybtex.plugin
from pybtex.style.formatting.unsrt import Style as UnsrtStyle
import sphinx_rtd_theme

sys.path.insert(0, os.path.join( os.path.abspath(__file__), '../Python') )
Expand All @@ -43,7 +45,8 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
Expand All @@ -58,7 +61,18 @@

# Relative path to bibliography file, bibliography style
bibtex_bibfiles = ['./refs.bib']
bibtex_default_style = 'unsrt'

class WarpXBibStyle(UnsrtStyle):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Can you please add inline comments or class doc strings to the reference for these options?

Copy link
Member Author

@eebasso eebasso Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, no problem. I'll add some comments and a link to the Sphinx documentation.

default_name_style = 'lastfirst'

def __init__(self, *args, **kwargs):
# Set 'abbreviate_names' to True before calling the superclass initializer
kwargs['abbreviate_names'] = True
super().__init__(*args, **kwargs)

pybtex.plugin.register_plugin('pybtex.style.formatting', 'warpxbibstyle', WarpXBibStyle)

bibtex_default_style = 'warpxbibstyle'

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
Expand Down
32 changes: 16 additions & 16 deletions Docs/source/latex_theory/allbibs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ @article{Vay2000
year = {2000}
}
@article{Vayjcp2011,
author = {Vay, J L and Geddes, C G R and Cormier-Michel, E and Grote, D P},
author = {Vay, J-L and Geddes, C G R and Cormier-Michel, E and Grote, D P},
doi = {10.1016/J.Jcp.2011.04.003},
journal = {Journal of Computational Physics},
month = {jul},
Expand Down Expand Up @@ -549,7 +549,7 @@ @article{Vaynim2005
}
@article{BulanovSV2014,

author = {{Bulanov S V and Wilkens J J and Esirkepov T Zh and Korn G and Kraft G and Kraft S D and Molls M and Khoroshkov V S}},
author = {Bulanov, S V and Wilkens, J J and Esirkepov, T Zh and Korn, G and Kraft, G and Kraft, S D and Molls, M and Khoroshkov, V S},
issn = {1063-7869},
journal = {Physics-Uspekhi},
number = {12},
Expand Down Expand Up @@ -616,7 +616,7 @@ @article{Yu2014
year = {2014}
}
@article{Vaypop2011,
author = {Vay, J -L. and Geddes, C G R and Esarey, E and Schroeder, C B and Leemans, W P and Cormier-Michel, E and Grote, D P},
author = {Vay, J.-L. and Geddes, C G R and Esarey, E and Schroeder, C B and Leemans, W P and Cormier-Michel, E and Grote, D P},
doi = {10.1063/1.3663841},
issn = {1070-664X},
journal = {Physics Of Plasmas},
Expand Down Expand Up @@ -784,7 +784,7 @@ @article{Cohenprstab2009
}
@article{Kaganovich2012,

author = {Kaganovich, Igor D. and Massidda, Scott and Startsev, Edward A. and Davidson, Ronald C. and Vay, Jean Luc and Friedman, Alex},
author = {Kaganovich, Igor D. and Massidda, Scott and Startsev, Edward A. and Davidson, Ronald C. and Vay, Jean-Luc and Friedman, Alex},
journal = {Nuclear Instruments and Methods in Physics Research, Section A: Accelerators, Spectrometers, Detectors and Associated Equipment},
keywords = {Beam dynamics,Longitudinal compression,Voltage errors},
pages = {48--63},
Expand All @@ -802,7 +802,7 @@ @article{Vincenti2016
year = {2016}
}
@article{Vaypop2008,
author = {Vay, J L},
author = {Vay, J-L},
doi = {10.1063/1.2837054},
journal = {Physics Of Plasmas},
month = {may},
Expand Down Expand Up @@ -856,7 +856,7 @@ @article{Greenwoodjcp04
}
@article{GodfreyIEEE2014,

author = {Godfrey, Brendan B. and Vay, Jean Luc and Haber, Irving},
author = {Godfrey, Brendan B. and Vay, Jean-Luc and Haber, Irving},
journal = {IEEE Transactions on Plasma Science},
keywords = {Accelerators,numerical stability,particle beams,particle-in-cell (PIC),relativistic effects,simulation,spectral methods},
number = {5},
Expand Down Expand Up @@ -885,7 +885,7 @@ @article{Wuprstab2011
year = {2011}
}
@article{VayAAC2010,
author = {Vay, J -. L and Geddes, C G R and Benedetti, C and Bruhwiler, D L and Cormier-Michel, E and Cowan, B M and Cary, J R and Grote, D P},
author = {Vay, J-L and Geddes, C G R and Benedetti, C and Bruhwiler, D L and Cormier-Michel, E and Cowan, B M and Cary, J R and Grote, D P},
doi = {10.1063/1.3520322},
journal = {Aip Conference Proceedings},
keywords = {[978-0-7354-0853-1/10/{\$}30.00]},
Expand All @@ -906,7 +906,7 @@ @article{Vayprl07
}
@article{VayJCP2013,

author = {Vay, Jean Luc and Haber, Irving and Godfrey, Brendan B.},
author = {Vay, Jean-Luc and Haber, Irving and Godfrey, Brendan B.},
journal = {Journal of Computational Physics},
keywords = {Domain decomposition,Electromagnetic,FFT,Fast fourier transform,Parallel,Particle-In-Cell,Spectral},
pages = {260--268},
Expand Down Expand Up @@ -1099,7 +1099,7 @@ @article{Kalmykovprl09
}
@article{Geddes2015,

author = {Geddes, Cameron G R and Rykovanov, Sergey and Matlis, Nicholas H. and Steinke, Sven and Vay, Jean Luc and Esarey, Eric H. and Ludewigt, Bernhard and Nakamura, Kei and Quiter, Brian J. and Schroeder, Carl B. and Toth, Csaba and Leemans, Wim P.},
author = {Geddes, Cameron G R and Rykovanov, Sergey and Matlis, Nicholas H. and Steinke, Sven and Vay, Jean-Luc and Esarey, Eric H. and Ludewigt, Bernhard and Nakamura, Kei and Quiter, Brian J. and Schroeder, Carl B. and Toth, Csaba and Leemans, Wim P.},
journal = {Nuclear Instruments and Methods in Physics Research, Section B: Beam Interactions with Materials and Atoms},
keywords = {Active interrogation,Homeland security,Laser plasma accelerator,Monoenergetic photon source,Nonproliferation},
pages = {116--121},
Expand All @@ -1121,7 +1121,7 @@ @article{Antonsenprl1992
}
@article{GodfreyCPC2015,

author = {Godfrey, Brendan B. and Vay, Jean Luc},
author = {Godfrey, Brendan B. and Vay, Jean-Luc},
journal = {Computer Physics Communications},
keywords = {Numerical stability,Particle-in-cell,Pseudo-Spectral Time-Domain,Relativistic beam},
pages = {221--225},
Expand Down Expand Up @@ -1198,7 +1198,7 @@ @article{Vaycpc04
}
@article{GodfreyJCP2014_PSATD,

author = {Godfrey, Brendan B. and Vay, Jean Luc and Haber, Irving},
author = {Godfrey, Brendan B. and Vay, Jean-Luc and Haber, Irving},
journal = {Journal of Computational Physics},
keywords = {Numerical stability,Particle-in-cell,Pseudo-spectral,Relativistic beam},
pages = {689--704},
Expand Down Expand Up @@ -1302,7 +1302,7 @@ @article{GodfreyJCP2014
}
@article{Godfrey2013,

author = {Godfrey, Brendan B. and Vay, Jean Luc},
author = {Godfrey, Brendan B. and Vay, Jean-Luc},
journal = {Journal of Computational Physics},
keywords = {Esirkepov algorithm,Numerical stability,Particle-in-cell,Relativistic beam},
pages = {33--46},
Expand Down Expand Up @@ -1714,7 +1714,7 @@ @article{Vaydpf09
}
@misc{Vay2014,

author = {Vay, Jean Luc and Godfrey, Brendan B.},
author = {Vay, Jean-Luc and Godfrey, Brendan B.},
booktitle = {Comptes Rendus - Mecanique},
keywords = {Numerical instability,Particle-In-Cell,Plasma simulation,Special relativity},
number = {10-11},
Expand All @@ -1732,7 +1732,7 @@ @article{Lehearxiv2015
}
@article{Friedman2014,

author = {Friedman, Alex and Cohen, Ronald H. and Grote, David P. and Lund, Steven M. and Sharp, William M. and Vay, Jean Luc and Haber, Irving and Kishek, Rami A.},
author = {Friedman, Alex and Cohen, Ronald H. and Grote, David P. and Lund, Steven M. and Sharp, William M. and Vay, Jean-Luc and Haber, Irving and Kishek, Rami A.},
journal = {IEEE Transactions on Plasma Science},
keywords = {Algorithms,Maxwell,Ned Birdsall,computer,laser,numerical simulation,particle beam,particle-in-cell,plasma},
number = {5},
Expand Down Expand Up @@ -1878,7 +1878,7 @@ @book{Birdsalllangdon
}
@inproceedings{Grote2005,

author = {Grote, David P. and Friedman, Alex and Vay, Jean Luc and Haber, Irving},
author = {Grote, David P. and Friedman, Alex and Vay, Jean-Luc and Haber, Irving},
booktitle = {AIP Conference Proceedings},
pages = {55--58},
title = {{The WARP code: Modeling high intensity ion beams}},
Expand Down Expand Up @@ -2172,7 +2172,7 @@ @article{Londrillo2010
year = {2010}
}
@article{GodfreyJCP2014_FDTD,
author = {Godfrey, Brendan B. and Vay, Jean Luc},
author = {Godfrey, Brendan B. and Vay, Jean-Luc},
journal = {Journal of Computational Physics},
keywords = {Finite difference time-domain,Numerical stability,Particle-in-cell,Relativistic beam},
pages = {1--6},
Expand Down