├── keyshuffling.pdf ├── LaTeX ├── images │ └── branchinstruction.jpg ├── references.bib ├── IEEEabrv.bib ├── keyshuffling.tex └── IEEEtran.bst └── README.md /keyshuffling.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Plailect/keyshuffling/HEAD/keyshuffling.pdf -------------------------------------------------------------------------------- /LaTeX/images/branchinstruction.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Plailect/keyshuffling/HEAD/LaTeX/images/branchinstruction.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Keyshuffling Attack for Persistent Early Code Execution in the Nintendo 3DS Secure Bootchain 2 | 3 | ## [View PDF](https://github.com/Plailect/keyshuffling/blob/master/keyshuffling.pdf) 4 | 5 | ### Abstract 6 | 7 | We demonstrate an attack on the secure bootchain of the Nintendo 3DS in order to gain early code execution. The attack utilizes the block shuffling vulnerability of the ECB cipher mode to rearrange keys in the Nintendo 3DS's encrypted keystore. Because the shuffled keys will deterministically decrypt the encrypted firmware binary to incorrect plaintext data and execute it, and because the device's memory contents are kept between hard reboots, it is possible to reliably reach a branching instruction to a payload in memory. This payload, due to its execution by a privileged processor and its early execution, is able to extract the hash of hardware secrets necessary to decrypt the device's encrypted keystore and set up a persistent exploit of the system. 8 | 9 | ### Background 10 | 11 | Information in this article (especially the keyshuffling vulnerability) is original, independent work unless cited otherwise. Note that the keyshuffling vulnerability detailed here is the same one documented publicly by much of this team including "stuckpixel" (also known as "dark_samus") on sites such as [3DBrew](https://www.3dbrew.org). Additionally, note that the persistence vulnerability detailed here is the same one documented publicly as "arm9loaderhax" by "plutoo", "derrek", and "smea" at the [2015 32c3 conference](https://media.ccc.de/v/32c3-7240-console_hacking). -------------------------------------------------------------------------------- /LaTeX/references.bib: -------------------------------------------------------------------------------- 1 | @electronic{32c3, 2 | author = {plutoo and derrek and smea}, 3 | title = {Breaking the 3DS}, 4 | day = {28}, 5 | month = {dec}, 6 | year = {2015}, 7 | url = {https://media.ccc.de/v/32c3-7240-console_hacking}, 8 | } 9 | 10 | @electronic{clevermind, 11 | author = {Delebile}, 12 | title = {Arm9LoaderHax - Deeper inside}, 13 | day = {15}, 14 | month = {feb}, 15 | year = {2016}, 16 | url = {http://www.clevermind.it/arm9loaderhax}, 17 | } 18 | 19 | @electronic{cryptosystem, 20 | author = {Yifan~Lu}, 21 | title = {The 3DS Cryptosystem}, 22 | day = {6}, 23 | month = {apr}, 24 | year = {2016}, 25 | url = {https://yifan.lu/2016/04/06/the-3ds-cryptosystem/}, 26 | } 27 | 28 | @electronic{3DS_System_Flaws, 29 | author = {3dbrew~Contributors}, 30 | title = {3DS System Flaws}, 31 | url = {https://www.3dbrew.org/wiki/3DS_System_Flaws}, 32 | } 33 | 34 | @electronic{OTP_Registers, 35 | author = {3dbrew~Contributors}, 36 | title = {OTP Registers}, 37 | url = {https://www.3dbrew.org/wiki/OTP_Registers}, 38 | } 39 | 40 | @electronic{AES_Registers, 41 | author = {3dbrew~Contributors}, 42 | title = {AES Registers}, 43 | url = {https://www.3dbrew.org/wiki/AES_Registers}, 44 | } 45 | 46 | @electronic{FIRM, 47 | author = {3dbrew~Contributors}, 48 | title = {FIRM}, 49 | url = {https://www.3dbrew.org/wiki/FIRM}, 50 | } 51 | 52 | @electronic{Bootloader, 53 | author = {3dbrew~Contributors}, 54 | title = {Bootloader}, 55 | url = {https://www.3dbrew.org/wiki/Bootloader}, 56 | } 57 | 58 | @electronic{SHA_Registers, 59 | author = {3dbrew~Contributors}, 60 | title = {SHA Registers}, 61 | url = {https://www.3dbrew.org/wiki/SHA_Registers}, 62 | } -------------------------------------------------------------------------------- /LaTeX/IEEEabrv.bib: -------------------------------------------------------------------------------- 1 | 2 | IEEEabrv.bib 3 | V1.14 (2015/08/26) 4 | Copyright (c) 2002-2015 by Michael Shell 5 | See: http://www.michaelshell.org/ 6 | for current contact information. 7 | 8 | BibTeX bibliography string definitions of the ABBREVIATED titles of 9 | IEEE journals and magazines and online publications. 10 | 11 | This file is designed for bibliography styles that require 12 | abbreviated titles and is not for use in bibliographies that 13 | require full-length titles. 14 | 15 | Support sites: 16 | http://www.michaelshell.org/tex/ieeetran/ 17 | http://www.ctan.org/pkg/ieeetran 18 | and/or 19 | http://www.ieee.org/ 20 | 21 | Special thanks to Laura Hyslop, Ken Rawson, Kevin Lisankie and 22 | Mona Mittra of the IEEE for their help in obtaining the information needed 23 | to compile this file. Also, Volker Kuhlmann, Moritz Borgmann, 24 | Yannick Berker, Nicol�s Barabino, Chuanren Wu and Santiago Cogollos Borras 25 | kindly provided some corrections and additions. 26 | 27 | 28 | ************************************************************************* 29 | Legal Notice: 30 | This code is offered as-is without any warranty either expressed or 31 | implied; without even the implied warranty of MERCHANTABILITY or 32 | FITNESS FOR A PARTICULAR PURPOSE! 33 | User assumes all risk. 34 | In no event shall the IEEE or any contributor to this code be liable for 35 | any damages or losses, including, but not limited to, incidental, 36 | consequential, or any other damages, resulting from the use or misuse 37 | of any information contained here. 38 | 39 | All comments are the opinions of their respective authors and are not 40 | necessarily endorsed by the IEEE. 41 | 42 | This work is distributed under the LaTeX Project Public License (LPPL) 43 | ( http://www.latex-project.org/ ) version 1.3, and may be freely used, 44 | distributed and modified. A copy of the LPPL, version 1.3, is included 45 | in the base LaTeX documentation of all distributions of LaTeX released 46 | 2003/12/01 or later. 47 | Retain all contribution notices and credits. 48 | ** Modified files should be clearly indicated as such, including ** 49 | ** renaming them and changing author support contact information. ** 50 | ************************************************************************* 51 | 52 | 53 | USAGE: 54 | 55 | \bibliographystyle{mybstfile} 56 | \bibliography{IEEEabrv,mybibfile} 57 | 58 | where the IEEE titles in the .bib database entries use the strings 59 | defined here. e.g., 60 | 61 | 62 | journal = IEEE_J_AC, 63 | 64 | 65 | to yield "{IEEE} Trans. Automat. Contr." 66 | 67 | 68 | The IEEE uses abbreviated journal titles in their bibliographies - 69 | this file is suitable for work that is to be submitted to the IEEE. 70 | 71 | For work that requires full-length titles, you should use the full 72 | titles provided in the companion file, IEEEfull.bib. 73 | 74 | 75 | ** NOTES ** 76 | 77 | 1. Journals have been grouped according to subject in order to make it 78 | easier to locate and extract the definitions for related journals - 79 | as most works use references that are confined to a single topic. 80 | Magazines are listed in straight alphabetical order. 81 | 82 | 2. String names are closely based on IEEE's own internal acronyms. 83 | 84 | 3. Older, out-of-print IEEE titles are included (but not including titles 85 | dating prior to the IEEE's formation from the IRE and AIEE in 1963). 86 | 87 | 4. Abbreviations comply with the official specifications of the IEEE. 88 | 89 | 90 | 91 | 92 | 93 | 94 | IEEE Journals 95 | 96 | 97 | aerospace and military 98 | @STRING{IEEE_J_ANNE = "{IEEE} Trans. Aeronaut. Navig. Electron."} 99 | @STRING{IEEE_J_AES = "{IEEE} Trans. Aerosp. Electron. Syst."} 100 | @STRING{IEEE_J_ANE = "{IEEE} Trans. Aerosp. Navig. Electron."} 101 | @STRING{IEEE_J_AS = "{IEEE} Trans. Aerosp."} 102 | @STRING{IEEE_J_AIRE = "{IEEE} Trans. Airborne Electron."} 103 | @STRING{IEEE_J_MIL = "{IEEE} Trans. Mil. Electron."} 104 | 105 | 106 | 107 | autos, transportation and vehicles (non-aerospace) 108 | @STRING{IEEE_J_ITS = "{IEEE} Trans. Intell. Transp. Syst."} 109 | @STRING{IEEE_J_IV = "{IEEE} Trans. Intell. Veh."} 110 | @STRING{IEEE_J_TTE = "{IEEE} Trans. Transport. Electrific."} 111 | @STRING{IEEE_J_VC = "{IEEE} Trans. Veh. Commun."} 112 | @STRING{IEEE_J_VT = "{IEEE} Trans. Veh. Technol."} 113 | 114 | 115 | 116 | circuits, signals, systems, audio and controls 117 | @STRING{IEEE_J_STSP = "{IEEE} J. Sel. Topics Signal Process."} 118 | @STRING{IEEE_J_SPL = "{IEEE} Signal Process. Lett."} 119 | @STRING{IEEE_J_SYST = "{IEEE} Syst. J."} 120 | @STRING{IEEE_J_ASSP = "{IEEE} Trans. Acoust., Speech, Signal Process."} 121 | @STRING{IEEE_J_AU = "{IEEE} Trans. Audio"} 122 | @STRING{IEEE_J_AUEA = "{IEEE} Trans. Audio Electroacoust."} 123 | in 2014 ASL became ASLP 124 | @STRING{IEEE_J_ASLP = "{IEEE/ACM} Trans. Audio, Speech, Language Process."} 125 | @STRING{IEEE_J_ASL = "{IEEE} Audio, Speech, Language Process."} 126 | @STRING{IEEE_J_AC = "{IEEE} Trans. Autom. Control"} 127 | @STRING{IEEE_J_CAS = "{IEEE} Trans. Circuits Syst."} 128 | @STRING{IEEE_J_CASVT = "{IEEE} Trans. Circuits Syst. Video Technol."} 129 | @STRING{IEEE_J_CASI = "{IEEE} Trans. Circuits Syst. {I}"} 130 | @STRING{IEEE_J_CASII = "{IEEE} Trans. Circuits Syst. {II}"} 131 | in 2004 CASI and CASII renamed part title to CASI_RP and CASII_EB, respectively 132 | @STRING{IEEE_J_CASI_RP = "{IEEE} Trans. Circuits Syst. {I}"} 133 | @STRING{IEEE_J_CASII_EB = "{IEEE} Trans. Circuits Syst. {II}"} 134 | @STRING{IEEE_J_CT = "{IEEE} Trans. Circuit Theory"} 135 | @STRING{IEEE_J_CST = "{IEEE} Trans. Control Syst. Technol."} 136 | @STRING{IEEE_J_ETCAS = "{IEEE} Trans. Emerg. Sel. Topics Circuits Syst."} 137 | @STRING{IEEE_J_SP = "{IEEE} Trans. Signal Process."} 138 | @STRING{IEEE_J_SU = "{IEEE} Trans. Sonics Ultrason."} 139 | @STRING{IEEE_J_SAP = "{IEEE} Trans. Speech Audio Process."} 140 | @STRING{IEEE_J_UE = "{IEEE} Trans. Ultrason. Eng."} 141 | @STRING{IEEE_J_UFFC = "{IEEE} Trans. Ultrason., Ferroelectr., Freq. Control"} 142 | 143 | 144 | 145 | communications 146 | @STRING{IEEE_J_COML = "{IEEE} Commun. Lett."} 147 | @STRING{IEEE_J_JSAC = "{IEEE} J. Sel. Areas Commun."} 148 | @STRING{IEEE_J_COM = "{IEEE} Trans. Commun."} 149 | @STRING{IEEE_J_COMT = "{IEEE} Trans. Commun. Technol."} 150 | @STRING{IEEE_J_WCOM = "{IEEE} Trans. Wireless Commun."} 151 | @STRING{IEEE_J_WCOML = "{IEEE} Wireless Commun. Lett."} 152 | 153 | 154 | 155 | components, packaging and manufacturing 156 | @STRING{IEEE_J_ADVP = "{IEEE} Trans. Adv. Packag."} 157 | @STRING{IEEE_J_CHMT = "{IEEE} Trans. Compon., Hybrids, Manuf. Technol."} 158 | in 2011 CAPT became CPMT 159 | @STRING{IEEE_J_CPMT = "{IEEE} Trans. Compon. Packag. Manuf. Technol."} 160 | @STRING{IEEE_J_CPMTA = "{IEEE} Trans. Compon., Packag., Manuf. Technol. {A}"} 161 | @STRING{IEEE_J_CPMTB = "{IEEE} Trans. Compon., Packag., Manuf. Technol. {B}"} 162 | @STRING{IEEE_J_CPMTC = "{IEEE} Trans. Compon., Packag., Manuf. Technol. {C}"} 163 | @STRING{IEEE_J_CAPTS = "{IEEE} Trans. Compon. Packag. Technol."} 164 | @STRING{IEEE_J_CAPT = "{IEEE} Trans. Compon. Packag. Technol."} 165 | @STRING{IEEE_J_CPART = "{IEEE} Trans. Compon. Parts"} 166 | @STRING{IEEE_J_EPM = "{IEEE} Trans. Electron. Packag. Manuf."} 167 | @STRING{IEEE_J_MFT = "{IEEE} Trans. Manuf. Technol."} 168 | @STRING{IEEE_J_PHP = "{IEEE} Trans. Parts, Hybrids, Packag."} 169 | @STRING{IEEE_J_PMP = "{IEEE} Trans. Parts, Mater., Packag."} 170 | 171 | 172 | 173 | CAD 174 | @STRING{IEEE_J_TCAD = "{IEEE} J. Technol. Comput. Aided Design"} 175 | @STRING{IEEE_J_CAD = "{IEEE} Trans. Comput.-Aided Design Integr. Circuits Syst."} 176 | 177 | 178 | 179 | coding, data, information, knowledge 180 | @STRING{IEEE_J_BD = "{IEEE} Trans. Big Data"} 181 | @STRING{IEEE_J_IFS = "{IEEE} Trans. Inf. Forensics Security"} 182 | @STRING{IEEE_J_IT = "{IEEE} Trans. Inf. Theory"} 183 | @STRING{IEEE_J_KDE = "{IEEE} Trans. Knowl. Data Eng."} 184 | 185 | 186 | 187 | computers, computation, networking and software 188 | @STRING{IEEE_J_CAL = "{IEEE} Comput. Archit. Lett."} 189 | @STRING{IEEE_J_ES = "{IEEE} Embedded Syst. Lett."} 190 | @STRING{IEEE_J_IOT = "{IEEE} Internet Things J."} 191 | @STRING{IEEE_J_XCDC = "{IEEE} J. Explor. Solid-State Computat. Devices Circuits"} 192 | @STRING{IEEE_J_MMCT = "{IEEE} J. Multiscale and Multiphys. Comput. Techn."} 193 | @STRING{IEEE_J_SUSC = "{IEEE} Sustain. Comput."} 194 | @STRING{IEEE_J_CC = "{IEEE} Trans. on Cloud Comput."} 195 | @STRING{IEEE_J_CSS = "{IEEE} Trans. Comput. Social Syst."} 196 | @STRING{IEEE_J_C = "{IEEE} Trans. Comput."} 197 | @STRING{IEEE_J_CNS = "{IEEE} Trans. Control Netw. Syst."} 198 | @STRING{IEEE_J_DSC = "{IEEE} Trans. Depend. Sec. Comput."} 199 | @STRING{IEEE_J_ECOMP = "{IEEE} Trans. Electron. Comput."} 200 | @STRING{IEEE_J_ETC = "{IEEE} Trans. Emerg. Topics Comput."} 201 | @STRING{IEEE_J_EVC = "{IEEE} Trans. Evol. Comput."} 202 | @STRING{IEEE_J_FUZZ = "{IEEE} Trans. Fuzzy Syst."} 203 | @STRING{IEEE_J_MC = "{IEEE} Trans. Mobile Comput."} 204 | @STRING{IEEE_J_MSCS = "{IEEE} Trans. Multi-Scale Comput. Syst."} 205 | @STRING{IEEE_J_NET = "{IEEE/ACM} Trans. Netw."} 206 | @STRING{IEEE_J_NSE = "{IEEE} Trans. Netw. Sci. Eng."} 207 | @STRING{IEEE_J_NSM = "{IEEE} Trans. Netw. Service Manag."} 208 | @STRING{IEEE_J_NN = "{IEEE} Trans. Neural Netw."} 209 | in 2012 NN became NNLS 210 | @STRING{IEEE_J_NNLS = "{IEEE} Trans. Neural Netw. Learn. Syst."} 211 | @STRING{IEEE_J_PDS = "{IEEE} Trans. Parallel Distrib. Syst."} 212 | @STRING{IEEE_J_SC = "{IEEE} Trans. Serv. Comput."} 213 | @STRING{IEEE_J_SIPN = "{IEEE} Trans. Signal Inf. Process. Netw."} 214 | @STRING{IEEE_J_SE = "{IEEE} Trans. Softw. Eng."} 215 | 216 | 217 | 218 | computer graphics, imaging, and multimedia 219 | @STRING{IEEE_J_JDT = "{IEEE/OSA} J. Display Technol."} 220 | @STRING{IEEE_J_IP = "{IEEE} Trans. Image Process."} 221 | @STRING{IEEE_J_MM = "{IEEE} Trans. Multimedia"} 222 | @STRING{IEEE_J_VCG = "{IEEE} Trans. Vis. Comput. Graphics"} 223 | 224 | 225 | 226 | cybernetics, ergonomics, robots, man-machine, artificial intelligence and automation 227 | @STRING{IEEE_J_JAS = "{IEEE/CAA} J. Autom. Sinica"} 228 | @STRING{IEEE_J_JRA = "{IEEE} J. Robot. Autom."} 229 | @STRING{IEEE_J_AFFC = "{IEEE} Trans. Affect. Comput."} 230 | @STRING{IEEE_J_ASE = "{IEEE} Trans. Autom. Sci. Eng."} 231 | @STRING{IEEE_J_AMD = "{IEEE} Trans. Auton. Mental Develop."} 232 | @STRING{IEEE_J_CCN = "{IEEE} Trans. on Cogn. Commun. Netw."} 233 | in 2015 AMD became CDS 234 | @STRING{IEEE_J_CDS = "{IEEE} Trans. Cogn. Develop. Syst."} 235 | @STRING{IEEE_J_CIAIG = "{IEEE} Trans. Comput. Intell. {AI} in Games"} 236 | in 2013 SMCB became CYB 237 | @STRING{IEEE_J_CYB = "{IEEE} Trans. Cybern."} 238 | @STRING{IEEE_J_H = "{IEEE} Trans. Haptics"} 239 | @STRING{IEEE_J_HFE = "{IEEE} Trans. Hum. Factors Electron."} 240 | in 2013 SMCC became HMS 241 | @STRING{IEEE_J_HMS = "{IEEE} Trans. Human-Mach. Syst."} 242 | @STRING{IEEE_J_MMS = "{IEEE} Trans. Man-Mach. Syst."} 243 | @STRING{IEEE_J_PAMI = "{IEEE} Trans. Pattern Anal. Mach. Intell."} 244 | in 1989 JRA became RA 245 | in August 2004, RA split into ASE and RO 246 | @STRING{IEEE_J_RA = "{IEEE} Trans. Robot. Autom."} 247 | @STRING{IEEE_J_RAL = "{IEEE} Robot. Autom. Lett."} 248 | @STRING{IEEE_J_RO = "{IEEE} Trans. Robot."} 249 | @STRING{IEEE_J_SMC = "{IEEE} Trans. Syst., Man, Cybern."} 250 | @STRING{IEEE_J_SMCA = "{IEEE} Trans. Syst., Man, Cybern. {A}"} 251 | @STRING{IEEE_J_SMCB = "{IEEE} Trans. Syst., Man, Cybern. {B}"} 252 | @STRING{IEEE_J_SMCC = "{IEEE} Trans. Syst., Man, Cybern. {C}"} 253 | in 2012 SMCA became SMCS 254 | @STRING{IEEE_J_SMCS = "{IEEE} Trans. Syst., Man, Cybern., Syst."} 255 | @STRING{IEEE_J_SSC = "{IEEE} Trans. Syst. Sci. Cybern."} 256 | 257 | 258 | 259 | earth, wind, fire and water 260 | @STRING{IEEE_J_GRSL = "{IEEE} Geosci. Remote Sens. Lett."} 261 | @STRING{IEEE_J_GE = "{IEEE} Trans. Geosci. Electron."} 262 | @STRING{IEEE_J_GRS = "{IEEE} Trans. Geosci. Remote Sens."} 263 | @STRING{IEEE_J_OE = "{IEEE} J. Ocean. Eng."} 264 | @STRING{IEEE_J_STARS = "{IEEE} J. Sel. Topics Appl. Earth Observ. Remote Sens."} 265 | 266 | 267 | 268 | education, engineering, history, IEEE, professional 269 | @STRING{IEEE_J_CJECE = "Canadian J. Elect. Comput. Eng."} 270 | @STRING{IEEE_J_PROC = "Proc. {IEEE}"} 271 | @STRING{IEEE_J_RITA = "{IEEE} Revista Iberoamericana de Technolog{\'{i}}as del Aprendizaje"} 272 | @STRING{IEEE_J_EDU = "{IEEE} Trans. Educ."} 273 | @STRING{IEEE_J_EM = "{IEEE} Trans. Eng. Manag."} 274 | @STRING{IEEE_J_EWS = "{IEEE} Trans. Eng. Writing Speech"} 275 | @STRING{IEEE_J_LT = "{IEEE} Trans. Learn. Technol."} 276 | @STRING{IEEE_J_PC = "{IEEE} Trans. Prof. Commun."} 277 | 278 | 279 | 280 | electromagnetics, antennas, EMI, magnetics and microwave 281 | @STRING{IEEE_J_AWPL = "{IEEE} Antennas Wireless Propag. Lett."} 282 | @STRING{IEEE_J_MAGL = "{IEEE} Magn. Lett."} 283 | @STRING{IEEE_J_MGWL = "{IEEE} Microw. Guided Wave Lett."} 284 | @STRING{IEEE_J_MWCL = "{IEEE} Microw. Wireless Compon. Lett."} 285 | @STRING{IEEE_J_RFIC = "{IEEE} {RFIC} J."} 286 | @STRING{IEEE_J_RFID = "{IEEE} {RFID} J."} 287 | @STRING{IEEE_J_AP = "{IEEE} Trans. Antennas Propag."} 288 | @STRING{IEEE_J_EMC = "{IEEE} Trans. Electromagn. Compat."} 289 | @STRING{IEEE_J_MAG = "{IEEE} Trans. Magn."} 290 | @STRING{IEEE_J_MTT = "{IEEE} Trans. Microw. Theory Techn."} 291 | @STRING{IEEE_J_RFI = "{IEEE} Trans. Radio Freq. Interference"} 292 | @STRING{IEEE_J_TTHZ = "{IEEE} Trans. {THz} Sci. Technol."} 293 | @STRING{IEEE_J_TJMJ = "{IEEE} Transl. J. Magn. Jpn."} 294 | 295 | 296 | 297 | energy, power and conversion 298 | @STRING{IEEE_J_PHOT = "{IEEE} J. Photovolt."} 299 | @STRING{IEEE_J_PEL = "{IEEE} Power Electron. Lett."} 300 | @STRING{IEEE_J_PETS = "{IEEE} Power Energy Technol. Syst. J."} 301 | @STRING{IEEE_J_ESTPE = "{IEEE} Trans. Emerg. Sel. Topics Power Electron."} 302 | @STRING{IEEE_J_EC = "{IEEE} Trans. Energy Convers."} 303 | @STRING{IEEE_J_PWRAS = "{IEEE} Trans. Power App. Syst."} 304 | @STRING{IEEE_J_PWRD = "{IEEE} Trans. Power Del."} 305 | @STRING{IEEE_J_PWRE = "{IEEE} Trans. Power Electron."} 306 | @STRING{IEEE_J_PWRS = "{IEEE} Trans. Power Syst."} 307 | @STRING{IEEE_J_SG = "{IEEE} Trans. Smart Grid"} 308 | @STRING{IEEE_J_STE = "{IEEE} Trans. Sustain. Energy"} 309 | 310 | 311 | 312 | industrial, commercial and consumer 313 | @STRING{IEEE_J_PSE = "{IEEE} J. Product Safety Eng."} 314 | @STRING{IEEE_J_APPIND = "{IEEE} Trans. Appl. Ind."} 315 | @STRING{IEEE_J_BC = "{IEEE} Trans. Broadcast."} 316 | @STRING{IEEE_J_BCTV = "{IEEE} Trans. Broadcast Television Receivers"} 317 | @STRING{IEEE_J_CE = "{IEEE} Trans. Consum. Electron."} 318 | @STRING{IEEE_J_IE = "{IEEE} Trans. Ind. Electron."} 319 | @STRING{IEEE_J_IECI = "{IEEE} Trans. Ind. Electron. Contr. Instrum."} 320 | @STRING{IEEE_J_IA = "{IEEE} Trans. Ind. Appl."} 321 | @STRING{IEEE_J_IGA = "{IEEE} Trans. Ind. Gen. Appl."} 322 | @STRING{IEEE_J_IINF = "{IEEE} Trans. Ind. Informat."} 323 | 324 | 325 | 326 | instrumentation and measurement 327 | @STRING{IEEE_J_IM = "{IEEE} Trans. Instrum. Meas."} 328 | 329 | 330 | 331 | insulation and materials 332 | @STRING{IEEE_J_JEM = "{IEEE/TMS} J. Electron. Mater."} 333 | @STRING{IEEE_J_DEI = "{IEEE} Trans. Dielectr. Electr. Insul."} 334 | @STRING{IEEE_J_EI = "{IEEE} Trans. Electr. Insul."} 335 | 336 | 337 | 338 | mechanical 339 | @STRING{IEEE_J_MEMS = "J. Microelectromech. Syst."} 340 | in 2014 MEMS became MEMSI 341 | @STRING{IEEE_J_MEMSI = "J. Microelectromech. Syst."} 342 | @STRING{IEEE_J_MECH = "{IEEE/ASME} Trans. Mechatronics"} 343 | 344 | 345 | 346 | medical and biological 347 | @STRING{IEEE_J_BHI = "{IEEE} J. Biomed. Health Inform."} 348 | @STRING{IEEE_J_TEHM = "{IEEE} J. Transl. Eng. Health Med."} 349 | @STRING{IEEE_J_LS = "{IEEE} Life Sci. Lett."} 350 | @STRING{IEEE_J_RBME = "{IEEE} Rev. Biomed. Eng."} 351 | @STRING{IEEE_J_BCAS = "{IEEE} Trans. Biomed. Circuits Syst."} 352 | @STRING{IEEE_J_BMELC = "{IEEE} Trans. Bio-Med. Electron."} 353 | B-ME later dropped the hyphen and became the BME 354 | @STRING{IEEE_J_BME = "{IEEE} Trans. Biomed. Eng."} 355 | @STRING{IEEE_J_B-ME = "{IEEE} Trans. Bio-Med. Eng."} 356 | @STRING{IEEE_J_CBB = "{IEEE/ACM} Trans. Comput. Biol. Bioinformatics"} 357 | @STRING{IEEE_J_ITBM = "{IEEE} Trans. Inf. Technol. Biomed."} 358 | @STRING{IEEE_J_ME = "{IEEE} Trans. Med. Electron."} 359 | @STRING{IEEE_J_MI = "{IEEE} Trans. Med. Imag."} 360 | @STRING{IEEE_J_MBSC = "{IEEE} Trans. Mol. Biol. Multi-Scale Commun."} 361 | @STRING{IEEE_J_NB = "{IEEE} Trans. Nanobiosci."} 362 | @STRING{IEEE_J_NSRE = "{IEEE} Trans. Neural Syst. Rehabil. Eng."} 363 | @STRING{IEEE_J_RE = "{IEEE} Trans. Rehabil. Eng."} 364 | 365 | 366 | 367 | optics, lightwave and photonics 368 | @STRING{IEEE_J_JLT = "J. Lightw. Technol."} 369 | @STRING{IEEE_J_OCN = "{IEEE} J. Opt. Commun. Netw."} 370 | @STRING{IEEE_J_PJ = "{IEEE} Photon. J."} 371 | @STRING{IEEE_J_PTL = "{IEEE} Photon. Technol. Lett."} 372 | 373 | 374 | 375 | physics, electrons, nanotechnology, nuclear and quantum electronics 376 | @STRING{IEEE_J_EDL = "{IEEE} Electron Device Lett."} 377 | @STRING{IEEE_J_EDS = "{IEEE} J. Electron Devices Soc."} 378 | @STRING{IEEE_J_JQE = "{IEEE} J. Quantum Electron."} 379 | @STRING{IEEE_J_JSTQE = "{IEEE} J. Sel. Topics Quantum Electron."} 380 | @STRING{IEEE_J_ENANO = "{IEEE} Nanotechnol. Express"} 381 | @STRING{IEEE_J_ED = "{IEEE} Trans. Electron Devices"} 382 | @STRING{IEEE_J_NANO = "{IEEE} Trans. Nanotechnol."} 383 | @STRING{IEEE_J_NS = "{IEEE} Trans. Nucl. Sci."} 384 | @STRING{IEEE_J_PS = "{IEEE} Trans. Plasma Sci."} 385 | 386 | 387 | 388 | reliability 389 | @STRING{IEEE_J_DMR = "{IEEE} Trans. Device Mater. Rel."} 390 | @STRING{IEEE_J_R = "{IEEE} Trans. Rel."} 391 | 392 | 393 | 394 | semiconductors, superconductors, electrochemical and solid state 395 | @STRING{IEEE_J_ESSL = "{IEEE/ECS} Electrochem. Solid-State Lett."} 396 | @STRING{IEEE_J_JSSC = "{IEEE} J. Solid-State Circuits"} 397 | @STRING{IEEE_J_ASC = "{IEEE} Trans. Appl. Supercond."} 398 | @STRING{IEEE_J_SM = "{IEEE} Trans. Semicond. Manuf."} 399 | 400 | 401 | 402 | sensors 403 | @STRING{IEEE_J_SENSOR = "{IEEE} Sensors J."} 404 | 405 | 406 | 407 | VLSI 408 | @STRING{IEEE_J_VLSI = "{IEEE} Trans. {VLSI} Syst."} 409 | 410 | 411 | 412 | 413 | 414 | 415 | IEEE Magazines and Online Publications 416 | 417 | 418 | @STRING{IEEE_O_ACC = "{IEEE} Access"} 419 | @STRING{IEEE_M_AES = "{IEEE} Aerosp. Electron. Syst. Mag."} 420 | @STRING{IEEE_M_HIST = "{IEEE} Ann. Hist. Comput."} 421 | @STRING{IEEE_M_AP = "{IEEE} Antennas Propag. Mag."} 422 | @STRING{IEEE_M_ASSP = "{IEEE} {ASSP} Mag."} 423 | @STRING{IEEE_M_CHINAC = "China Commun."} 424 | @STRING{IEEE_M_CD = "{IEEE} Circuits Devices Mag."} 425 | @STRING{IEEE_M_CAS = "{IEEE} Circuits Syst. Mag."} 426 | @STRING{IEEE_M_COM = "{IEEE} Commun. Mag."} 427 | @STRING{IEEE_M_COMSOC = "{IEEE} Commun. Soc. Mag."} 428 | @STRING{IEEE_O_CSTO = "{IEEE} Commun. Surveys Tuts."} 429 | @STRING{IEEE_M_CIM = "{IEEE} Comput. Intell. Mag."} 430 | CSEM changed to CSE in 1999 431 | @STRING{IEEE_M_CSE = "{IEEE} Comput. Sci. Eng."} 432 | @STRING{IEEE_M_CSEM = "{IEEE} Comput. Sci. Eng. Mag."} 433 | @STRING{IEEE_M_C = "Computer"} 434 | @STRING{IEEE_M_CAP = "{IEEE} Comput. Appl. Power"} 435 | @STRING{IEEE_M_CGA = "{IEEE} Comput. Graph. Appl."} 436 | @STRING{IEEE_M_CONC = "{IEEE} Concurrency"} 437 | @STRING{IEEE_M_CS = "{IEEE} Control Syst. Mag."} 438 | in 2012 DTC became DT 439 | @STRING{IEEE_M_DT = "{IEEE} Des. Test"} 440 | @STRING{IEEE_M_DTC = "{IEEE} Des. Test. Comput."} 441 | @STRING{IEEE_O_DSO = "{IEEE} Distrib. Syst. Online"} 442 | @STRING{IEEE_M_EI = "{IEEE} Electr. Insul. Mag."} 443 | @STRING{IEEE_M_ETF = "{IEEE} Electrific. Mag."} 444 | @STRING{IEEE_M_EMC = "{IEEE} Electromagn. Compat."} 445 | @STRING{IEEE_M_ETR = "{IEEE} ElectroTechnol. Rev."} 446 | @STRING{IEEE_M_EMR = "{IEEE} Eng. Manag. Rev."} 447 | @STRING{IEEE_M_EMB = "{IEEE} Eng. Med. Biol. Mag."} 448 | @STRING{IEEE_M_EXP = "{IEEE} Expert"} 449 | @STRING{IEEE_M_GRS = "{IEEE} Geosci. Remote Sens. Mag."} 450 | @STRING{IEEE_M_IA = "{IEEE} Ind. Appl. Mag."} 451 | @STRING{IEEE_M_IE = "{IEEE} Ind. Electron. Mag."} 452 | @STRING{IEEE_M_IM = "{IEEE} Instrum. Meas. Mag."} 453 | @STRING{IEEE_M_IS = "{IEEE} Intell. Syst."} 454 | @STRING{IEEE_M_ITS = "{IEEE} Intell. Transp. Syst. Mag."} 455 | @STRING{IEEE_M_IC = "{IEEE} Internet Comput."} 456 | @STRING{IEEE_M_ITP = "{IEEE} {IT} Prof."} 457 | @STRING{IEEE_M_MICRO = "{IEEE} Micro"} 458 | @STRING{IEEE_M_MW = "{IEEE} Microw. Mag."} 459 | @STRING{IEEE_M_MM = "{IEEE} Multimedia"} 460 | @STRING{IEEE_M_NANO = "{IEEE} Nanotechnol. Mag."} 461 | @STRING{IEEE_M_NET = "{IEEE} Netw."} 462 | IEEE's editorial manual lists "Pers. Commun.", 463 | but "Personal Commun. Mag." seems to be what is used in the journals 464 | @STRING{IEEE_M_PCOM = "{IEEE} Personal Commun. Mag."} 465 | @STRING{IEEE_M_PVC = "{IEEE} Pervasive Comput."} 466 | @STRING{IEEE_M_POT = "{IEEE} Potentials"} 467 | @STRING{IEEE_M_PEL = "{IEEE} Power Electron. Mag."} 468 | CAP and PER merged to form PE in 2003 469 | @STRING{IEEE_M_PE = "{IEEE} Power Energy Mag."} 470 | @STRING{IEEE_M_PER = "{IEEE} Power Eng. Rev."} 471 | @STRING{IEEE_M_PULSE = "{IEEE} Pulse"} 472 | @STRING{IEEE_M_RA = "{IEEE} Robot. Autom. Mag."} 473 | @STRING{IEEE_M_SAP = "{IEEE} Security Privacy"} 474 | @STRING{IEEE_M_SP = "{IEEE} Signal Process. Mag."} 475 | @STRING{IEEE_M_S = "{IEEE} Softw."} 476 | @STRING{IEEE_M_SSC = "{IEEE} Solid-State Circuits Mag."} 477 | @STRING{IEEE_M_SPECT = "{IEEE} Spectr."} 478 | @STRING{IEEE_M_SMC = "{IEEE} Syst., Man, Cybern. Mag."} 479 | @STRING{IEEE_M_TS = "{IEEE} Technol. Soc. Mag."} 480 | @STRING{IEEE_M_VT = "{IEEE} Veh. Technol. Mag."} 481 | @STRING{IEEE_M_WC = "{IEEE} Wireless Commun."} 482 | @STRING{IEEE_M_TODAY = "Today's Engineer"} 483 | 484 | 485 | 486 | 487 | 488 | -- 489 | EOF -------------------------------------------------------------------------------- /LaTeX/keyshuffling.tex: -------------------------------------------------------------------------------- 1 | %% 2 | %% latexmk -synctex=1 -interaction=nonstopmode -file-line-error -pdf keyshuffling.tex 3 | %% 4 | 5 | %% bare_jrnl.tex 6 | %% V1.4b 7 | %% 2015/08/26 8 | %% by Michael Shell 9 | %% see http://www.michaelshell.org/ 10 | %% for current contact information. 11 | %% 12 | %% This is a skeleton file demonstrating the use of IEEEtran.cls 13 | %% (requires IEEEtran.cls version 1.8b or later) with an IEEE 14 | %% journal paper. 15 | %% 16 | %% Support sites: 17 | %% http://www.michaelshell.org/tex/ieeetran/ 18 | %% http://www.ctan.org/pkg/ieeetran 19 | %% and 20 | %% http://www.ieee.org/ 21 | 22 | %%************************************************************************* 23 | %% Legal Notice: 24 | %% This code is offered as-is without any warranty either expressed or 25 | %% implied; without even the implied warranty of MERCHANTABILITY or 26 | %% FITNESS FOR A PARTICULAR PURPOSE! 27 | %% User assumes all risk. 28 | %% In no event shall the IEEE or any contributor to this code be liable for 29 | %% any damages or losses, including, but not limited to, incidental, 30 | %% consequential, or any other damages, resulting from the use or misuse 31 | %% of any information contained here. 32 | %% 33 | %% All comments are the opinions of their respective authors and are not 34 | %% necessarily endorsed by the IEEE. 35 | %% 36 | %% This work is distributed under the LaTeX Project Public License (LPPL) 37 | %% ( http://www.latex-project.org/ ) version 1.3, and may be freely used, 38 | %% distributed and modified. A copy of the LPPL, version 1.3, is included 39 | %% in the base LaTeX documentation of all distributions of LaTeX released 40 | %% 2003/12/01 or later. 41 | %% Retain all contribution notices and credits. 42 | %% ** Modified files should be clearly indicated as such, including ** 43 | %% ** renaming them and changing author support contact information. ** 44 | %%************************************************************************* 45 | 46 | 47 | % *** Authors should verify (and, if needed, correct) their LaTeX system *** 48 | % *** with the testflow diagnostic prior to trusting their LaTeX platform *** 49 | % *** with production work. The IEEE's font choices and paper sizes can *** 50 | % *** trigger bugs that do not appear when using other class files. *** *** 51 | % The testflow support page is at: 52 | % http://www.michaelshell.org/tex/testflow/ 53 | 54 | 55 | 56 | \documentclass[journal]{IEEEtran} 57 | % 58 | % If IEEEtran.cls has not been installed into the LaTeX system files, 59 | % manually specify the path to it like: 60 | % \documentclass[journal]{../sty/IEEEtran} 61 | 62 | 63 | 64 | 65 | 66 | % Some very useful LaTeX packages include: 67 | % (uncomment the ones you want to load) 68 | 69 | 70 | % *** MISC UTILITY PACKAGES *** 71 | % 72 | %\usepackage{ifpdf} 73 | % Heiko Oberdiek's ifpdf.sty is very useful if you need conditional 74 | % compilation based on whether the output is pdf or dvi. 75 | % usage: 76 | % \ifpdf 77 | % % pdf code 78 | % \else 79 | % % dvi code 80 | % \fi 81 | % The latest version of ifpdf.sty can be obtained from: 82 | % http://www.ctan.org/pkg/ifpdf 83 | % Also, note that IEEEtran.cls V1.7 and later provides a builtin 84 | % \ifCLASSINFOpdf conditional that works the same way. 85 | % When switching from latex to pdflatex and vice-versa, the compiler may 86 | % have to be run twice to clear warning/error messages. 87 | 88 | 89 | 90 | 91 | 92 | 93 | % *** CITATION PACKAGES *** 94 | % 95 | \usepackage{cite} 96 | % cite.sty was written by Donald Arseneau 97 | % V1.6 and later of IEEEtran pre-defines the format of the cite.sty package 98 | % \cite{} output to follow that of the IEEE. Loading the cite package will 99 | % result in citation numbers being automatically sorted and properly 100 | % "compressed/ranged". e.g., [1], [9], [2], [7], [5], [6] without using 101 | % cite.sty will become [1], [2], [5]--[7], [9] using cite.sty. cite.sty's 102 | % \cite will automatically add leading space, if needed. Use cite.sty's 103 | % noadjust option (cite.sty V3.8 and later) if you want to turn this off 104 | % such as if a citation ever needs to be enclosed in parenthesis. 105 | % cite.sty is already installed on most LaTeX systems. Be sure and use 106 | % version 5.0 (2009-03-20) and later if using hyperref.sty. 107 | % The latest version can be obtained at: 108 | % http://www.ctan.org/pkg/cite 109 | % The documentation is contained in the cite.sty file itself. 110 | 111 | 112 | 113 | 114 | 115 | 116 | % *** GRAPHICS RELATED PACKAGES *** 117 | % 118 | \ifCLASSINFOpdf 119 | \usepackage[pdftex]{graphicx} 120 | % declare the path(s) where your graphic files are 121 | \graphicspath{{./graphics/}} 122 | % and their extensions so you won't have to specify these with 123 | % every instance of \includegraphics 124 | \DeclareGraphicsExtensions{.pdf,.jpeg,.png} 125 | \else 126 | % or other class option (dvipsone, dvipdf, if not using dvips). graphicx 127 | % will default to the driver specified in the system graphics.cfg if no 128 | % driver is specified. 129 | % \usepackage[dvips]{graphicx} 130 | % declare the path(s) where your graphic files are 131 | % \graphicspath{{../eps/}} 132 | % and their extensions so you won't have to specify these with 133 | % every instance of \includegraphics 134 | % \DeclareGraphicsExtensions{.eps} 135 | \fi 136 | % graphicx was written by David Carlisle and Sebastian Rahtz. It is 137 | % required if you want graphics, photos, etc. graphicx.sty is already 138 | % installed on most LaTeX systems. The latest version and documentation 139 | % can be obtained at: 140 | % http://www.ctan.org/pkg/graphicx 141 | % Another good source of documentation is "Using Imported Graphics in 142 | % LaTeX2e" by Keith Reckdahl which can be found at: 143 | % http://www.ctan.org/pkg/epslatex 144 | % 145 | % latex, and pdflatex in dvi mode, support graphics in encapsulated 146 | % postscript (.eps) format. pdflatex in pdf mode supports graphics 147 | % in .pdf, .jpeg, .png and .mps (metapost) formats. Users should ensure 148 | % that all non-photo figures use a vector format (.eps, .pdf, .mps) and 149 | % not a bitmapped formats (.jpeg, .png). The IEEE frowns on bitmapped formats 150 | % which can result in "jaggedy"/blurry rendering of lines and letters as 151 | % well as large increases in file sizes. 152 | % 153 | % You can find documentation about the pdfTeX application at: 154 | % http://www.tug.org/applications/pdftex 155 | 156 | 157 | 158 | 159 | 160 | % *** MATH PACKAGES *** 161 | % 162 | %\usepackage{amsmath} 163 | % A popular package from the American Mathematical Society that provides 164 | % many useful and powerful commands for dealing with mathematics. 165 | % 166 | % Note that the amsmath package sets \interdisplaylinepenalty to 10000 167 | % thus preventing page breaks from occurring within multiline equations. Use: 168 | %\interdisplaylinepenalty=2500 169 | % after loading amsmath to restore such page breaks as IEEEtran.cls normally 170 | % does. amsmath.sty is already installed on most LaTeX systems. The latest 171 | % version and documentation can be obtained at: 172 | % http://www.ctan.org/pkg/amsmath 173 | 174 | 175 | 176 | 177 | 178 | % *** SPECIALIZED LIST PACKAGES *** 179 | % 180 | %\usepackage{algorithmic} 181 | % algorithmic.sty was written by Peter Williams and Rogerio Brito. 182 | % This package provides an algorithmic environment fo describing algorithms. 183 | % You can use the algorithmic environment in-text or within a figure 184 | % environment to provide for a floating algorithm. Do NOT use the algorithm 185 | % floating environment provided by algorithm.sty (by the same authors) or 186 | % algorithm2e.sty (by Christophe Fiorio) as the IEEE does not use dedicated 187 | % algorithm float types and packages that provide these will not provide 188 | % correct IEEE style captions. The latest version and documentation of 189 | % algorithmic.sty can be obtained at: 190 | % http://www.ctan.org/pkg/algorithms 191 | % Also of interest may be the (relatively newer and more customizable) 192 | % algorithmicx.sty package by Szasz Janos: 193 | % http://www.ctan.org/pkg/algorithmicx 194 | 195 | 196 | 197 | 198 | % *** ALIGNMENT PACKAGES *** 199 | % 200 | \usepackage{array} 201 | % Frank Mittelbach's and David Carlisle's array.sty patches and improves 202 | % the standard LaTeX2e array and tabular environments to provide better 203 | % appearance and additional user controls. As the default LaTeX2e table 204 | % generation code is lacking to the point of almost being broken with 205 | % respect to the quality of the end results, all users are strongly 206 | % advised to use an enhanced (at the very least that provided by array.sty) 207 | % set of table tools. array.sty is already installed on most systems. The 208 | % latest version and documentation can be obtained at: 209 | % http://www.ctan.org/pkg/array 210 | 211 | 212 | % IEEEtran contains the IEEEeqnarray family of commands that can be used to 213 | % generate multiline equations as well as matrices, tables, etc., of high 214 | % quality. 215 | 216 | 217 | 218 | 219 | % *** SUBFIGURE PACKAGES *** 220 | \ifCLASSOPTIONcompsoc 221 | \usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig} 222 | \else 223 | \usepackage[caption=false,font=footnotesize]{subfig} 224 | \fi 225 | % subfig.sty, written by Steven Douglas Cochran, is the modern replacement 226 | % for subfigure.sty, the latter of which is no longer maintained and is 227 | % incompatible with some LaTeX packages including fixltx2e. However, 228 | % subfig.sty requires and automatically loads Axel Sommerfeldt's caption.sty 229 | % which will override IEEEtran.cls' handling of captions and this will result 230 | % in non-IEEE style figure/table captions. To prevent this problem, be sure 231 | % and invoke subfig.sty's "caption=false" package option (available since 232 | % subfig.sty version 1.3, 2005/06/28) as this is will preserve IEEEtran.cls 233 | % handling of captions. 234 | % Note that the Computer Society format requires a larger sans serif font 235 | % than the serif footnote size font used in traditional IEEE formatting 236 | % and thus the need to invoke different subfig.sty package options depending 237 | % on whether compsoc mode has been enabled. 238 | % 239 | % The latest version and documentation of subfig.sty can be obtained at: 240 | % http://www.ctan.org/pkg/subfig 241 | 242 | 243 | 244 | 245 | % *** FLOAT PACKAGES *** 246 | % 247 | %\usepackage{fixltx2e} 248 | % fixltx2e, the successor to the earlier fix2col.sty, was written by 249 | % Frank Mittelbach and David Carlisle. This package corrects a few problems 250 | % in the LaTeX2e kernel, the most notable of which is that in current 251 | % LaTeX2e releases, the ordering of single and double column floats is not 252 | % guaranteed to be preserved. Thus, an unpatched LaTeX2e can allow a 253 | % single column figure to be placed prior to an earlier double column 254 | % figure. 255 | % Be aware that LaTeX2e kernels dated 2015 and later have fixltx2e.sty's 256 | % corrections already built into the system in which case a warning will 257 | % be issued if an attempt is made to load fixltx2e.sty as it is no longer 258 | % needed. 259 | % The latest version and documentation can be found at: 260 | % http://www.ctan.org/pkg/fixltx2e 261 | 262 | 263 | %\usepackage{stfloats} 264 | % stfloats.sty was written by Sigitas Tolusis. This package gives LaTeX2e 265 | % the ability to do double column floats at the bottom of the page as well 266 | % as the top. (e.g., "\begin{figure*}[!b]" is not normally possible in 267 | % LaTeX2e). It also provides a command: 268 | %\fnbelowfloat 269 | % to enable the placement of footnotes below bottom floats (the standard 270 | % LaTeX2e kernel puts them above bottom floats). This is an invasive package 271 | % which rewrites many portions of the LaTeX2e float routines. It may not work 272 | % with other packages that modify the LaTeX2e float routines. The latest 273 | % version and documentation can be obtained at: 274 | % http://www.ctan.org/pkg/stfloats 275 | % Do not use the stfloats baselinefloat ability as the IEEE does not allow 276 | % \baselineskip to stretch. Authors submitting work to the IEEE should note 277 | % that the IEEE rarely uses double column equations and that authors should try 278 | % to avoid such use. Do not be tempted to use the cuted.sty or midfloat.sty 279 | % packages (also by Sigitas Tolusis) as the IEEE does not format its papers in 280 | % such ways. 281 | % Do not attempt to use stfloats with fixltx2e as they are incompatible. 282 | % Instead, use Morten Hogholm'a dblfloatfix which combines the features 283 | % of both fixltx2e and stfloats: 284 | % 285 | % \usepackage{dblfloatfix} 286 | % The latest version can be found at: 287 | % http://www.ctan.org/pkg/dblfloatfix 288 | 289 | 290 | 291 | 292 | %\ifCLASSOPTIONcaptionsoff 293 | % \usepackage[nomarkers]{endfloat} 294 | % \let\MYoriglatexcaption\caption 295 | % \renewcommand{\caption}[2][\relax]{\MYoriglatexcaption[#2]{#2}} 296 | %\fi 297 | % endfloat.sty was written by James Darrell McCauley, Jeff Goldberg and 298 | % Axel Sommerfeldt. This package may be useful when used in conjunction with 299 | % IEEEtran.cls' captionsoff option. Some IEEE journals/societies require that 300 | % submissions have lists of figures/tables at the end of the paper and that 301 | % figures/tables without any captions are placed on a page by themselves at 302 | % the end of the document. If needed, the draftcls IEEEtran class option or 303 | % \CLASSINPUTbaselinestretch interface can be used to increase the line 304 | % spacing as well. Be sure and use the nomarkers option of endfloat to 305 | % prevent endfloat from "marking" where the figures would have been placed 306 | % in the text. The two hack lines of code above are a slight modification of 307 | % that suggested by in the endfloat docs (section 8.4.1) to ensure that 308 | % the full captions always appear in the list of figures/tables - even if 309 | % the user used the short optional argument of \caption[]{}. 310 | % IEEE papers do not typically make use of \caption[]'s optional argument, 311 | % so this should not be an issue. A similar trick can be used to disable 312 | % captions of packages such as subfig.sty that lack options to turn off 313 | % the subcaptions: 314 | % For subfig.sty: 315 | % \let\MYorigsubfloat\subfloat 316 | % \renewcommand{\subfloat}[2][\relax]{\MYorigsubfloat[]{#2}} 317 | % However, the above trick will not work if both optional arguments of 318 | % the \subfloat command are used. Furthermore, there needs to be a 319 | % description of each subfigure *somewhere* and endfloat does not add 320 | % subfigure captions to its list of figures. Thus, the best approach is to 321 | % avoid the use of subfigure captions (many IEEE journals avoid them anyway) 322 | % and instead reference/explain all the subfigures within the main caption. 323 | % The latest version of endfloat.sty and its documentation can obtained at: 324 | % http://www.ctan.org/pkg/endfloat 325 | % 326 | % The IEEEtran \ifCLASSOPTIONcaptionsoff conditional can also be used 327 | % later in the document, say, to conditionally put the References on a 328 | % page by themselves. 329 | 330 | 331 | 332 | 333 | % *** PDF, URL AND HYPERLINK PACKAGES *** 334 | % 335 | \usepackage{url} 336 | % url.sty was written by Donald Arseneau. It provides better support for 337 | % handling and breaking URLs. url.sty is already installed on most LaTeX 338 | % systems. The latest version and documentation can be obtained at: 339 | % http://www.ctan.org/pkg/url 340 | % Basically, \url{my_url_here}. 341 | 342 | 343 | 344 | 345 | % *** Do not adjust lengths that control margins, column widths, etc. *** 346 | % *** Do not use packages that alter fonts (such as pslatex). *** 347 | % There should be no need to do such things with IEEEtran.cls V1.6 and later. 348 | % (Unless specifically asked to do so by the journal or conference you plan 349 | % to submit to, of course. ) 350 | 351 | % correct bad hyphenation here 352 | \hyphenation{op-tical net-works semi-conduc-tor} 353 | 354 | 355 | \begin{document} 356 | % 357 | % paper title 358 | % Titles are generally capitalized except for words such as a, an, and, as, 359 | % at, but, by, for, in, nor, of, on, or, the, to and up, which are usually 360 | % not capitalized unless they are the first or last word of the title. 361 | % Linebreaks \\ can be used within to get better formatting as desired. 362 | % Do not put math or special symbols in the title. 363 | \title{Keyshuffling Attack for Persistent Early Code Execution in the Nintendo 364 | 3DS Secure Bootchain} 365 | % 366 | % 367 | % author names and IEEE memberships 368 | % note positions of commas and nonbreaking spaces ( ~ ) LaTeX will not break 369 | % a structure at a ~ so this keeps an author's name from being broken across 370 | % two lines. 371 | % use \thanks{} to gain access to the first footnote area 372 | % a separate \thanks must be used for each paragraph as LaTeX2e's \thanks 373 | % was not built to handle multiple paragraphs 374 | % 375 | 376 | \author{``stuckpixel''~{\relax(Discoverer)}, 377 | Devon~``Plailect''~Maloney~{\relax(Contributor)}, 378 | ``SciresM''~{\relax(Implementor)}, 379 | ``Gelex''~{\relax(Contributor)}, 380 | ``Normmatt''~{\relax(Contributor)}, 381 | and~``Aurora~Wright''~{\relax(Implementor)} 382 | \vspace{-2.0em}} 383 | 384 | % note the % following the last \IEEEmembership and also \thanks - 385 | % these prevent an unwanted space from occurring between the last author name 386 | % and the end of the author line. i.e., if you had this: 387 | % 388 | % \author{....lastname \thanks{...} \thanks{...} } 389 | % ^------------^------------^----Do not want these spaces! 390 | % 391 | % a space would be appended to the last name and could cause every name on that 392 | % line to be shifted left slightly. This is one of those "LaTeX things". For 393 | % instance, "\textbf{A} \textbf{B}" will typeset as "A B" not "AB". To get 394 | % "AB" then you have to do: "\textbf{A}\textbf{B}" 395 | % \thanks is no different in this regard, so shield the last } of each \thanks 396 | % that ends a line with a % and do not let a space in before the next \thanks. 397 | % Spaces after \IEEEmembership other than the last one are OK (and needed) as 398 | % you are supposed to have spaces between the names. For what it is worth, 399 | % this is a minor point as most people would not even notice if the said evil 400 | % space somehow managed to creep in. 401 | 402 | % make the title area 403 | \maketitle 404 | 405 | % As a general rule, do not put math, special symbols or citations 406 | % in the abstract or keywords. 407 | \begin{abstract} 408 | We demonstrate an attack on the secure bootchain of the Nintendo 3DS in order to 409 | gain early code execution. The attack utilizes the block shuffling vulnerability 410 | of the ECB cipher mode to rearrange keys in the Nintendo 3DS's encrypted 411 | keystore. Because the shuffled keys will deterministically decrypt the encrypted 412 | firmware binary to incorrect plaintext data and execute it, and because the 413 | device's memory contents are kept between hard reboots, it is possible to 414 | reliably reach a branching instruction to a payload in memory. This payload, due 415 | to its execution by a privileged processor and its early execution, is able to 416 | extract the hash of hardware secrets necessary to decrypt the device's encrypted 417 | keystore and set up a persistent exploit of the system. 418 | \end{abstract} 419 | 420 | \begin{IEEEkeywords} 421 | Advanced Encryption Standard, keyshuffling, bootchain, cryptography, block 422 | ciphers, software security. 423 | \end{IEEEkeywords} 424 | 425 | \section{Introduction} 426 | 427 | The Nintendo 3DS, like all entertainment consoles, is in a difficult position 428 | when it comes to designing a secure system. The device must easily accommodate 429 | legitimate users while at the same time preventing cheating, protecting 430 | intellectual property, and enforcing system integrity. To accomplish this, the 431 | 3DS has a chain of trust based on two separate processors: an ARM9 and an ARM11. 432 | The ARM9 processor is a security processor that runs a single process 433 | (``Process9'') whose sole responsibility is to handle secure functions such as 434 | cryptography, filesystem access, and permissions. The ARM11 processor is an 435 | application processor which is responsible for all OS and userspace-level 436 | tasks \cite{cryptosystem}. 437 | 438 | As with most embedded systems, the root of trust for the 3DS is the boot ROM 439 | burned into the System-on-Chip (``SoC'') at the factory. The code in this Read 440 | Only Memory cannot be changed and contains a public key to which only Nintendo 441 | has the matching private key. When the device is powered on, each CPU's boot ROM 442 | loads their respective firmware binary from NAND flash storage to memory, checks 443 | the firmware binary for a valid RSA signature that matches the burned in public 444 | key, then jumps to the firmware binary entrypoint \cite{cryptosystem}. This is a 445 | simple, robust chain of trust that seems fairly secure upon initial inspection. 446 | 447 | In 2014, Nintendo released the ``New 3DS'' which this paper will focus on. This 448 | updated 3DS features a faster CPU, more RAM, and (most importantly) an extra 449 | encryption layer on the ARM9 firmware binary known in the 3DS community as 450 | ``ARM9Loader''. This encryption layer loads new keys from NAND sector 0x96 (the 451 | plaintext of which is the same for all New 3DS devices), which are encrypted 452 | with AES-128-ECB by a key calculated from a SHA-256 hash of the the 453 | console-unique (different for every console) one-time programmable (``OTP'') 454 | memory region of the device. Keys on the 3DS are loaded into write-only 455 | ``keyslots'', which are secure memory areas readable only by the hardware AES 456 | implementation. This means that it should not be possible to recover these keys 457 | after they have been written to the AES module \cite{AES_Registers}. 458 | 459 | After ARM9Loader decrypts the NAND ``keysector'', access to the OTP memory region 460 | is disabled until next boot via the hardware register CFG\_SYSPROT9. Once the 461 | OTP region has been secured, ARM9Loader then decrypts the ARM9 firmware binary 462 | using a key from the decrypted keysector. Additionally, the hash of the OTP 463 | memory region is outputted to the SHA\_HASH hardware register after the hardware 464 | SHA implementation calculates it \cite{SHA_Registers}. Importantly, this 465 | register is not cleared until the ARM9 firmware binary clears it after 466 | ARM9Loader jumps to its entrypoint. 467 | 468 | \section{Secure Bootchain Implementations} 469 | 470 | \subsection{Implementation (v1.0)} 471 | 472 | The New 3DS shipped with version 8.1.0 of the system software, which contains 473 | the following implementation of ARM9Loader in the boot process \cite{FIRM}: 474 | 475 | \medskip 476 | \begin{enumerate} 477 | \item Calculate SHA-256 hash of the OTP memory region and output the hash to 478 | the SHA\_HASH register 479 | \item Calculate AES write-only keyslot 0x11 from the OTP hash 480 | \item Read the keysector from NAND to memory 481 | \item Decrypt the keysector using keyslot 0x11 482 | \item Clear AES write-only keyslot 0x11 to zero 483 | \item Disable access to the OTP memory region by setting CFG\_SYSPROT9 484 | \item Write Key \#1 from the keysector to AES write-only keyslot 0x11 485 | \item Instruct the AES module to calculate sub-keys 0x18 through 0x1F based on 486 | keyslot 0x11 487 | \item Verify keyslot 0x11 by encrypting a fixed test vector and checking the 488 | result 489 | \item Instruct the AES module to decrypt the ARM9 firmware binary 490 | \item Jump to the ARM9 firmware binary entrypoint 491 | \end{enumerate} 492 | \medskip 493 | 494 | The problem with this implementation of ARM9Loader is that keyslot 0x11 was not 495 | cleared after decrypting the ARM9 firmware binary (before jumping to the 496 | entrypoint), and thus it was possible to gain ARM9 code execution at a later 497 | point and instruct the AES module to regenerate all of the secret sub-keys 498 | without having access to the decrypted keysector. This was partially fixed with 499 | the update 9.5.0 by clearing keyslot 0x11 after ARM9Loader decrypts the ARM9 500 | firmware binary, but keyslot 0x11 was still set with keysector Key \#1 501 | \cite{3DS_System_Flaws}. 502 | 503 | \subsection{Implementation (v2.0)} 504 | 505 | The system software update 9.6.0 fixed the shortcomings of the first ARM9Loader 506 | implementation by using a different keysector key and clearing it properly this 507 | time. It contains the following implementation of ARM9Loader in the boot process 508 | \cite{FIRM}: 509 | 510 | \medskip 511 | \begin{enumerate} 512 | \item Calculate SHA-256 hash of the OTP memory region and output the hash to 513 | the SHA\_HASH register 514 | \item Calculate AES write-only keyslot 0x11 from the OTP hash 515 | \item Read the keysector from NAND to memory 516 | \item Decrypt the keysector using keyslot 0x11 517 | \item Clear AES write-only keyslot 0x11 to zero 518 | \item Disable access to the OTP memory region by setting CFG\_SYSPROT9 519 | \item Decrypt a key from within ARM9Loader's read-only data and set that key 520 | to keyslot 0x18 521 | \item Write Key \#1 from the keysector to AES write-only keyslot 0x11 522 | \item Instruct the AES module to calculate sub-keys 0x19 through 0x1F based on 523 | keyslot 0x11 524 | \item Verify keyslot 0x11 by encrypting a fixed test vector and checking the 525 | result 526 | \item Write Key \#2 from the keysector to AES write-only keyslot 0x11 527 | \item Instruct the AES module to decrypt the ARM9 firmware binary 528 | \item Clear AES write-only keyslot 0x11 to zero 529 | \item Jump to the ARM9 firmware binary entrypoint 530 | \end{enumerate} 531 | \medskip 532 | 533 | The problem with this implementation of ARM9Loader is that Key \#2 is never 534 | verified by encrypting a fixed test vector and checking the result, meaning that 535 | Key \#2 can be altered and the ARM9 firmware binary will be deterministically 536 | decrypted to incorrect plaintext data and executed. Unfortunately, because the 537 | keysector is encrypted with the console unique OTP hash (which we cannot access 538 | post-ARM9Loader), it is not possible to arbitrarily write any key to it and get 539 | a predictable decryption result \cite{3DS_System_Flaws}. 540 | 541 | \section{Keyshuffling} 542 | 543 | The keysector is encrypted with AES-128-ECB, where AES is the encryption 544 | standard, 128 is the number of bits in a block, and ECB is the cipher mode. The 545 | two parts of this specific encryption method that interest us are the block size 546 | and the cipher mode. The keys in the keysector are all 16 bytes (128 bits) long, 547 | and there is no message authentication code of any kind to increase the size or 548 | validate the key positions. This is a crucial fact because of the cipher mode 549 | used. In Electronic Codebook (ECB), each block in the message (the keysector in 550 | this case) is divided into blocks of the given size and encrypted separately. 551 | This means that each key in the keysector aligns with a block that is encrypted 552 | completely separately from all of the other aligned keys, allowing us to move 553 | the keys into any position we want while still decrypting properly. 554 | 555 | Another critical aspect of this attack is that each version of the ARM9 firmware 556 | binary is encrypted with a different counter in AES-128-CTR mode, meaning that 557 | even code that is the same between versions will decrypt to something completely 558 | different for each key that we try. A NAND sector on the device is 0x200 bytes 559 | and each key is 0x10 bytes. When we do not count the Key \#2 that properly 560 | decrypts the ARM9 firmware binary, which means we have 31 different keys for each 561 | ARM9 firmware binary version that will all decrypt the binary to a different 562 | incorrect plaintext which will then be executed. 563 | 564 | \begin{figure}[h] 565 | \includegraphics[width=\columnwidth]{./images/branchinstruction.jpg} 566 | \caption{Encoding of an ARM branch instruction \cite{32c3}} 567 | \end{figure} 568 | 569 | If we try enough keys and ARM9 firmware binary versions, there is a high 570 | probability that we will eventually find one that decrypts the ARM9 firmware 571 | binary deterministically such that the entrypoint is a branch instruction to 572 | another memory address where a payload can be placed. We found, by trying all 573 | possible keys and ARM9 firmware binary versions, that there is one combination 574 | that causes a jump to a usable memory location. By installing the 10.0.0 update 575 | of the ARM9 firmware binary and using the keyshuffling attack to replace 576 | keysector Key \#2 with a copy of keysector Key \#1, the resulting incorrect 577 | plaintext from the deterministic decryption will have a jump to memory address 578 | \texttt{0x80FD0F8} at the ARM9 firmware binary entrypoint. This redirects the 579 | code flow outside of the secure bootchain and into manipulatable memory. 580 | 581 | To exploit this vulnerable redirection of code flow, we took advantage of 582 | another major oversight in the device's design: when the device reboots, all 583 | memory keeps its contents. This makes it possible for us to gain ARM9 code 584 | execution at a point after the system boot completes, install the 10.0.0 update 585 | of the ARM9 firmware binary, use keyshuffling to replace keysector Key \#2 with 586 | keysector Key \#1, insert a series of NOP instructions (``NOP sled'') at memory 587 | address 0x80FD0F8 followed by a payload that dumps the SHA\_HASH register, then 588 | reboot. 589 | 590 | When the device comes back up, the ARM9 boot ROM will read ARM9Loader and the 591 | encrypted ARM9 firmware binary to memory, then jump to ARM9Loader which will 592 | perform the implementation v2.0 steps described previously. ARM9Loader will then 593 | (incorrectly) attempt to decrypt the ARM9 firmware with Key \#2 (which is now 594 | identical to Key \#1), disable access to the OTP memory region by setting 595 | CFG\_SYSPROT9, and jump to the ARM9 firmware binary entrypoint. When it does, it 596 | will immediately jump to memory address \texttt{0x80FD0F8}, execute the series 597 | of NOP instructions and ``slide'' to the payload. The payload then copies the hash 598 | of the OTP memory region from the uncleared SHA\_HASH output register for the 599 | purpose of decrypting the keysector at a later point. 600 | 601 | \section{Persistence} 602 | 603 | With the SHA-256 hash of the OTP memory region, we are now able to decrypt or 604 | re-encrypt the keysector. This means that we now completely control what key 605 | will be used for decrypting the ARM9 firmware binary, rather than being limited 606 | to one of the other 31 keys in the keysector. To understand how controlling the 607 | location of memory jumped to by ARM9Loader is useful in the context of 608 | persistence, we must look at how the boot ROM loads ARM9Loader and the firmware 609 | binary from NAND to memory. 610 | 611 | On the 3DS, ARM9Loader and the ARM9 Firmware binary, known collectively as 612 | ``FIRM'', are stored twice on NAND in two partitions known as ``FIRM0'' and ``FIRM1'' 613 | for redundancy purposes. This means that if one firmware partition becomes 614 | corrupted, the device will still boot. Note that the FIRM partitions, as with 615 | most partitions on the device, are encrypted using console unique keys derived 616 | from the OTP and set by the boot ROM. The boot ROM uses the following 617 | implementation to load FIRM0 and FIRM1 from NAND 618 | \cite{clevermind}\cite{Bootloader}\cite{OTP_Registers}: 619 | 620 | \medskip 621 | \begin{enumerate} 622 | \item Decrypt the OTP memory region and store the first 0x90 bytes in 623 | Instruction Tightly-Coupled Memory (``ITCM'') 624 | \item Calculate AES write-only keyslot 0x06 from decrypted OTP memory region 625 | in ITCM 626 | \item Read FIRM0 NAND partition to memory 627 | \item Decrypt FIRM0 partition in memory using keyslot 0x06 628 | \item Check the RSA signature of decrypted FIRM0 against burned in public key 629 | \begin{enumerate} 630 | \item If the RSA signature is valid, jump to FIRM0 ARM9Loader entrypoint 631 | \item If the RSA signature is invalid, continue 632 | \end{enumerate} 633 | \item Read FIRM1 NAND partition to memory on top of FIRM0 634 | \item Decrypt FIRM1 partition in memory using keyslot 0x06 635 | \item Check the RSA signature of decrypted FIRM1 against burned in public key 636 | \begin{enumerate} 637 | \item If the RSA signature is valid, jump to FIRM1 ARM9Loader entrypoint 638 | \item If the RSA signature is invalid, panic 639 | \end{enumerate} 640 | \end{enumerate} 641 | \medskip 642 | 643 | The problem with this implementation is that, in the case of a FIRM0 partition 644 | with an invalid signature, FIRM1 is loaded on top of it without FIRM0's memory 645 | being cleared \cite{32c3}. This allows for an attack in which we install the 646 | largest legitimately signed ARM9 firmware binary available to us (8.1.0) into 647 | FIRM0, then install the smallest legitimately signed ARM9 firmware binary 648 | available to us (10.2.0) into FIRM1. We could then place a payload of our 649 | choosing on top of FIRM0 at a point after FIRM1's size and find a key whose 650 | deterministic decryption of the 10.2.0 ARM9 firmware binary to a resulting 651 | incorrect plaintext will have a branch instruction to memory address after the 652 | end of the 10.2.0 ARM9 firmware binary but within the size of the 8.1.0 ARM9 653 | firmware binary \cite{32c3}. 654 | 655 | We ran a bruteforce of all possible Key \#2 values until we found the key whose 656 | deterministic decryption of the 8.1.0 FIRM0 ARM9 firmware binary to a resulting 657 | incorrect plaintext has a branch instruction to 0x190 bytes after the end of the 658 | 8.1.0 ARM9 firmware binary (\texttt{0x0824D3CB4AE94D624DAA526047C59394}). We use 659 | 0x190 bytes after the end of the 8.1.0 ARM9 firmware binary because empirical 660 | tests determined that placing the payload any sooner caused the payload to be 661 | overwritten by an unknown factor in the boot process (likely the stack or bss 662 | segment). After finding this key, we encrypt it with the OTP memory region hash 663 | obtained through the keyshuffling exploit and install the encrypted key into 664 | keysector Key \#2. We then add 0x190 to the size of the 8.1.0 ARM9 firmware 665 | binary and write a payload of our choosing to that position relative to the 666 | 10.2.0 ARM9 firmware binary \cite{32c3}. 667 | 668 | When the device is rebooted, the boot ROM loads FIRM0 into memory and decrypts 669 | it with AES write-only keyslot 0x06. It then checks the RSA signature of 670 | decrypted FIRM0, which fails because our payload at the end of the 8.1.0 ARM9 671 | firmware binary has modified the hash. The boot ROM then, without clearing the 672 | memory now containing our payload, loads FIRM1 into memory on top of FIRM0 and 673 | decrypts it with AES write-only keyslot 0x06 \cite{clevermind}. The boot ROM 674 | checks the RSA signature of FIRM1, which passes because the payload comes after 675 | the 10.2.0 ARM9 firmware binary. The boot ROM then jumps to the FIRM1 ARM9Loader 676 | in memory which uses our crafted Key \#2 to deterministically decrypt the 10.2.0 677 | ARM9 firmware binary to an incorrect plaintext and jumps to its entrypoint. When 678 | it does, it will immediately jump to the memory address of the payload of our 679 | choosing, giving us ARM9 code execution on every successive boot before the ARM9 680 | firmware binary runs \cite{32c3}\cite{clevermind}. 681 | 682 | \section{Conclusion} 683 | 684 | We have demonstrated a keyshuffling attack on the secure bootchain of the 685 | Nintendo 3DS in order to redirect code flow into insecure memory. This allowed 686 | us to gain code execution early enough to extract hardware secrets for the 687 | purpose of setting up persistent early code execution that survives reboots. 688 | This attack was made possible through a hardware revision that included the 689 | addition of a new encryption layer that not only failed to provide extra 690 | security, but additionally compromised a bootchain which had previously been 691 | considered secure. This shows the danger of including new security measures in 692 | an existing chain of trust without properly vetting them. 693 | 694 | %\section*{Acknowledgment} 695 | 696 | % references section 697 | 698 | % can use a bibliography generated by BibTeX as a .bbl file 699 | % BibTeX documentation can be easily obtained at: 700 | % http://mirror.ctan.org/biblio/bibtex/contrib/doc/ 701 | % The IEEEtran BibTeX style support page is at: 702 | % http://www.michaelshell.org/tex/ieeetran/bibtex/ 703 | \bibliographystyle{IEEEtran.bst} 704 | \bibliography{IEEEabrv,references} 705 | % 706 | % manually copy in the resultant .bbl file 707 | % set second argument of \begin to the number of references 708 | % (used to reserve space for the reference number labels box) 709 | %\begin{thebibliography}{1} 710 | 711 | % \bibitem{IEEEhowto:kopka} 712 | % H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus 713 | % 0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999. 714 | 715 | % \end{thebibliography} 716 | 717 | % that's all folks 718 | \end{document} 719 | 720 | 721 | -------------------------------------------------------------------------------- /LaTeX/IEEEtran.bst: -------------------------------------------------------------------------------- 1 | %% 2 | %% IEEEtran.bst 3 | %% BibTeX Bibliography Style file for IEEE Journals and Conferences (unsorted) 4 | %% Version 1.14 (2015/08/26) 5 | %% 6 | %% Copyright (c) 2003-2015 Michael Shell 7 | %% 8 | %% Original starting code base and algorithms obtained from the output of 9 | %% Patrick W. Daly's makebst package as well as from prior versions of 10 | %% IEEE BibTeX styles: 11 | %% 12 | %% 1. Howard Trickey and Oren Patashnik's ieeetr.bst (1985/1988) 13 | %% 2. Silvano Balemi and Richard H. Roy's IEEEbib.bst (1993) 14 | %% 15 | %% Support sites: 16 | %% http://www.michaelshell.org/tex/ieeetran/ 17 | %% http://www.ctan.org/pkg/ieeetran 18 | %% and/or 19 | %% http://www.ieee.org/ 20 | %% 21 | %% For use with BibTeX version 0.99a or later 22 | %% 23 | %% This is a numerical citation style. 24 | %% 25 | %%************************************************************************* 26 | %% Legal Notice: 27 | %% This code is offered as-is without any warranty either expressed or 28 | %% implied; without even the implied warranty of MERCHANTABILITY or 29 | %% FITNESS FOR A PARTICULAR PURPOSE! 30 | %% User assumes all risk. 31 | %% In no event shall the IEEE or any contributor to this code be liable for 32 | %% any damages or losses, including, but not limited to, incidental, 33 | %% consequential, or any other damages, resulting from the use or misuse 34 | %% of any information contained here. 35 | %% 36 | %% All comments are the opinions of their respective authors and are not 37 | %% necessarily endorsed by the IEEE. 38 | %% 39 | %% This work is distributed under the LaTeX Project Public License (LPPL) 40 | %% ( http://www.latex-project.org/ ) version 1.3, and may be freely used, 41 | %% distributed and modified. A copy of the LPPL, version 1.3, is included 42 | %% in the base LaTeX documentation of all distributions of LaTeX released 43 | %% 2003/12/01 or later. 44 | %% Retain all contribution notices and credits. 45 | %% ** Modified files should be clearly indicated as such, including ** 46 | %% ** renaming them and changing author support contact information. ** 47 | %%************************************************************************* 48 | 49 | 50 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 51 | %% DEFAULTS FOR THE CONTROLS OF THE BST STYLE %% 52 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 53 | 54 | % These are the defaults for the user adjustable controls. The values used 55 | % here can be overridden by the user via IEEEtranBSTCTL entry type. 56 | 57 | % NOTE: The recommended LaTeX command to invoke a control entry type is: 58 | % 59 | %\makeatletter 60 | %\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}} 61 | %\def\@bstctlcite[#1]#2{\@bsphack 62 | % \@for\@citeb:=#2\do{% 63 | % \edef\@citeb{\expandafter\@firstofone\@citeb}% 64 | % \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}% 65 | % \@esphack} 66 | %\makeatother 67 | % 68 | % It is called at the start of the document, before the first \cite, like: 69 | % \bstctlcite{IEEEexample:BSTcontrol} 70 | % 71 | % IEEEtran.cls V1.6 and later does provide this command. 72 | 73 | 74 | 75 | % #0 turns off the display of the number for articles. 76 | % #1 enables 77 | FUNCTION {default.is.use.number.for.article} { #1 } 78 | 79 | 80 | % #0 turns off the display of the paper and type fields in @inproceedings. 81 | % #1 enables 82 | FUNCTION {default.is.use.paper} { #1 } 83 | 84 | 85 | % #0 turns off the display of urls 86 | % #1 enables 87 | FUNCTION {default.is.use.url} { #1 } 88 | 89 | 90 | % #0 turns off the forced use of "et al." 91 | % #1 enables 92 | FUNCTION {default.is.forced.et.al} { #0 } 93 | 94 | 95 | % The maximum number of names that can be present beyond which an "et al." 96 | % usage is forced. Be sure that num.names.shown.with.forced.et.al (below) 97 | % is not greater than this value! 98 | % Note: There are many instances of references in IEEE journals which have 99 | % a very large number of authors as well as instances in which "et al." is 100 | % used profusely. 101 | FUNCTION {default.max.num.names.before.forced.et.al} { #10 } 102 | 103 | 104 | % The number of names that will be shown with a forced "et al.". 105 | % Must be less than or equal to max.num.names.before.forced.et.al 106 | FUNCTION {default.num.names.shown.with.forced.et.al} { #1 } 107 | 108 | 109 | % #0 turns off the alternate interword spacing for entries with URLs. 110 | % #1 enables 111 | FUNCTION {default.is.use.alt.interword.spacing} { #1 } 112 | 113 | 114 | % If alternate interword spacing for entries with URLs is enabled, this is 115 | % the interword spacing stretch factor that will be used. For example, the 116 | % default "4" here means that the interword spacing in entries with URLs can 117 | % stretch to four times normal. Does not have to be an integer. Note that 118 | % the value specified here can be overridden by the user in their LaTeX 119 | % code via a command such as: 120 | % "\providecommand\BIBentryALTinterwordstretchfactor{1.5}" in addition to 121 | % that via the IEEEtranBSTCTL entry type. 122 | FUNCTION {default.ALTinterwordstretchfactor} { "4" } 123 | 124 | 125 | % #0 turns off the "dashification" of repeated (i.e., identical to those 126 | % of the previous entry) names. The IEEE normally does this. 127 | % #1 enables 128 | FUNCTION {default.is.dash.repeated.names} { #1 } 129 | 130 | 131 | % The default name format control string. 132 | FUNCTION {default.name.format.string}{ "{f.~}{vv~}{ll}{, jj}" } 133 | 134 | 135 | % The default LaTeX font command for the names. 136 | FUNCTION {default.name.latex.cmd}{ "" } 137 | 138 | 139 | % The default URL prefix. 140 | FUNCTION {default.name.url.prefix}{ "[Online]. Available:" } 141 | 142 | 143 | % Other controls that cannot be accessed via IEEEtranBSTCTL entry type. 144 | 145 | % #0 turns off the terminal startup banner/completed message so as to 146 | % operate more quietly. 147 | % #1 enables 148 | FUNCTION {is.print.banners.to.terminal} { #1 } 149 | 150 | 151 | 152 | 153 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 154 | %% FILE VERSION AND BANNER %% 155 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 156 | 157 | FUNCTION{bst.file.version} { "1.14" } 158 | FUNCTION{bst.file.date} { "2015/08/26" } 159 | FUNCTION{bst.file.website} { "http://www.michaelshell.org/tex/ieeetran/bibtex/" } 160 | 161 | FUNCTION {banner.message} 162 | { is.print.banners.to.terminal 163 | { "-- IEEEtran.bst version" " " * bst.file.version * 164 | " (" * bst.file.date * ") " * "by Michael Shell." * 165 | top$ 166 | "-- " bst.file.website * 167 | top$ 168 | "-- See the " quote$ * "IEEEtran_bst_HOWTO.pdf" * quote$ * " manual for usage information." * 169 | top$ 170 | } 171 | { skip$ } 172 | if$ 173 | } 174 | 175 | FUNCTION {completed.message} 176 | { is.print.banners.to.terminal 177 | { "" 178 | top$ 179 | "Done." 180 | top$ 181 | } 182 | { skip$ } 183 | if$ 184 | } 185 | 186 | 187 | 188 | 189 | %%%%%%%%%%%%%%%%%%%%%% 190 | %% STRING CONSTANTS %% 191 | %%%%%%%%%%%%%%%%%%%%%% 192 | 193 | FUNCTION {bbl.and}{ "and" } 194 | FUNCTION {bbl.etal}{ "et~al." } 195 | FUNCTION {bbl.editors}{ "eds." } 196 | FUNCTION {bbl.editor}{ "ed." } 197 | FUNCTION {bbl.edition}{ "ed." } 198 | FUNCTION {bbl.volume}{ "vol." } 199 | FUNCTION {bbl.of}{ "of" } 200 | FUNCTION {bbl.number}{ "no." } 201 | FUNCTION {bbl.in}{ "in" } 202 | FUNCTION {bbl.pages}{ "pp." } 203 | FUNCTION {bbl.page}{ "p." } 204 | FUNCTION {bbl.chapter}{ "ch." } 205 | FUNCTION {bbl.paper}{ "paper" } 206 | FUNCTION {bbl.part}{ "pt." } 207 | FUNCTION {bbl.patent}{ "Patent" } 208 | FUNCTION {bbl.patentUS}{ "U.S." } 209 | FUNCTION {bbl.revision}{ "Rev." } 210 | FUNCTION {bbl.series}{ "ser." } 211 | FUNCTION {bbl.standard}{ "Std." } 212 | FUNCTION {bbl.techrep}{ "Tech. Rep." } 213 | FUNCTION {bbl.mthesis}{ "Master's thesis" } 214 | FUNCTION {bbl.phdthesis}{ "Ph.D. dissertation" } 215 | FUNCTION {bbl.st}{ "st" } 216 | FUNCTION {bbl.nd}{ "nd" } 217 | FUNCTION {bbl.rd}{ "rd" } 218 | FUNCTION {bbl.th}{ "th" } 219 | 220 | 221 | % This is the LaTeX spacer that is used when a larger than normal space 222 | % is called for (such as just before the address:publisher). 223 | FUNCTION {large.space} { "\hskip 1em plus 0.5em minus 0.4em\relax " } 224 | 225 | % The LaTeX code for dashes that are used to represent repeated names. 226 | % Note: Some older IEEE journals used something like 227 | % "\rule{0.275in}{0.5pt}\," which is fairly thick and runs right along 228 | % the baseline. However, the IEEE now uses a thinner, above baseline, 229 | % six dash long sequence. 230 | FUNCTION {repeated.name.dashes} { "------" } 231 | 232 | 233 | 234 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 235 | %% PREDEFINED STRING MACROS %% 236 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 237 | 238 | MACRO {jan} {"Jan."} 239 | MACRO {feb} {"Feb."} 240 | MACRO {mar} {"Mar."} 241 | MACRO {apr} {"Apr."} 242 | MACRO {may} {"May"} 243 | MACRO {jun} {"Jun."} 244 | MACRO {jul} {"Jul."} 245 | MACRO {aug} {"Aug."} 246 | MACRO {sep} {"Sep."} 247 | MACRO {oct} {"Oct."} 248 | MACRO {nov} {"Nov."} 249 | MACRO {dec} {"Dec."} 250 | 251 | 252 | 253 | %%%%%%%%%%%%%%%%%% 254 | %% ENTRY FIELDS %% 255 | %%%%%%%%%%%%%%%%%% 256 | 257 | ENTRY 258 | { address 259 | assignee 260 | author 261 | booktitle 262 | chapter 263 | day 264 | dayfiled 265 | edition 266 | editor 267 | howpublished 268 | institution 269 | intype 270 | journal 271 | key 272 | language 273 | month 274 | monthfiled 275 | nationality 276 | note 277 | number 278 | organization 279 | pages 280 | paper 281 | publisher 282 | school 283 | series 284 | revision 285 | title 286 | type 287 | url 288 | volume 289 | year 290 | yearfiled 291 | CTLuse_article_number 292 | CTLuse_paper 293 | CTLuse_url 294 | CTLuse_forced_etal 295 | CTLmax_names_forced_etal 296 | CTLnames_show_etal 297 | CTLuse_alt_spacing 298 | CTLalt_stretch_factor 299 | CTLdash_repeated_names 300 | CTLname_format_string 301 | CTLname_latex_cmd 302 | CTLname_url_prefix 303 | } 304 | {} 305 | { label } 306 | 307 | 308 | 309 | 310 | %%%%%%%%%%%%%%%%%%%%%%% 311 | %% INTEGER VARIABLES %% 312 | %%%%%%%%%%%%%%%%%%%%%%% 313 | 314 | INTEGERS { prev.status.punct this.status.punct punct.std 315 | punct.no punct.comma punct.period 316 | prev.status.space this.status.space space.std 317 | space.no space.normal space.large 318 | prev.status.quote this.status.quote quote.std 319 | quote.no quote.close 320 | prev.status.nline this.status.nline nline.std 321 | nline.no nline.newblock 322 | status.cap cap.std 323 | cap.no cap.yes} 324 | 325 | INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames } 326 | 327 | INTEGERS { is.use.number.for.article 328 | is.use.paper 329 | is.use.url 330 | is.forced.et.al 331 | max.num.names.before.forced.et.al 332 | num.names.shown.with.forced.et.al 333 | is.use.alt.interword.spacing 334 | is.dash.repeated.names} 335 | 336 | 337 | %%%%%%%%%%%%%%%%%%%%%% 338 | %% STRING VARIABLES %% 339 | %%%%%%%%%%%%%%%%%%%%%% 340 | 341 | STRINGS { bibinfo 342 | longest.label 343 | oldname 344 | s 345 | t 346 | ALTinterwordstretchfactor 347 | name.format.string 348 | name.latex.cmd 349 | name.url.prefix} 350 | 351 | 352 | 353 | 354 | %%%%%%%%%%%%%%%%%%%%%%%%% 355 | %% LOW LEVEL FUNCTIONS %% 356 | %%%%%%%%%%%%%%%%%%%%%%%%% 357 | 358 | FUNCTION {initialize.controls} 359 | { default.is.use.number.for.article 'is.use.number.for.article := 360 | default.is.use.paper 'is.use.paper := 361 | default.is.use.url 'is.use.url := 362 | default.is.forced.et.al 'is.forced.et.al := 363 | default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al := 364 | default.num.names.shown.with.forced.et.al 'num.names.shown.with.forced.et.al := 365 | default.is.use.alt.interword.spacing 'is.use.alt.interword.spacing := 366 | default.is.dash.repeated.names 'is.dash.repeated.names := 367 | default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor := 368 | default.name.format.string 'name.format.string := 369 | default.name.latex.cmd 'name.latex.cmd := 370 | default.name.url.prefix 'name.url.prefix := 371 | } 372 | 373 | 374 | % This IEEEtran.bst features a very powerful and flexible mechanism for 375 | % controlling the capitalization, punctuation, spacing, quotation, and 376 | % newlines of the formatted entry fields. (Note: IEEEtran.bst does not need 377 | % or use the newline/newblock feature, but it has been implemented for 378 | % possible future use.) The output states of IEEEtran.bst consist of 379 | % multiple independent attributes and, as such, can be thought of as being 380 | % vectors, rather than the simple scalar values ("before.all", 381 | % "mid.sentence", etc.) used in most other .bst files. 382 | % 383 | % The more flexible and complex design used here was motivated in part by 384 | % the IEEE's rather unusual bibliography style. For example, the IEEE ends the 385 | % previous field item with a period and large space prior to the publisher 386 | % address; the @electronic entry types use periods as inter-item punctuation 387 | % rather than the commas used by the other entry types; and URLs are never 388 | % followed by periods even though they are the last item in the entry. 389 | % Although it is possible to accommodate these features with the conventional 390 | % output state system, the seemingly endless exceptions make for convoluted, 391 | % unreliable and difficult to maintain code. 392 | % 393 | % IEEEtran.bst's output state system can be easily understood via a simple 394 | % illustration of two most recently formatted entry fields (on the stack): 395 | % 396 | % CURRENT_ITEM 397 | % "PREVIOUS_ITEM 398 | % 399 | % which, in this example, is to eventually appear in the bibliography as: 400 | % 401 | % "PREVIOUS_ITEM," CURRENT_ITEM 402 | % 403 | % It is the job of the output routine to take the previous item off of the 404 | % stack (while leaving the current item at the top of the stack), apply its 405 | % trailing punctuation (including closing quote marks) and spacing, and then 406 | % to write the result to BibTeX's output buffer: 407 | % 408 | % "PREVIOUS_ITEM," 409 | % 410 | % Punctuation (and spacing) between items is often determined by both of the 411 | % items rather than just the first one. The presence of quotation marks 412 | % further complicates the situation because, in standard English, trailing 413 | % punctuation marks are supposed to be contained within the quotes. 414 | % 415 | % IEEEtran.bst maintains two output state (aka "status") vectors which 416 | % correspond to the previous and current (aka "this") items. Each vector 417 | % consists of several independent attributes which track punctuation, 418 | % spacing, quotation, and newlines. Capitalization status is handled by a 419 | % separate scalar because the format routines, not the output routine, 420 | % handle capitalization and, therefore, there is no need to maintain the 421 | % capitalization attribute for both the "previous" and "this" items. 422 | % 423 | % When a format routine adds a new item, it copies the current output status 424 | % vector to the previous output status vector and (usually) resets the 425 | % current (this) output status vector to a "standard status" vector. Using a 426 | % "standard status" vector in this way allows us to redefine what we mean by 427 | % "standard status" at the start of each entry handler and reuse the same 428 | % format routines under the various inter-item separation schemes. For 429 | % example, the standard status vector for the @book entry type may use 430 | % commas for item separators, while the @electronic type may use periods, 431 | % yet both entry handlers exploit many of the exact same format routines. 432 | % 433 | % Because format routines have write access to the output status vector of 434 | % the previous item, they can override the punctuation choices of the 435 | % previous format routine! Therefore, it becomes trivial to implement rules 436 | % such as "Always use a period and a large space before the publisher." By 437 | % pushing the generation of the closing quote mark to the output routine, we 438 | % avoid all the problems caused by having to close a quote before having all 439 | % the information required to determine what the punctuation should be. 440 | % 441 | % The IEEEtran.bst output state system can easily be expanded if needed. 442 | % For instance, it is easy to add a "space.tie" attribute value if the 443 | % bibliography rules mandate that two items have to be joined with an 444 | % unbreakable space. 445 | 446 | FUNCTION {initialize.status.constants} 447 | { #0 'punct.no := 448 | #1 'punct.comma := 449 | #2 'punct.period := 450 | #0 'space.no := 451 | #1 'space.normal := 452 | #2 'space.large := 453 | #0 'quote.no := 454 | #1 'quote.close := 455 | #0 'cap.no := 456 | #1 'cap.yes := 457 | #0 'nline.no := 458 | #1 'nline.newblock := 459 | } 460 | 461 | FUNCTION {std.status.using.comma} 462 | { punct.comma 'punct.std := 463 | space.normal 'space.std := 464 | quote.no 'quote.std := 465 | nline.no 'nline.std := 466 | cap.no 'cap.std := 467 | } 468 | 469 | FUNCTION {std.status.using.period} 470 | { punct.period 'punct.std := 471 | space.normal 'space.std := 472 | quote.no 'quote.std := 473 | nline.no 'nline.std := 474 | cap.yes 'cap.std := 475 | } 476 | 477 | FUNCTION {initialize.prev.this.status} 478 | { punct.no 'prev.status.punct := 479 | space.no 'prev.status.space := 480 | quote.no 'prev.status.quote := 481 | nline.no 'prev.status.nline := 482 | punct.no 'this.status.punct := 483 | space.no 'this.status.space := 484 | quote.no 'this.status.quote := 485 | nline.no 'this.status.nline := 486 | cap.yes 'status.cap := 487 | } 488 | 489 | FUNCTION {this.status.std} 490 | { punct.std 'this.status.punct := 491 | space.std 'this.status.space := 492 | quote.std 'this.status.quote := 493 | nline.std 'this.status.nline := 494 | } 495 | 496 | FUNCTION {cap.status.std}{ cap.std 'status.cap := } 497 | 498 | FUNCTION {this.to.prev.status} 499 | { this.status.punct 'prev.status.punct := 500 | this.status.space 'prev.status.space := 501 | this.status.quote 'prev.status.quote := 502 | this.status.nline 'prev.status.nline := 503 | } 504 | 505 | 506 | FUNCTION {not} 507 | { { #0 } 508 | { #1 } 509 | if$ 510 | } 511 | 512 | FUNCTION {and} 513 | { { skip$ } 514 | { pop$ #0 } 515 | if$ 516 | } 517 | 518 | FUNCTION {or} 519 | { { pop$ #1 } 520 | { skip$ } 521 | if$ 522 | } 523 | 524 | 525 | % convert the strings "yes" or "no" to #1 or #0 respectively 526 | FUNCTION {yes.no.to.int} 527 | { "l" change.case$ duplicate$ 528 | "yes" = 529 | { pop$ #1 } 530 | { duplicate$ "no" = 531 | { pop$ #0 } 532 | { "unknown boolean " quote$ * swap$ * quote$ * 533 | " in " * cite$ * warning$ 534 | #0 535 | } 536 | if$ 537 | } 538 | if$ 539 | } 540 | 541 | 542 | % pushes true if the single char string on the stack is in the 543 | % range of "0" to "9" 544 | FUNCTION {is.num} 545 | { chr.to.int$ 546 | duplicate$ "0" chr.to.int$ < not 547 | swap$ "9" chr.to.int$ > not and 548 | } 549 | 550 | % multiplies the integer on the stack by a factor of 10 551 | FUNCTION {bump.int.mag} 552 | { #0 'multiresult := 553 | { duplicate$ #0 > } 554 | { #1 - 555 | multiresult #10 + 556 | 'multiresult := 557 | } 558 | while$ 559 | pop$ 560 | multiresult 561 | } 562 | 563 | % converts a single character string on the stack to an integer 564 | FUNCTION {char.to.integer} 565 | { duplicate$ 566 | is.num 567 | { chr.to.int$ "0" chr.to.int$ - } 568 | {"noninteger character " quote$ * swap$ * quote$ * 569 | " in integer field of " * cite$ * warning$ 570 | #0 571 | } 572 | if$ 573 | } 574 | 575 | % converts a string on the stack to an integer 576 | FUNCTION {string.to.integer} 577 | { duplicate$ text.length$ 'namesleft := 578 | #1 'nameptr := 579 | #0 'numnames := 580 | { nameptr namesleft > not } 581 | { duplicate$ nameptr #1 substring$ 582 | char.to.integer numnames bump.int.mag + 583 | 'numnames := 584 | nameptr #1 + 585 | 'nameptr := 586 | } 587 | while$ 588 | pop$ 589 | numnames 590 | } 591 | 592 | 593 | 594 | 595 | % The output routines write out the *next* to the top (previous) item on the 596 | % stack, adding punctuation and such as needed. Since IEEEtran.bst maintains 597 | % the output status for the top two items on the stack, these output 598 | % routines have to consider the previous output status (which corresponds to 599 | % the item that is being output). Full independent control of punctuation, 600 | % closing quote marks, spacing, and newblock is provided. 601 | % 602 | % "output.nonnull" does not check for the presence of a previous empty 603 | % item. 604 | % 605 | % "output" does check for the presence of a previous empty item and will 606 | % remove an empty item rather than outputing it. 607 | % 608 | % "output.warn" is like "output", but will issue a warning if it detects 609 | % an empty item. 610 | 611 | FUNCTION {output.nonnull} 612 | { swap$ 613 | prev.status.punct punct.comma = 614 | { "," * } 615 | { skip$ } 616 | if$ 617 | prev.status.punct punct.period = 618 | { add.period$ } 619 | { skip$ } 620 | if$ 621 | prev.status.quote quote.close = 622 | { "''" * } 623 | { skip$ } 624 | if$ 625 | prev.status.space space.normal = 626 | { " " * } 627 | { skip$ } 628 | if$ 629 | prev.status.space space.large = 630 | { large.space * } 631 | { skip$ } 632 | if$ 633 | write$ 634 | prev.status.nline nline.newblock = 635 | { newline$ "\newblock " write$ } 636 | { skip$ } 637 | if$ 638 | } 639 | 640 | FUNCTION {output} 641 | { duplicate$ empty$ 642 | 'pop$ 643 | 'output.nonnull 644 | if$ 645 | } 646 | 647 | FUNCTION {output.warn} 648 | { 't := 649 | duplicate$ empty$ 650 | { pop$ "empty " t * " in " * cite$ * warning$ } 651 | 'output.nonnull 652 | if$ 653 | } 654 | 655 | % "fin.entry" is the output routine that handles the last item of the entry 656 | % (which will be on the top of the stack when "fin.entry" is called). 657 | 658 | FUNCTION {fin.entry} 659 | { this.status.punct punct.no = 660 | { skip$ } 661 | { add.period$ } 662 | if$ 663 | this.status.quote quote.close = 664 | { "''" * } 665 | { skip$ } 666 | if$ 667 | write$ 668 | newline$ 669 | } 670 | 671 | 672 | FUNCTION {is.last.char.not.punct} 673 | { duplicate$ 674 | "}" * add.period$ 675 | #-1 #1 substring$ "." = 676 | } 677 | 678 | FUNCTION {is.multiple.pages} 679 | { 't := 680 | #0 'multiresult := 681 | { multiresult not 682 | t empty$ not 683 | and 684 | } 685 | { t #1 #1 substring$ 686 | duplicate$ "-" = 687 | swap$ duplicate$ "," = 688 | swap$ "+" = 689 | or or 690 | { #1 'multiresult := } 691 | { t #2 global.max$ substring$ 't := } 692 | if$ 693 | } 694 | while$ 695 | multiresult 696 | } 697 | 698 | FUNCTION {capitalize}{ "u" change.case$ "t" change.case$ } 699 | 700 | FUNCTION {emphasize} 701 | { duplicate$ empty$ 702 | { pop$ "" } 703 | { "\emph{" swap$ * "}" * } 704 | if$ 705 | } 706 | 707 | FUNCTION {do.name.latex.cmd} 708 | { name.latex.cmd 709 | empty$ 710 | { skip$ } 711 | { name.latex.cmd "{" * swap$ * "}" * } 712 | if$ 713 | } 714 | 715 | % IEEEtran.bst uses its own \BIBforeignlanguage command which directly 716 | % invokes the TeX hyphenation patterns without the need of the Babel 717 | % package. Babel does a lot more than switch hyphenation patterns and 718 | % its loading can cause unintended effects in many class files (such as 719 | % IEEEtran.cls). 720 | FUNCTION {select.language} 721 | { duplicate$ empty$ 'pop$ 722 | { language empty$ 'skip$ 723 | { "\BIBforeignlanguage{" language * "}{" * swap$ * "}" * } 724 | if$ 725 | } 726 | if$ 727 | } 728 | 729 | FUNCTION {tie.or.space.prefix} 730 | { duplicate$ text.length$ #3 < 731 | { "~" } 732 | { " " } 733 | if$ 734 | swap$ 735 | } 736 | 737 | FUNCTION {get.bbl.editor} 738 | { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } 739 | 740 | FUNCTION {space.word}{ " " swap$ * " " * } 741 | 742 | 743 | % Field Conditioners, Converters, Checkers and External Interfaces 744 | 745 | FUNCTION {empty.field.to.null.string} 746 | { duplicate$ empty$ 747 | { pop$ "" } 748 | { skip$ } 749 | if$ 750 | } 751 | 752 | FUNCTION {either.or.check} 753 | { empty$ 754 | { pop$ } 755 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } 756 | if$ 757 | } 758 | 759 | FUNCTION {empty.entry.warn} 760 | { author empty$ title empty$ howpublished empty$ 761 | month empty$ year empty$ note empty$ url empty$ 762 | and and and and and and 763 | { "all relevant fields are empty in " cite$ * warning$ } 764 | 'skip$ 765 | if$ 766 | } 767 | 768 | 769 | % The bibinfo system provides a way for the electronic parsing/acquisition 770 | % of a bibliography's contents as is done by ReVTeX. For example, a field 771 | % could be entered into the bibliography as: 772 | % \bibinfo{volume}{2} 773 | % Only the "2" would show up in the document, but the LaTeX \bibinfo command 774 | % could do additional things with the information. IEEEtran.bst does provide 775 | % a \bibinfo command via "\providecommand{\bibinfo}[2]{#2}". However, it is 776 | % currently not used as the bogus bibinfo functions defined here output the 777 | % entry values directly without the \bibinfo wrapper. The bibinfo functions 778 | % themselves (and the calls to them) are retained for possible future use. 779 | % 780 | % bibinfo.check avoids acting on missing fields while bibinfo.warn will 781 | % issue a warning message if a missing field is detected. Prior to calling 782 | % the bibinfo functions, the user should push the field value and then its 783 | % name string, in that order. 784 | 785 | FUNCTION {bibinfo.check} 786 | { swap$ duplicate$ missing$ 787 | { pop$ pop$ "" } 788 | { duplicate$ empty$ 789 | { swap$ pop$ } 790 | { swap$ pop$ } 791 | if$ 792 | } 793 | if$ 794 | } 795 | 796 | FUNCTION {bibinfo.warn} 797 | { swap$ duplicate$ missing$ 798 | { swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ "" } 799 | { duplicate$ empty$ 800 | { swap$ "empty " swap$ * " in " * cite$ * warning$ } 801 | { swap$ pop$ } 802 | if$ 803 | } 804 | if$ 805 | } 806 | 807 | 808 | % The IEEE separates large numbers with more than 4 digits into groups of 809 | % three. The IEEE uses a small space to separate these number groups. 810 | % Typical applications include patent and page numbers. 811 | 812 | % number of consecutive digits required to trigger the group separation. 813 | FUNCTION {large.number.trigger}{ #5 } 814 | 815 | % For numbers longer than the trigger, this is the blocksize of the groups. 816 | % The blocksize must be less than the trigger threshold, and 2 * blocksize 817 | % must be greater than the trigger threshold (can't do more than one 818 | % separation on the initial trigger). 819 | FUNCTION {large.number.blocksize}{ #3 } 820 | 821 | % What is actually inserted between the number groups. 822 | FUNCTION {large.number.separator}{ "\," } 823 | 824 | % So as to save on integer variables by reusing existing ones, numnames 825 | % holds the current number of consecutive digits read and nameptr holds 826 | % the number that will trigger an inserted space. 827 | FUNCTION {large.number.separate} 828 | { 't := 829 | "" 830 | #0 'numnames := 831 | large.number.trigger 'nameptr := 832 | { t empty$ not } 833 | { t #-1 #1 substring$ is.num 834 | { numnames #1 + 'numnames := } 835 | { #0 'numnames := 836 | large.number.trigger 'nameptr := 837 | } 838 | if$ 839 | t #-1 #1 substring$ swap$ * 840 | t #-2 global.max$ substring$ 't := 841 | numnames nameptr = 842 | { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$ 843 | nameptr large.number.blocksize - #1 + global.max$ substring$ 844 | large.number.separator swap$ * * 845 | nameptr large.number.blocksize - 'numnames := 846 | large.number.blocksize #1 + 'nameptr := 847 | } 848 | { skip$ } 849 | if$ 850 | } 851 | while$ 852 | } 853 | 854 | % Converts all single dashes "-" to double dashes "--". 855 | FUNCTION {n.dashify} 856 | { large.number.separate 857 | 't := 858 | "" 859 | { t empty$ not } 860 | { t #1 #1 substring$ "-" = 861 | { t #1 #2 substring$ "--" = not 862 | { "--" * 863 | t #2 global.max$ substring$ 't := 864 | } 865 | { { t #1 #1 substring$ "-" = } 866 | { "-" * 867 | t #2 global.max$ substring$ 't := 868 | } 869 | while$ 870 | } 871 | if$ 872 | } 873 | { t #1 #1 substring$ * 874 | t #2 global.max$ substring$ 't := 875 | } 876 | if$ 877 | } 878 | while$ 879 | } 880 | 881 | 882 | % This function detects entries with names that are identical to that of 883 | % the previous entry and replaces the repeated names with dashes (if the 884 | % "is.dash.repeated.names" user control is nonzero). 885 | FUNCTION {name.or.dash} 886 | { 's := 887 | oldname empty$ 888 | { s 'oldname := s } 889 | { s oldname = 890 | { is.dash.repeated.names 891 | { repeated.name.dashes } 892 | { s 'oldname := s } 893 | if$ 894 | } 895 | { s 'oldname := s } 896 | if$ 897 | } 898 | if$ 899 | } 900 | 901 | % Converts the number string on the top of the stack to 902 | % "numerical ordinal form" (e.g., "7" to "7th"). There is 903 | % no artificial limit to the upper bound of the numbers as the 904 | % two least significant digits determine the ordinal form. 905 | FUNCTION {num.to.ordinal} 906 | { duplicate$ #-2 #1 substring$ "1" = 907 | { bbl.th * } 908 | { duplicate$ #-1 #1 substring$ "1" = 909 | { bbl.st * } 910 | { duplicate$ #-1 #1 substring$ "2" = 911 | { bbl.nd * } 912 | { duplicate$ #-1 #1 substring$ "3" = 913 | { bbl.rd * } 914 | { bbl.th * } 915 | if$ 916 | } 917 | if$ 918 | } 919 | if$ 920 | } 921 | if$ 922 | } 923 | 924 | % If the string on the top of the stack begins with a number, 925 | % (e.g., 11th) then replace the string with the leading number 926 | % it contains. Otherwise retain the string as-is. s holds the 927 | % extracted number, t holds the part of the string that remains 928 | % to be scanned. 929 | FUNCTION {extract.num} 930 | { duplicate$ 't := 931 | "" 's := 932 | { t empty$ not } 933 | { t #1 #1 substring$ 934 | t #2 global.max$ substring$ 't := 935 | duplicate$ is.num 936 | { s swap$ * 's := } 937 | { pop$ "" 't := } 938 | if$ 939 | } 940 | while$ 941 | s empty$ 942 | 'skip$ 943 | { pop$ s } 944 | if$ 945 | } 946 | 947 | % Converts the word number string on the top of the stack to 948 | % Arabic string form. Will be successful up to "tenth". 949 | FUNCTION {word.to.num} 950 | { duplicate$ "l" change.case$ 's := 951 | s "first" = 952 | { pop$ "1" } 953 | { skip$ } 954 | if$ 955 | s "second" = 956 | { pop$ "2" } 957 | { skip$ } 958 | if$ 959 | s "third" = 960 | { pop$ "3" } 961 | { skip$ } 962 | if$ 963 | s "fourth" = 964 | { pop$ "4" } 965 | { skip$ } 966 | if$ 967 | s "fifth" = 968 | { pop$ "5" } 969 | { skip$ } 970 | if$ 971 | s "sixth" = 972 | { pop$ "6" } 973 | { skip$ } 974 | if$ 975 | s "seventh" = 976 | { pop$ "7" } 977 | { skip$ } 978 | if$ 979 | s "eighth" = 980 | { pop$ "8" } 981 | { skip$ } 982 | if$ 983 | s "ninth" = 984 | { pop$ "9" } 985 | { skip$ } 986 | if$ 987 | s "tenth" = 988 | { pop$ "10" } 989 | { skip$ } 990 | if$ 991 | } 992 | 993 | 994 | % Converts the string on the top of the stack to numerical 995 | % ordinal (e.g., "11th") form. 996 | FUNCTION {convert.edition} 997 | { duplicate$ empty$ 'skip$ 998 | { duplicate$ #1 #1 substring$ is.num 999 | { extract.num 1000 | num.to.ordinal 1001 | } 1002 | { word.to.num 1003 | duplicate$ #1 #1 substring$ is.num 1004 | { num.to.ordinal } 1005 | { "edition ordinal word " quote$ * edition * quote$ * 1006 | " may be too high (or improper) for conversion" * " in " * cite$ * warning$ 1007 | } 1008 | if$ 1009 | } 1010 | if$ 1011 | } 1012 | if$ 1013 | } 1014 | 1015 | 1016 | 1017 | 1018 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1019 | %% LATEX BIBLIOGRAPHY CODE %% 1020 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1021 | 1022 | FUNCTION {start.entry} 1023 | { newline$ 1024 | "\bibitem{" write$ 1025 | cite$ write$ 1026 | "}" write$ 1027 | newline$ 1028 | "" 1029 | initialize.prev.this.status 1030 | } 1031 | 1032 | % Here we write out all the LaTeX code that we will need. The most involved 1033 | % code sequences are those that control the alternate interword spacing and 1034 | % foreign language hyphenation patterns. The heavy use of \providecommand 1035 | % gives users a way to override the defaults. Special thanks to Javier Bezos, 1036 | % Johannes Braams, Robin Fairbairns, Heiko Oberdiek, Donald Arseneau and all 1037 | % the other gurus on comp.text.tex for their help and advice on the topic of 1038 | % \selectlanguage, Babel and BibTeX. 1039 | FUNCTION {begin.bib} 1040 | { "% Generated by IEEEtran.bst, version: " bst.file.version * " (" * bst.file.date * ")" * 1041 | write$ newline$ 1042 | preamble$ empty$ 'skip$ 1043 | { preamble$ write$ newline$ } 1044 | if$ 1045 | "\begin{thebibliography}{" longest.label * "}" * 1046 | write$ newline$ 1047 | "\providecommand{\url}[1]{#1}" 1048 | write$ newline$ 1049 | "\csname url@samestyle\endcsname" 1050 | write$ newline$ 1051 | "\providecommand{\newblock}{\relax}" 1052 | write$ newline$ 1053 | "\providecommand{\bibinfo}[2]{#2}" 1054 | write$ newline$ 1055 | "\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}" 1056 | write$ newline$ 1057 | "\providecommand{\BIBentryALTinterwordstretchfactor}{" 1058 | ALTinterwordstretchfactor * "}" * 1059 | write$ newline$ 1060 | "\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus " 1061 | write$ newline$ 1062 | "\BIBentryALTinterwordstretchfactor\fontdimen3\font minus \fontdimen4\font\relax}" 1063 | write$ newline$ 1064 | "\providecommand{\BIBforeignlanguage}[2]{{%" 1065 | write$ newline$ 1066 | "\expandafter\ifx\csname l@#1\endcsname\relax" 1067 | write$ newline$ 1068 | "\typeout{** WARNING: IEEEtran.bst: No hyphenation pattern has been}%" 1069 | write$ newline$ 1070 | "\typeout{** loaded for the language `#1'. Using the pattern for}%" 1071 | write$ newline$ 1072 | "\typeout{** the default language instead.}%" 1073 | write$ newline$ 1074 | "\else" 1075 | write$ newline$ 1076 | "\language=\csname l@#1\endcsname" 1077 | write$ newline$ 1078 | "\fi" 1079 | write$ newline$ 1080 | "#2}}" 1081 | write$ newline$ 1082 | "\providecommand{\BIBdecl}{\relax}" 1083 | write$ newline$ 1084 | "\BIBdecl" 1085 | write$ newline$ 1086 | } 1087 | 1088 | FUNCTION {end.bib} 1089 | { newline$ "\end{thebibliography}" write$ newline$ } 1090 | 1091 | FUNCTION {if.url.alt.interword.spacing} 1092 | { is.use.alt.interword.spacing 1093 | { is.use.url 1094 | { url empty$ 'skip$ {"\BIBentryALTinterwordspacing" write$ newline$} if$ } 1095 | { skip$ } 1096 | if$ 1097 | } 1098 | { skip$ } 1099 | if$ 1100 | } 1101 | 1102 | FUNCTION {if.url.std.interword.spacing} 1103 | { is.use.alt.interword.spacing 1104 | { is.use.url 1105 | { url empty$ 'skip$ {"\BIBentrySTDinterwordspacing" write$ newline$} if$ } 1106 | { skip$ } 1107 | if$ 1108 | } 1109 | { skip$ } 1110 | if$ 1111 | } 1112 | 1113 | 1114 | 1115 | 1116 | %%%%%%%%%%%%%%%%%%%%%%%% 1117 | %% LONGEST LABEL PASS %% 1118 | %%%%%%%%%%%%%%%%%%%%%%%% 1119 | 1120 | FUNCTION {initialize.longest.label} 1121 | { "" 'longest.label := 1122 | #1 'number.label := 1123 | #0 'longest.label.width := 1124 | } 1125 | 1126 | FUNCTION {longest.label.pass} 1127 | { type$ "ieeetranbstctl" = 1128 | { skip$ } 1129 | { number.label int.to.str$ 'label := 1130 | number.label #1 + 'number.label := 1131 | label width$ longest.label.width > 1132 | { label 'longest.label := 1133 | label width$ 'longest.label.width := 1134 | } 1135 | { skip$ } 1136 | if$ 1137 | } 1138 | if$ 1139 | } 1140 | 1141 | 1142 | 1143 | 1144 | %%%%%%%%%%%%%%%%%%%%% 1145 | %% FORMAT HANDLERS %% 1146 | %%%%%%%%%%%%%%%%%%%%% 1147 | 1148 | %% Lower Level Formats (used by higher level formats) 1149 | 1150 | FUNCTION {format.address.org.or.pub.date} 1151 | { 't := 1152 | "" 1153 | year empty$ 1154 | { "empty year in " cite$ * warning$ } 1155 | { skip$ } 1156 | if$ 1157 | address empty$ t empty$ and 1158 | year empty$ and month empty$ and 1159 | { skip$ } 1160 | { this.to.prev.status 1161 | this.status.std 1162 | cap.status.std 1163 | address "address" bibinfo.check * 1164 | t empty$ 1165 | { skip$ } 1166 | { punct.period 'prev.status.punct := 1167 | space.large 'prev.status.space := 1168 | address empty$ 1169 | { skip$ } 1170 | { ": " * } 1171 | if$ 1172 | t * 1173 | } 1174 | if$ 1175 | year empty$ month empty$ and 1176 | { skip$ } 1177 | { t empty$ address empty$ and 1178 | { skip$ } 1179 | { ", " * } 1180 | if$ 1181 | month empty$ 1182 | { year empty$ 1183 | { skip$ } 1184 | { year "year" bibinfo.check * } 1185 | if$ 1186 | } 1187 | { month "month" bibinfo.check * 1188 | year empty$ 1189 | { skip$ } 1190 | { " " * year "year" bibinfo.check * } 1191 | if$ 1192 | } 1193 | if$ 1194 | } 1195 | if$ 1196 | } 1197 | if$ 1198 | } 1199 | 1200 | 1201 | FUNCTION {format.names} 1202 | { 'bibinfo := 1203 | duplicate$ empty$ 'skip$ { 1204 | this.to.prev.status 1205 | this.status.std 1206 | 's := 1207 | "" 't := 1208 | #1 'nameptr := 1209 | s num.names$ 'numnames := 1210 | numnames 'namesleft := 1211 | { namesleft #0 > } 1212 | { s nameptr 1213 | name.format.string 1214 | format.name$ 1215 | bibinfo bibinfo.check 1216 | 't := 1217 | nameptr #1 > 1218 | { nameptr num.names.shown.with.forced.et.al #1 + = 1219 | numnames max.num.names.before.forced.et.al > 1220 | is.forced.et.al and and 1221 | { "others" 't := 1222 | #1 'namesleft := 1223 | } 1224 | { skip$ } 1225 | if$ 1226 | namesleft #1 > 1227 | { ", " * t do.name.latex.cmd * } 1228 | { s nameptr "{ll}" format.name$ duplicate$ "others" = 1229 | { 't := } 1230 | { pop$ } 1231 | if$ 1232 | t "others" = 1233 | { " " * bbl.etal emphasize * } 1234 | { numnames #2 > 1235 | { "," * } 1236 | { skip$ } 1237 | if$ 1238 | bbl.and 1239 | space.word * t do.name.latex.cmd * 1240 | } 1241 | if$ 1242 | } 1243 | if$ 1244 | } 1245 | { t do.name.latex.cmd } 1246 | if$ 1247 | nameptr #1 + 'nameptr := 1248 | namesleft #1 - 'namesleft := 1249 | } 1250 | while$ 1251 | cap.status.std 1252 | } if$ 1253 | } 1254 | 1255 | 1256 | 1257 | 1258 | %% Higher Level Formats 1259 | 1260 | %% addresses/locations 1261 | 1262 | FUNCTION {format.address} 1263 | { address duplicate$ empty$ 'skip$ 1264 | { this.to.prev.status 1265 | this.status.std 1266 | cap.status.std 1267 | } 1268 | if$ 1269 | } 1270 | 1271 | 1272 | 1273 | %% author/editor names 1274 | 1275 | FUNCTION {format.authors}{ author "author" format.names } 1276 | 1277 | FUNCTION {format.editors} 1278 | { editor "editor" format.names duplicate$ empty$ 'skip$ 1279 | { ", " * 1280 | get.bbl.editor 1281 | capitalize 1282 | * 1283 | } 1284 | if$ 1285 | } 1286 | 1287 | 1288 | 1289 | %% date 1290 | 1291 | FUNCTION {format.date} 1292 | { 1293 | month "month" bibinfo.check duplicate$ empty$ 1294 | year "year" bibinfo.check duplicate$ empty$ 1295 | { swap$ 'skip$ 1296 | { this.to.prev.status 1297 | this.status.std 1298 | cap.status.std 1299 | "there's a month but no year in " cite$ * warning$ } 1300 | if$ 1301 | * 1302 | } 1303 | { this.to.prev.status 1304 | this.status.std 1305 | cap.status.std 1306 | swap$ 'skip$ 1307 | { 1308 | swap$ 1309 | " " * swap$ 1310 | } 1311 | if$ 1312 | * 1313 | } 1314 | if$ 1315 | } 1316 | 1317 | FUNCTION {format.date.electronic} 1318 | { month "month" bibinfo.check duplicate$ empty$ 1319 | year "year" bibinfo.check duplicate$ empty$ 1320 | { swap$ 1321 | { pop$ } 1322 | { "there's a month but no year in " cite$ * warning$ 1323 | pop$ ")" * "(" swap$ * 1324 | this.to.prev.status 1325 | punct.no 'this.status.punct := 1326 | space.normal 'this.status.space := 1327 | quote.no 'this.status.quote := 1328 | cap.yes 'status.cap := 1329 | } 1330 | if$ 1331 | } 1332 | { swap$ 1333 | { swap$ pop$ ")" * "(" swap$ * } 1334 | { "(" swap$ * ", " * swap$ * ")" * } 1335 | if$ 1336 | this.to.prev.status 1337 | punct.no 'this.status.punct := 1338 | space.normal 'this.status.space := 1339 | quote.no 'this.status.quote := 1340 | cap.yes 'status.cap := 1341 | } 1342 | if$ 1343 | } 1344 | 1345 | 1346 | 1347 | %% edition/title 1348 | 1349 | % Note: The IEEE considers the edition to be closely associated with 1350 | % the title of a book. So, in IEEEtran.bst the edition is normally handled 1351 | % within the formatting of the title. The format.edition function is 1352 | % retained here for possible future use. 1353 | FUNCTION {format.edition} 1354 | { edition duplicate$ empty$ 'skip$ 1355 | { this.to.prev.status 1356 | this.status.std 1357 | convert.edition 1358 | status.cap 1359 | { "t" } 1360 | { "l" } 1361 | if$ change.case$ 1362 | "edition" bibinfo.check 1363 | "~" * bbl.edition * 1364 | cap.status.std 1365 | } 1366 | if$ 1367 | } 1368 | 1369 | % This is used to format the booktitle of a conference proceedings. 1370 | % Here we use the "intype" field to provide the user a way to 1371 | % override the word "in" (e.g., with things like "presented at") 1372 | % Use of intype stops the emphasis of the booktitle to indicate that 1373 | % we no longer mean the written conference proceedings, but the 1374 | % conference itself. 1375 | FUNCTION {format.in.booktitle} 1376 | { booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ 1377 | { this.to.prev.status 1378 | this.status.std 1379 | select.language 1380 | intype missing$ 1381 | { emphasize 1382 | bbl.in " " * 1383 | } 1384 | { intype " " * } 1385 | if$ 1386 | swap$ * 1387 | cap.status.std 1388 | } 1389 | if$ 1390 | } 1391 | 1392 | % This is used to format the booktitle of collection. 1393 | % Here the "intype" field is not supported, but "edition" is. 1394 | FUNCTION {format.in.booktitle.edition} 1395 | { booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ 1396 | { this.to.prev.status 1397 | this.status.std 1398 | select.language 1399 | emphasize 1400 | edition empty$ 'skip$ 1401 | { ", " * 1402 | edition 1403 | convert.edition 1404 | "l" change.case$ 1405 | * "~" * bbl.edition * 1406 | } 1407 | if$ 1408 | bbl.in " " * swap$ * 1409 | cap.status.std 1410 | } 1411 | if$ 1412 | } 1413 | 1414 | FUNCTION {format.article.title} 1415 | { title duplicate$ empty$ 'skip$ 1416 | { this.to.prev.status 1417 | this.status.std 1418 | "t" change.case$ 1419 | } 1420 | if$ 1421 | "title" bibinfo.check 1422 | duplicate$ empty$ 'skip$ 1423 | { quote.close 'this.status.quote := 1424 | is.last.char.not.punct 1425 | { punct.std 'this.status.punct := } 1426 | { punct.no 'this.status.punct := } 1427 | if$ 1428 | select.language 1429 | "``" swap$ * 1430 | cap.status.std 1431 | } 1432 | if$ 1433 | } 1434 | 1435 | FUNCTION {format.article.title.electronic} 1436 | { title duplicate$ empty$ 'skip$ 1437 | { this.to.prev.status 1438 | this.status.std 1439 | cap.status.std 1440 | "t" change.case$ 1441 | } 1442 | if$ 1443 | "title" bibinfo.check 1444 | duplicate$ empty$ 1445 | { skip$ } 1446 | { select.language } 1447 | if$ 1448 | } 1449 | 1450 | FUNCTION {format.book.title.edition} 1451 | { title "title" bibinfo.check 1452 | duplicate$ empty$ 1453 | { "empty title in " cite$ * warning$ } 1454 | { this.to.prev.status 1455 | this.status.std 1456 | select.language 1457 | emphasize 1458 | edition empty$ 'skip$ 1459 | { ", " * 1460 | edition 1461 | convert.edition 1462 | status.cap 1463 | { "t" } 1464 | { "l" } 1465 | if$ 1466 | change.case$ 1467 | * "~" * bbl.edition * 1468 | } 1469 | if$ 1470 | cap.status.std 1471 | } 1472 | if$ 1473 | } 1474 | 1475 | FUNCTION {format.book.title} 1476 | { title "title" bibinfo.check 1477 | duplicate$ empty$ 'skip$ 1478 | { this.to.prev.status 1479 | this.status.std 1480 | cap.status.std 1481 | select.language 1482 | emphasize 1483 | } 1484 | if$ 1485 | } 1486 | 1487 | 1488 | 1489 | %% journal 1490 | 1491 | FUNCTION {format.journal} 1492 | { journal duplicate$ empty$ 'skip$ 1493 | { this.to.prev.status 1494 | this.status.std 1495 | cap.status.std 1496 | select.language 1497 | emphasize 1498 | } 1499 | if$ 1500 | } 1501 | 1502 | 1503 | 1504 | %% how published 1505 | 1506 | FUNCTION {format.howpublished} 1507 | { howpublished duplicate$ empty$ 'skip$ 1508 | { this.to.prev.status 1509 | this.status.std 1510 | cap.status.std 1511 | } 1512 | if$ 1513 | } 1514 | 1515 | 1516 | 1517 | %% institutions/organization/publishers/school 1518 | 1519 | FUNCTION {format.institution} 1520 | { institution duplicate$ empty$ 'skip$ 1521 | { this.to.prev.status 1522 | this.status.std 1523 | cap.status.std 1524 | } 1525 | if$ 1526 | } 1527 | 1528 | FUNCTION {format.organization} 1529 | { organization duplicate$ empty$ 'skip$ 1530 | { this.to.prev.status 1531 | this.status.std 1532 | cap.status.std 1533 | } 1534 | if$ 1535 | } 1536 | 1537 | FUNCTION {format.address.publisher.date} 1538 | { publisher "publisher" bibinfo.warn format.address.org.or.pub.date } 1539 | 1540 | FUNCTION {format.address.publisher.date.nowarn} 1541 | { publisher "publisher" bibinfo.check format.address.org.or.pub.date } 1542 | 1543 | FUNCTION {format.address.organization.date} 1544 | { organization "organization" bibinfo.check format.address.org.or.pub.date } 1545 | 1546 | FUNCTION {format.school} 1547 | { school duplicate$ empty$ 'skip$ 1548 | { this.to.prev.status 1549 | this.status.std 1550 | cap.status.std 1551 | } 1552 | if$ 1553 | } 1554 | 1555 | 1556 | 1557 | %% volume/number/series/chapter/pages 1558 | 1559 | FUNCTION {format.volume} 1560 | { volume empty.field.to.null.string 1561 | duplicate$ empty$ 'skip$ 1562 | { this.to.prev.status 1563 | this.status.std 1564 | bbl.volume 1565 | status.cap 1566 | { capitalize } 1567 | { skip$ } 1568 | if$ 1569 | swap$ tie.or.space.prefix 1570 | "volume" bibinfo.check 1571 | * * 1572 | cap.status.std 1573 | } 1574 | if$ 1575 | } 1576 | 1577 | FUNCTION {format.number} 1578 | { number empty.field.to.null.string 1579 | duplicate$ empty$ 'skip$ 1580 | { this.to.prev.status 1581 | this.status.std 1582 | status.cap 1583 | { bbl.number capitalize } 1584 | { bbl.number } 1585 | if$ 1586 | swap$ tie.or.space.prefix 1587 | "number" bibinfo.check 1588 | * * 1589 | cap.status.std 1590 | } 1591 | if$ 1592 | } 1593 | 1594 | FUNCTION {format.number.if.use.for.article} 1595 | { is.use.number.for.article 1596 | { format.number } 1597 | { "" } 1598 | if$ 1599 | } 1600 | 1601 | % The IEEE does not seem to tie the series so closely with the volume 1602 | % and number as is done in other bibliography styles. Instead the 1603 | % series is treated somewhat like an extension of the title. 1604 | FUNCTION {format.series} 1605 | { series empty$ 1606 | { "" } 1607 | { this.to.prev.status 1608 | this.status.std 1609 | bbl.series " " * 1610 | series "series" bibinfo.check * 1611 | cap.status.std 1612 | } 1613 | if$ 1614 | } 1615 | 1616 | 1617 | FUNCTION {format.chapter} 1618 | { chapter empty$ 1619 | { "" } 1620 | { this.to.prev.status 1621 | this.status.std 1622 | type empty$ 1623 | { bbl.chapter } 1624 | { type "l" change.case$ 1625 | "type" bibinfo.check 1626 | } 1627 | if$ 1628 | chapter tie.or.space.prefix 1629 | "chapter" bibinfo.check 1630 | * * 1631 | cap.status.std 1632 | } 1633 | if$ 1634 | } 1635 | 1636 | 1637 | % The intended use of format.paper is for paper numbers of inproceedings. 1638 | % The paper type can be overridden via the type field. 1639 | % We allow the type to be displayed even if the paper number is absent 1640 | % for things like "postdeadline paper" 1641 | FUNCTION {format.paper} 1642 | { is.use.paper 1643 | { paper empty$ 1644 | { type empty$ 1645 | { "" } 1646 | { this.to.prev.status 1647 | this.status.std 1648 | type "type" bibinfo.check 1649 | cap.status.std 1650 | } 1651 | if$ 1652 | } 1653 | { this.to.prev.status 1654 | this.status.std 1655 | type empty$ 1656 | { bbl.paper } 1657 | { type "type" bibinfo.check } 1658 | if$ 1659 | " " * paper 1660 | "paper" bibinfo.check 1661 | * 1662 | cap.status.std 1663 | } 1664 | if$ 1665 | } 1666 | { "" } 1667 | if$ 1668 | } 1669 | 1670 | 1671 | FUNCTION {format.pages} 1672 | { pages duplicate$ empty$ 'skip$ 1673 | { this.to.prev.status 1674 | this.status.std 1675 | duplicate$ is.multiple.pages 1676 | { 1677 | bbl.pages swap$ 1678 | n.dashify 1679 | } 1680 | { 1681 | bbl.page swap$ 1682 | } 1683 | if$ 1684 | tie.or.space.prefix 1685 | "pages" bibinfo.check 1686 | * * 1687 | cap.status.std 1688 | } 1689 | if$ 1690 | } 1691 | 1692 | 1693 | 1694 | %% technical report number 1695 | 1696 | FUNCTION {format.tech.report.number} 1697 | { number "number" bibinfo.check 1698 | this.to.prev.status 1699 | this.status.std 1700 | cap.status.std 1701 | type duplicate$ empty$ 1702 | { pop$ 1703 | bbl.techrep 1704 | } 1705 | { skip$ } 1706 | if$ 1707 | "type" bibinfo.check 1708 | swap$ duplicate$ empty$ 1709 | { pop$ } 1710 | { tie.or.space.prefix * * } 1711 | if$ 1712 | } 1713 | 1714 | 1715 | 1716 | %% note 1717 | 1718 | FUNCTION {format.note} 1719 | { note empty$ 1720 | { "" } 1721 | { this.to.prev.status 1722 | this.status.std 1723 | punct.period 'this.status.punct := 1724 | note #1 #1 substring$ 1725 | duplicate$ "{" = 1726 | { skip$ } 1727 | { status.cap 1728 | { "u" } 1729 | { "l" } 1730 | if$ 1731 | change.case$ 1732 | } 1733 | if$ 1734 | note #2 global.max$ substring$ * "note" bibinfo.check 1735 | cap.yes 'status.cap := 1736 | } 1737 | if$ 1738 | } 1739 | 1740 | 1741 | 1742 | %% patent 1743 | 1744 | FUNCTION {format.patent.date} 1745 | { this.to.prev.status 1746 | this.status.std 1747 | year empty$ 1748 | { monthfiled duplicate$ empty$ 1749 | { "monthfiled" bibinfo.check pop$ "" } 1750 | { "monthfiled" bibinfo.check } 1751 | if$ 1752 | dayfiled duplicate$ empty$ 1753 | { "dayfiled" bibinfo.check pop$ "" * } 1754 | { "dayfiled" bibinfo.check 1755 | monthfiled empty$ 1756 | { "dayfiled without a monthfiled in " cite$ * warning$ 1757 | * 1758 | } 1759 | { " " swap$ * * } 1760 | if$ 1761 | } 1762 | if$ 1763 | yearfiled empty$ 1764 | { "no year or yearfiled in " cite$ * warning$ } 1765 | { yearfiled "yearfiled" bibinfo.check 1766 | swap$ 1767 | duplicate$ empty$ 1768 | { pop$ } 1769 | { ", " * swap$ * } 1770 | if$ 1771 | } 1772 | if$ 1773 | } 1774 | { month duplicate$ empty$ 1775 | { "month" bibinfo.check pop$ "" } 1776 | { "month" bibinfo.check } 1777 | if$ 1778 | day duplicate$ empty$ 1779 | { "day" bibinfo.check pop$ "" * } 1780 | { "day" bibinfo.check 1781 | month empty$ 1782 | { "day without a month in " cite$ * warning$ 1783 | * 1784 | } 1785 | { " " swap$ * * } 1786 | if$ 1787 | } 1788 | if$ 1789 | year "year" bibinfo.check 1790 | swap$ 1791 | duplicate$ empty$ 1792 | { pop$ } 1793 | { ", " * swap$ * } 1794 | if$ 1795 | } 1796 | if$ 1797 | cap.status.std 1798 | } 1799 | 1800 | FUNCTION {format.patent.nationality.type.number} 1801 | { this.to.prev.status 1802 | this.status.std 1803 | nationality duplicate$ empty$ 1804 | { "nationality" bibinfo.warn pop$ "" } 1805 | { "nationality" bibinfo.check 1806 | duplicate$ "l" change.case$ "united states" = 1807 | { pop$ bbl.patentUS } 1808 | { skip$ } 1809 | if$ 1810 | " " * 1811 | } 1812 | if$ 1813 | type empty$ 1814 | { bbl.patent "type" bibinfo.check } 1815 | { type "type" bibinfo.check } 1816 | if$ 1817 | * 1818 | number duplicate$ empty$ 1819 | { "number" bibinfo.warn pop$ } 1820 | { "number" bibinfo.check 1821 | large.number.separate 1822 | swap$ " " * swap$ * 1823 | } 1824 | if$ 1825 | cap.status.std 1826 | } 1827 | 1828 | 1829 | 1830 | %% standard 1831 | 1832 | FUNCTION {format.organization.institution.standard.type.number} 1833 | { this.to.prev.status 1834 | this.status.std 1835 | organization duplicate$ empty$ 1836 | { pop$ 1837 | institution duplicate$ empty$ 1838 | { "institution" bibinfo.warn } 1839 | { "institution" bibinfo.warn " " * } 1840 | if$ 1841 | } 1842 | { "organization" bibinfo.warn " " * } 1843 | if$ 1844 | type empty$ 1845 | { bbl.standard "type" bibinfo.check } 1846 | { type "type" bibinfo.check } 1847 | if$ 1848 | * 1849 | number duplicate$ empty$ 1850 | { "number" bibinfo.check pop$ } 1851 | { "number" bibinfo.check 1852 | large.number.separate 1853 | swap$ " " * swap$ * 1854 | } 1855 | if$ 1856 | cap.status.std 1857 | } 1858 | 1859 | FUNCTION {format.revision} 1860 | { revision empty$ 1861 | { "" } 1862 | { this.to.prev.status 1863 | this.status.std 1864 | bbl.revision 1865 | revision tie.or.space.prefix 1866 | "revision" bibinfo.check 1867 | * * 1868 | cap.status.std 1869 | } 1870 | if$ 1871 | } 1872 | 1873 | 1874 | %% thesis 1875 | 1876 | FUNCTION {format.master.thesis.type} 1877 | { this.to.prev.status 1878 | this.status.std 1879 | type empty$ 1880 | { 1881 | bbl.mthesis 1882 | } 1883 | { 1884 | type "type" bibinfo.check 1885 | } 1886 | if$ 1887 | cap.status.std 1888 | } 1889 | 1890 | FUNCTION {format.phd.thesis.type} 1891 | { this.to.prev.status 1892 | this.status.std 1893 | type empty$ 1894 | { 1895 | bbl.phdthesis 1896 | } 1897 | { 1898 | type "type" bibinfo.check 1899 | } 1900 | if$ 1901 | cap.status.std 1902 | } 1903 | 1904 | 1905 | 1906 | %% URL 1907 | 1908 | FUNCTION {format.url} 1909 | { is.use.url 1910 | { url empty$ 1911 | { "" } 1912 | { this.to.prev.status 1913 | this.status.std 1914 | cap.yes 'status.cap := 1915 | name.url.prefix " " * 1916 | "\url{" * url * "}" * 1917 | punct.no 'this.status.punct := 1918 | punct.period 'prev.status.punct := 1919 | space.normal 'this.status.space := 1920 | space.normal 'prev.status.space := 1921 | quote.no 'this.status.quote := 1922 | } 1923 | if$ 1924 | } 1925 | { "" } 1926 | if$ 1927 | } 1928 | 1929 | 1930 | 1931 | 1932 | %%%%%%%%%%%%%%%%%%%% 1933 | %% ENTRY HANDLERS %% 1934 | %%%%%%%%%%%%%%%%%%%% 1935 | 1936 | 1937 | % Note: In many journals, the IEEE (or the authors) tend not to show the number 1938 | % for articles, so the display of the number is controlled here by the 1939 | % switch "is.use.number.for.article" 1940 | FUNCTION {article} 1941 | { std.status.using.comma 1942 | start.entry 1943 | if.url.alt.interword.spacing 1944 | format.authors "author" output.warn 1945 | name.or.dash 1946 | format.article.title "title" output.warn 1947 | format.journal "journal" bibinfo.check "journal" output.warn 1948 | format.volume output 1949 | format.number.if.use.for.article output 1950 | format.pages output 1951 | format.date "year" output.warn 1952 | format.note output 1953 | format.url output 1954 | fin.entry 1955 | if.url.std.interword.spacing 1956 | } 1957 | 1958 | FUNCTION {book} 1959 | { std.status.using.comma 1960 | start.entry 1961 | if.url.alt.interword.spacing 1962 | author empty$ 1963 | { format.editors "author and editor" output.warn } 1964 | { format.authors output.nonnull } 1965 | if$ 1966 | name.or.dash 1967 | format.book.title.edition output 1968 | format.series output 1969 | author empty$ 1970 | { skip$ } 1971 | { format.editors output } 1972 | if$ 1973 | format.address.publisher.date output 1974 | format.volume output 1975 | format.number output 1976 | format.note output 1977 | format.url output 1978 | fin.entry 1979 | if.url.std.interword.spacing 1980 | } 1981 | 1982 | FUNCTION {booklet} 1983 | { std.status.using.comma 1984 | start.entry 1985 | if.url.alt.interword.spacing 1986 | format.authors output 1987 | name.or.dash 1988 | format.article.title "title" output.warn 1989 | format.howpublished "howpublished" bibinfo.check output 1990 | format.organization "organization" bibinfo.check output 1991 | format.address "address" bibinfo.check output 1992 | format.date output 1993 | format.note output 1994 | format.url output 1995 | fin.entry 1996 | if.url.std.interword.spacing 1997 | } 1998 | 1999 | FUNCTION {electronic} 2000 | { std.status.using.period 2001 | start.entry 2002 | if.url.alt.interword.spacing 2003 | format.authors output 2004 | name.or.dash 2005 | format.date.electronic output 2006 | format.article.title.electronic output 2007 | format.howpublished "howpublished" bibinfo.check output 2008 | format.organization "organization" bibinfo.check output 2009 | format.address "address" bibinfo.check output 2010 | format.note output 2011 | format.url output 2012 | fin.entry 2013 | empty.entry.warn 2014 | if.url.std.interword.spacing 2015 | } 2016 | 2017 | FUNCTION {inbook} 2018 | { std.status.using.comma 2019 | start.entry 2020 | if.url.alt.interword.spacing 2021 | author empty$ 2022 | { format.editors "author and editor" output.warn } 2023 | { format.authors output.nonnull } 2024 | if$ 2025 | name.or.dash 2026 | format.book.title.edition output 2027 | format.series output 2028 | format.address.publisher.date output 2029 | format.volume output 2030 | format.number output 2031 | format.chapter output 2032 | format.pages output 2033 | format.note output 2034 | format.url output 2035 | fin.entry 2036 | if.url.std.interword.spacing 2037 | } 2038 | 2039 | FUNCTION {incollection} 2040 | { std.status.using.comma 2041 | start.entry 2042 | if.url.alt.interword.spacing 2043 | format.authors "author" output.warn 2044 | name.or.dash 2045 | format.article.title "title" output.warn 2046 | format.in.booktitle.edition "booktitle" output.warn 2047 | format.series output 2048 | format.editors output 2049 | format.address.publisher.date.nowarn output 2050 | format.volume output 2051 | format.number output 2052 | format.chapter output 2053 | format.pages output 2054 | format.note output 2055 | format.url output 2056 | fin.entry 2057 | if.url.std.interword.spacing 2058 | } 2059 | 2060 | FUNCTION {inproceedings} 2061 | { std.status.using.comma 2062 | start.entry 2063 | if.url.alt.interword.spacing 2064 | format.authors "author" output.warn 2065 | name.or.dash 2066 | format.article.title "title" output.warn 2067 | format.in.booktitle "booktitle" output.warn 2068 | format.series output 2069 | format.editors output 2070 | format.volume output 2071 | format.number output 2072 | publisher empty$ 2073 | { format.address.organization.date output } 2074 | { format.organization "organization" bibinfo.check output 2075 | format.address.publisher.date output 2076 | } 2077 | if$ 2078 | format.paper output 2079 | format.pages output 2080 | format.note output 2081 | format.url output 2082 | fin.entry 2083 | if.url.std.interword.spacing 2084 | } 2085 | 2086 | FUNCTION {manual} 2087 | { std.status.using.comma 2088 | start.entry 2089 | if.url.alt.interword.spacing 2090 | format.authors output 2091 | name.or.dash 2092 | format.book.title.edition "title" output.warn 2093 | format.howpublished "howpublished" bibinfo.check output 2094 | format.organization "organization" bibinfo.check output 2095 | format.address "address" bibinfo.check output 2096 | format.date output 2097 | format.note output 2098 | format.url output 2099 | fin.entry 2100 | if.url.std.interword.spacing 2101 | } 2102 | 2103 | FUNCTION {mastersthesis} 2104 | { std.status.using.comma 2105 | start.entry 2106 | if.url.alt.interword.spacing 2107 | format.authors "author" output.warn 2108 | name.or.dash 2109 | format.article.title "title" output.warn 2110 | format.master.thesis.type output.nonnull 2111 | format.school "school" bibinfo.warn output 2112 | format.address "address" bibinfo.check output 2113 | format.date "year" output.warn 2114 | format.note output 2115 | format.url output 2116 | fin.entry 2117 | if.url.std.interword.spacing 2118 | } 2119 | 2120 | FUNCTION {misc} 2121 | { std.status.using.comma 2122 | start.entry 2123 | if.url.alt.interword.spacing 2124 | format.authors output 2125 | name.or.dash 2126 | format.article.title output 2127 | format.howpublished "howpublished" bibinfo.check output 2128 | format.organization "organization" bibinfo.check output 2129 | format.address "address" bibinfo.check output 2130 | format.pages output 2131 | format.date output 2132 | format.note output 2133 | format.url output 2134 | fin.entry 2135 | empty.entry.warn 2136 | if.url.std.interword.spacing 2137 | } 2138 | 2139 | FUNCTION {patent} 2140 | { std.status.using.comma 2141 | start.entry 2142 | if.url.alt.interword.spacing 2143 | format.authors output 2144 | name.or.dash 2145 | format.article.title output 2146 | format.patent.nationality.type.number output 2147 | format.patent.date output 2148 | format.note output 2149 | format.url output 2150 | fin.entry 2151 | empty.entry.warn 2152 | if.url.std.interword.spacing 2153 | } 2154 | 2155 | FUNCTION {periodical} 2156 | { std.status.using.comma 2157 | start.entry 2158 | if.url.alt.interword.spacing 2159 | format.editors output 2160 | name.or.dash 2161 | format.book.title "title" output.warn 2162 | format.series output 2163 | format.volume output 2164 | format.number output 2165 | format.organization "organization" bibinfo.check output 2166 | format.date "year" output.warn 2167 | format.note output 2168 | format.url output 2169 | fin.entry 2170 | if.url.std.interword.spacing 2171 | } 2172 | 2173 | FUNCTION {phdthesis} 2174 | { std.status.using.comma 2175 | start.entry 2176 | if.url.alt.interword.spacing 2177 | format.authors "author" output.warn 2178 | name.or.dash 2179 | format.article.title "title" output.warn 2180 | format.phd.thesis.type output.nonnull 2181 | format.school "school" bibinfo.warn output 2182 | format.address "address" bibinfo.check output 2183 | format.date "year" output.warn 2184 | format.note output 2185 | format.url output 2186 | fin.entry 2187 | if.url.std.interword.spacing 2188 | } 2189 | 2190 | FUNCTION {proceedings} 2191 | { std.status.using.comma 2192 | start.entry 2193 | if.url.alt.interword.spacing 2194 | format.editors output 2195 | name.or.dash 2196 | format.book.title "title" output.warn 2197 | format.series output 2198 | format.volume output 2199 | format.number output 2200 | publisher empty$ 2201 | { format.address.organization.date output } 2202 | { format.organization "organization" bibinfo.check output 2203 | format.address.publisher.date output 2204 | } 2205 | if$ 2206 | format.note output 2207 | format.url output 2208 | fin.entry 2209 | if.url.std.interword.spacing 2210 | } 2211 | 2212 | FUNCTION {standard} 2213 | { std.status.using.comma 2214 | start.entry 2215 | if.url.alt.interword.spacing 2216 | format.authors output 2217 | name.or.dash 2218 | format.book.title "title" output.warn 2219 | format.howpublished "howpublished" bibinfo.check output 2220 | format.organization.institution.standard.type.number output 2221 | format.revision output 2222 | format.date output 2223 | format.note output 2224 | format.url output 2225 | fin.entry 2226 | if.url.std.interword.spacing 2227 | } 2228 | 2229 | FUNCTION {techreport} 2230 | { std.status.using.comma 2231 | start.entry 2232 | if.url.alt.interword.spacing 2233 | format.authors "author" output.warn 2234 | name.or.dash 2235 | format.article.title "title" output.warn 2236 | format.howpublished "howpublished" bibinfo.check output 2237 | format.institution "institution" bibinfo.warn output 2238 | format.address "address" bibinfo.check output 2239 | format.tech.report.number output.nonnull 2240 | format.date "year" output.warn 2241 | format.note output 2242 | format.url output 2243 | fin.entry 2244 | if.url.std.interword.spacing 2245 | } 2246 | 2247 | FUNCTION {unpublished} 2248 | { std.status.using.comma 2249 | start.entry 2250 | if.url.alt.interword.spacing 2251 | format.authors "author" output.warn 2252 | name.or.dash 2253 | format.article.title "title" output.warn 2254 | format.date output 2255 | format.note "note" output.warn 2256 | format.url output 2257 | fin.entry 2258 | if.url.std.interword.spacing 2259 | } 2260 | 2261 | 2262 | % The special entry type which provides the user interface to the 2263 | % BST controls 2264 | FUNCTION {IEEEtranBSTCTL} 2265 | { is.print.banners.to.terminal 2266 | { "** IEEEtran BST control entry " quote$ * cite$ * quote$ * " detected." * 2267 | top$ 2268 | } 2269 | { skip$ } 2270 | if$ 2271 | CTLuse_article_number 2272 | empty$ 2273 | { skip$ } 2274 | { CTLuse_article_number 2275 | yes.no.to.int 2276 | 'is.use.number.for.article := 2277 | } 2278 | if$ 2279 | CTLuse_paper 2280 | empty$ 2281 | { skip$ } 2282 | { CTLuse_paper 2283 | yes.no.to.int 2284 | 'is.use.paper := 2285 | } 2286 | if$ 2287 | CTLuse_url 2288 | empty$ 2289 | { skip$ } 2290 | { CTLuse_url 2291 | yes.no.to.int 2292 | 'is.use.url := 2293 | } 2294 | if$ 2295 | CTLuse_forced_etal 2296 | empty$ 2297 | { skip$ } 2298 | { CTLuse_forced_etal 2299 | yes.no.to.int 2300 | 'is.forced.et.al := 2301 | } 2302 | if$ 2303 | CTLmax_names_forced_etal 2304 | empty$ 2305 | { skip$ } 2306 | { CTLmax_names_forced_etal 2307 | string.to.integer 2308 | 'max.num.names.before.forced.et.al := 2309 | } 2310 | if$ 2311 | CTLnames_show_etal 2312 | empty$ 2313 | { skip$ } 2314 | { CTLnames_show_etal 2315 | string.to.integer 2316 | 'num.names.shown.with.forced.et.al := 2317 | } 2318 | if$ 2319 | CTLuse_alt_spacing 2320 | empty$ 2321 | { skip$ } 2322 | { CTLuse_alt_spacing 2323 | yes.no.to.int 2324 | 'is.use.alt.interword.spacing := 2325 | } 2326 | if$ 2327 | CTLalt_stretch_factor 2328 | empty$ 2329 | { skip$ } 2330 | { CTLalt_stretch_factor 2331 | 'ALTinterwordstretchfactor := 2332 | "\renewcommand{\BIBentryALTinterwordstretchfactor}{" 2333 | ALTinterwordstretchfactor * "}" * 2334 | write$ newline$ 2335 | } 2336 | if$ 2337 | CTLdash_repeated_names 2338 | empty$ 2339 | { skip$ } 2340 | { CTLdash_repeated_names 2341 | yes.no.to.int 2342 | 'is.dash.repeated.names := 2343 | } 2344 | if$ 2345 | CTLname_format_string 2346 | empty$ 2347 | { skip$ } 2348 | { CTLname_format_string 2349 | 'name.format.string := 2350 | } 2351 | if$ 2352 | CTLname_latex_cmd 2353 | empty$ 2354 | { skip$ } 2355 | { CTLname_latex_cmd 2356 | 'name.latex.cmd := 2357 | } 2358 | if$ 2359 | CTLname_url_prefix 2360 | missing$ 2361 | { skip$ } 2362 | { CTLname_url_prefix 2363 | 'name.url.prefix := 2364 | } 2365 | if$ 2366 | 2367 | 2368 | num.names.shown.with.forced.et.al max.num.names.before.forced.et.al > 2369 | { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$ 2370 | max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al := 2371 | } 2372 | { skip$ } 2373 | if$ 2374 | } 2375 | 2376 | 2377 | %%%%%%%%%%%%%%%%%%% 2378 | %% ENTRY ALIASES %% 2379 | %%%%%%%%%%%%%%%%%%% 2380 | FUNCTION {conference}{inproceedings} 2381 | FUNCTION {online}{electronic} 2382 | FUNCTION {internet}{electronic} 2383 | FUNCTION {webpage}{electronic} 2384 | FUNCTION {www}{electronic} 2385 | FUNCTION {default.type}{misc} 2386 | 2387 | 2388 | 2389 | %%%%%%%%%%%%%%%%%% 2390 | %% MAIN PROGRAM %% 2391 | %%%%%%%%%%%%%%%%%% 2392 | 2393 | READ 2394 | 2395 | EXECUTE {initialize.controls} 2396 | EXECUTE {initialize.status.constants} 2397 | EXECUTE {banner.message} 2398 | 2399 | EXECUTE {initialize.longest.label} 2400 | ITERATE {longest.label.pass} 2401 | 2402 | EXECUTE {begin.bib} 2403 | ITERATE {call.type$} 2404 | EXECUTE {end.bib} 2405 | 2406 | EXECUTE{completed.message} 2407 | 2408 | 2409 | %% That's all folks, mds. --------------------------------------------------------------------------------