|
| 1 | +# IEEEtranplus |
| 2 | + |
| 3 | +## A verbose LaTeX Bibliography Style (bst) with local file links for collecting and organizing references |
| 4 | + |
| 5 | +This tool is an extension of `IEEEtran.bst` (https://www.michaelshell.org/tex/ieeetran/) with some additional features. |
| 6 | +I use it as part of my private bibliography: an informal Latex document I built to collect and organize frequently-used references. |
| 7 | +It is not intended for use in publications. |
| 8 | + |
| 9 | +For lack of a better name, I call this tool "IEEEtranplus". |
| 10 | + |
| 11 | +## Key features |
| 12 | + |
| 13 | +1. Supports a `file` field in BibTeX entries which links to one or more documents on your local computer. |
| 14 | + This *should* be compatible with the `file` field used by [JabRef](https://www.jabref.org/). |
| 15 | + |
| 16 | +2. A verbose output of additional fields which are useful when collecting/organizing a repository of references: |
| 17 | + - **url**: A url to the publisher webpage (or other relevant url). |
| 18 | + - **docurl**: An alternate url that links directly to the document. For example, you could link to a copy of the document |
| 19 | + available online or through a library. |
| 20 | + - **library**: A free-form text field to list library call number, or other relevant info. |
| 21 | + - **citekey**: Displays the citation key for the entry. This makes it easy to copy and paste when you want to cite. |
| 22 | + - **note**: A free form text field for storing notes regarding the reference. |
| 23 | + |
| 24 | +3. Provides a LaTeX script `IEEEtranplus.tex` with useful features: |
| 25 | + - Includes the `hyperref` package, which is needed by `IEEEtranplus.bst`. |
| 26 | + - Include `backref` package to indicate where in the document a reference is cited. This is useful for jumping |
| 27 | + back and forth between the document and references. |
| 28 | + - Various fixes for searching for text within a PDF document (to handle ligatures and underscores). |
| 29 | + |
| 30 | +## Example |
| 31 | +Example BibTeX entry: |
| 32 | +``` |
| 33 | +@book{PrincipiaMathematica:1927, |
| 34 | + author = "Whitehead, Alfred North and Russell, Bertrand Arthur William", |
| 35 | + title = "{Principia mathematica; 2nd ed.}", |
| 36 | + publisher = "Cambridge Univ. Press", |
| 37 | + year = "1927", |
| 38 | + url = "https://www.cambridge.org/us/universitypress/subjects/mathematics/logic-categories-and-sets/principia-mathematica?format=WX&isbn=9780521067911", |
| 39 | + docurl = "https://cds.cern.ch/record/268025", |
| 40 | + file = "Volume 1:PrincipiaMathematicaVol1.pdf;Volume 2:PrincipiaMathematicaVol2.pdf;Volume 3:PrincipiaMathematicaVol3.pdf", |
| 41 | + library = "Library of Congress: QA9.W5 1925", |
| 42 | + note = "The book can also be viewed online here: \href{https://www.loc.gov/item/25015133/}{Library of Congress}", |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +Produces the following output: |
| 47 | +``` |
| 48 | +[1] A. N. Whitehead and B. A. W. Russell, Principia mathematica; 2nd ed. Cambridge Univ. Press, 1927 |
| 49 | + URL: https://www.cambridge.org/us/universitypress/subjects/mathematics/logic-categories-and-sets/principia-mathematica?format=WX&isbn=9780521067911 |
| 50 | + DOCURL: https://cds.cern.ch/record/268025 |
| 51 | + FILE: PrincipiaMathematicaVol1.pdf Volume 1 |
| 52 | + FILE: PrincipiaMathematicaVol2.pdf Volume 2 |
| 53 | + FILE: PrincipiaMathematicaVol3.pdf Volume 3 |
| 54 | + LIBRARY: Library of Congress: QA9.W5 1925 |
| 55 | + NOTE: The book can also be viewed online here: Library of Congress |
| 56 | + CITEKEY: PrincipiaMathematica:1927 |
| 57 | + CITATIONS: page 1 |
| 58 | +``` |
| 59 | + |
| 60 | +Note that each field is displayed on its own line. Though this format is very verbose and can significantly extend the length |
| 61 | +of the document, I find it useful for my private bibliography to have all the info displayed in one place for easy browsing. |
| 62 | + |
| 63 | +Full example documents are given in the examples folder. |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +## Usage |
| 68 | +- Optionally, include the `IEEEtranplus.tex` script in your document header to provide useful features. |
| 69 | + Use the command: `\input{IEEEtranplus}` |
| 70 | + |
| 71 | +- Make sure to include package `hyperref` for links to work properly (this is already included in `IEEEtranplus.tex`). |
| 72 | + Use the command: `\usepackage{hyperref}` in your header. |
| 73 | + |
| 74 | +- Call out the `IEEEtranplus.bst` style in your document using the command: `\bibliographystyle{IEEEtranplus}` |
| 75 | + |
| 76 | +- The referenced files should be put in a `ref` subfolder under the folder where your compiled PDF is located |
| 77 | + (this folder is configurable by editing the `IEEEplanplus.bst` file's `file.folder` function). Then, depending on the |
| 78 | + PDF viewer you are using, you should be able to click on the file name in the PDF and the file will open. This should |
| 79 | + work in PDF viewers such as Adobe Acrobat and Chrome (tested on Windows). Many PDF viewers allow you to hold the |
| 80 | + "ctrl" key when clicking on the file to open it in a new tab/window. |
| 81 | + |
| 82 | +- The format of the file field is as follows: |
| 83 | + - For a single file: `FILE = "description:file"` or `FILE = {description:file}` |
| 84 | + (as with other fields, you can use double quotes or curly braces). |
| 85 | + - The description is optional, i.e., you could just call out `FILE = "file"` |
| 86 | + - For multiple files, separate with a semicolon. For example:`FILE = "description1:file1;description2:file2"` |
| 87 | + - A file type can be provided. For example `FILE = description:file.pdf:PDF`. |
| 88 | + This type is only included for compatibility with JabRef, and `IEEEtranplus.bst` does not use this type in any way. |
| 89 | + |
| 90 | +- There are various option flags in the "Options for IEEEtranplus" section of `IEEEtranplus.bst`, which can be enabled/disabled. |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | +## Technical Notes |
| 95 | +- The function `escapechar` performs escaping of special characters. |
| 96 | +This function might need to be updated to support additional special characters in the future. |
| 97 | + |
| 98 | +- The `file` field can handle HTML unicode entities (like `,`) in the file name. |
| 99 | + However, there is an issue with the hash tag `#` when used in a link within the `\href` command, even if it is escaped as `\#`. |
| 100 | + I am not sure how to resolve this. Even if this is resolved, e.g. using the `\url` command, it seems there are still |
| 101 | + issues with the PDF reader properly handling this case, so it is best to avoid using them anyway. |
| 102 | + Maybe this could be resolved by changing the category code of the # character. |
| 103 | + |
| 104 | +- The parsing logic for the `file` field is based on the code/algorithm found in the |
| 105 | + [JabRef](https://www.jabref.org/) source code (version 4.3.1) inside the following files: |
| 106 | + - org/jabref/model/entry/FileFieldParser.java |
| 107 | + - org/jabref/model/entry/FileFieldWriter.java |
| 108 | + |
| 109 | +- To include citation keys in the references, you could also use the `showkeys` package. The main reason I included this |
| 110 | + functionality directly in `IEEEtranplus.bst` is to show the key in-line with the text. Though `showkeys` is a great package, |
| 111 | + I had truncation/overlap issues with long keys or when in two column mode |
| 112 | + |
| 113 | +- Debugging tips: |
| 114 | + - Some useful debugging commands for BST files: |
| 115 | + - Print debug message in log: `"message" top$` |
| 116 | + - Show element on top of stack: `duplicate$ top$` |
| 117 | + |
| 118 | + - In MikTex, to see the `.bbl` file, perform separate compiles using PdfLatex first, and then BibText second. |
| 119 | + The `.bbl` should then be present in the working folder. Running PdfLatex again will make the final PDF from this |
| 120 | + `.bbl` file (you can edit the bbl and rerun PdfLatex during debugging). |
| 121 | + |
| 122 | +- The BibLaTeX package documentation (http://mirror.hmc.edu/ctan/macros/latex/contrib/biblatex/doc/biblatex.pdf) was used |
| 123 | + as a reference when writing this tool. Note that the documentation does call out a `library` field, though I have never |
| 124 | + seen it used elsewhere. |
| 125 | + |
| 126 | +- The file `IEEEtranplus.bst` is a Derived Work (as defined under the LaTeX Project Public License) written by Andre Beckus. |
| 127 | + The Original Work is as follows: |
| 128 | + - bibtex/IEEEtran.bst Version 1.14 (2015/08/26) |
| 129 | + - Copyright (c) 2003-2015 Michael Shell |
| 130 | + - Available from: |
| 131 | + - https://www.michaelshell.org/tex/ieeetran/ |
| 132 | + - https://www.ctan.org/pkg/ieeetran |
| 133 | + - For a diff showing my modifications, see Github |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | +## Files |
| 138 | + |
| 139 | +- `README.md`: This file. |
| 140 | +- `IEEEtranplus.bst`: The main LaTeX Bibliography Style. Provides the core functionality of this tool. |
| 141 | +- `IEEEtranplus.tex`: An optional LaTeX script including additional functionality. |
| 142 | +- `examples/simple`: A simple example document. |
| 143 | +- `examples/detailed`: A detailed example showing various aspects of the functionality. |
| 144 | + |
| 145 | +## Legal Notice |
| 146 | +This code is offered as-is without any warranty either expressed or |
| 147 | +implied; without even the implied warranty of MERCHANTABILITY or |
| 148 | +FITNESS FOR A PARTICULAR PURPOSE! |
| 149 | +User assumes all risk. |
| 150 | +In no event shall the IEEE or any contributor to this code be liable for |
| 151 | +any damages or losses, including, but not limited to, incidental, |
| 152 | +consequential, or any other damages, resulting from the use or misuse |
| 153 | +of any information contained here. |
| 154 | + |
| 155 | +All comments are the opinions of their respective authors and are not |
| 156 | +necessarily endorsed by the IEEE. |
| 157 | + |
| 158 | +This work is distributed under the LaTeX Project Public License (LPPL) |
| 159 | +( http://www.latex-project.org/ ) version 1.3, and may be freely used, |
| 160 | +distributed and modified. A copy of the LPPL, version 1.3, is included |
| 161 | +in the base LaTeX documentation of all distributions of LaTeX released |
| 162 | +2003/12/01 or later. |
| 163 | +Retain all contribution notices and credits. |
| 164 | + |
| 165 | + |
0 commit comments