Template talk:USStat

Code to be used
http://memory.loc.gov/cgi-bin/ampage?collId=llsl&fileName=/llsl.db&recNum=0

U.S.Stat

Notes regarding starting page
Index: http://memory.loc.gov/ammem/amlaw/lwsllink.html

Google Books
I added Google Books links for 19-21; there are probably more available there. I know that 18 is strange with several volumes (is there a standard way to disambiguate?), but is there a reason 17 doesn't link to the LOC scans? --NE2 19:57, 22 August 2008 (UTC)

USSaL Volumes available on WikiSource
Fwiw... scans of United States Statutes at Large volumes 1 thru 45, 65 thru 121 have been uploaded to Commons and made available via Wikisource for template/interlink use as needed. Indexing and Page: creation is currently in progress and nearly complete.

Direct links to all the volumes currently hosted over on Wikisource can be found in the table that follows...

George Orwell III (talk) 20:08, 8 July 2011 (UTC)

Link everything to Wikisource
As far as I know, (almost) all volumes are available for linking, whether they be on external sites or on a Wikimedia Foundation site available through interwiki linking. See the above talk section for the available volumes on Wikisource. These missing volumes should be linked to by this template immediately as this is obviously non-controversial. Unless there is objection, I will make these changes as soon as possible.
 * Actually, a good number of the online sites hosting the Statutes at Large volumes do not have the entire volume content - just the Public Laws in short. "We" have gone out of our way to only use copies that are complete. Volumes 46 to 64 do exist somewhere in cyberspace [for free] and I'm sure many of those are complete as well but "we" haven't gotten around to working them since those require additional verification and editing before they can be uploaded and manipulated for text layers (OCR'd unfortunately) before upload to Commons and proofreading on Wikisource. Any help with locating and refining those 20 or so volumes not yet available on Wikisource would, of course, be greatly welcomed. -- George Orwell III (talk) 07:15, 2 September 2011 (UTC)


 * Yes, I think I ran into this when looking for treaties. It only took me ridiculous numbers of wasted hours (time is money.) This will provide links for volumes 1-45 and 65-121 right now in every article that uses this template. Int21h (talk) 08:08, 3 September 2011 (UTC)

Another issue is since these titles are available on Wikisource, and some are even transliterated there in (machine readable Unicode) text which may provide web accessibility, the Wikisource links are preferable to Google Books and the Library of Congress links. Pictures without text are great, but text side-by-side with pictures is better. I propose that all volumes that are on Wikisource be linked using this template. Obviously this is a more controversial change, so I will not press ahead with this immediately. Int21h (talk) 22:54, 31 August 2011 (UTC)


 * Not yet, please. Wikisource would be good, but it's not complete and the incomplete stuff is all scanned, not text.  Linking to THOMAS or GPO or whatever at least gives us text.  I agree, however, that we need it to link to Wikisource eventually.—GoldRingChip  01:05, 1 September 2011 (UTC)
 * I would tend to agree with GoldRingChip's rationale for now since most are not familar with Wikisource and its role in transcribing such published works into complete and accurate mainspace articles in general anyway, but without additional participation from contributors seeking to to build solid article foundations supported by easily interlinked & verified copies of the law(s) in question, I too am somewhat at a loss on how best to move forward with all this. It was hoped that folks who are sick and tired of constant and erroneous debates/edit wars over various U.S. "legal" matters would gravitate to the legal particulars in question, locate and tidy them up on Wikisource by proofreading the extracted text and then re-create (transclude it actually) the content in the en.WS mainspace so the points of contention could be easily interlinked directly for any and all to inspect on their own as they see fit and without prejudice to make better Wikipedia entries on the matter -- minus all the drama that frequently comes with unsupported views or 3rd party hearsay.   I'm open to hearing any & all suggestions, comments, idea, etc. on this either way though. -- George Orwell III (talk) 07:15, 2 September 2011 (UTC)
 * It would help if people actually knew about the Wikisource copies. Just a thought. Int21h (talk) 08:26, 3 September 2011 (UTC)
 * Wikisource is more complete. I could be mistaken, but I believe volumes 1-43, the only volumes linked to out of 124, are links to photographic scans that duplicate a small subset of what is on Wikisource. The Google Books scans, volumes 19-42 give or take, have an extremely limited text search of some proprietary fashion, though. Only volumes 109-124 from the GPO possibly provide text, but the documentation says they are not linked in the template, so I am missing the point. I assume they are not linked because they may not be linked reliably. My experience with using GPO data sources has prooven a mixed bag; I will not attempt it. If someone eventually succeeds in doing so, I see no problem in replacing those volumes with relevant links. If someone eventually succeeds. So, in sum, both concerns do not appear to have merit unless I am missing something. Wikisource's projects for transcribing, translating, making papier-mâché out of them, its quality as an external link from Wikipedia, etc. is largely irrelevant IMO as it meets and beats the competition. This is public domain material from hundreds of years ago that everyone is supposed to know by heart by law, so go figure. It shouldn't take someone months to find.  So yes, I will hold off for now, if only because I work so slowly. Int21h (talk) 08:08, 3 September 2011 (UTC)


 * Not quite sure if we are all on the same page but to summarize... Volumes 1 to 45 were gathered from the usual online suspects, made into layer-less PDFs whenever one did not already exist, converted to DJVUs where existing text layers were automatically brought along in conversion but OCR was run when no such text layer was present or available then the finished file uploaded to Commons & broken out into Index Pages: on Wikisource. The same is true for volumes 65 to 121 except a script imported the text straight from GPO rather than over-relying on OCR to generate the missing text layers. Either way, searchable text is there for every single volume in the above table, warts and all, for further manipulation. Every couple of weeks, a bot goes through every single page (usual status: red) linked on the Index page with a script correcting the latest errors in text found in the previous weeks during direct editing of a limited number of pages. Even with the Bot and its scripted corrections - it will take months and months for a typical search engine result to make an exact hit as desired. For those who needed an immediate silver bullet, they just went ahead and corrected all the needed pages manually and transcluded to the mainspace as needed.
 * Anyway the point is that, from the above table, scans [images] of every single page with text as published on paper is present (maps, tables and similar types of images found within the scanned image are slowly being added as discovered/needed). A text layer [Page: namespace] for every scanned page-image currently Indexed from the same table links also exists - the quality of which can widely vary unless manipulated one way or another. Readily transcluded mainspace articles for each and every law, treaty, proclamation, etc. found within each Volume listed are few and far between but growing. Volume 1, 6 and 33 are the only "good" examples of what the finished and interim stages "should" look like. All three namespaces, Index: Page: and the main like here on WP do come up on Google searches to some degree or another - the more editing the higher the results of course. Finally, using What links here from the toolbox is useful for revealing the various namespaces used in setting all that up and for the proofreading stages. That's about it in a nutshell. -- George Orwell III (talk) 10:30, 3 September 2011 (UTC)
 * So it even includes the GPO text data where it exists... At this point I see no good argument against linking to Wikisource completely. But of course it has gone all these years without it so I am sure it can wait a little longer. Int21h (talk) 11:24, 3 September 2011 (UTC)
 * To be even more specific, Volumes 65 thru 116 & 117 thru 121 only differ in where the GPO generated text layer originated from. If it wasn't a hidden text layer already in the GPO PDF file then it was taken from the GPO generated html/xml "plain-text" version(s) using a script after the PDF conversion to DJVU. None of it was 100% perfect to begin with but it was far better than the Library of Congress/Constitution.org's stuff (Volume 1 to 18 and 19 to 45 respectively) was. The bottom line is 65 through 121 is the same as what's available on FDsys/GPO right now except for "proper" Wikification (i.e. linebreaks, indents, spacing and similar for the most part). The bigger issue was the later volumes had grown well past the 100mb upload limit at Commons even though some volumes were split up into as much as 5 or 6 parts & with the DJVU's smaller footprint. So everything from Volume 65 to 121 is based on FDsys (next gen GPO site) generated scans and content but because of the upload limits "we" found some rather in-elegant ways to get everything to fit as a reliable baseline and such. The last step will be to do high-quality conversions to DJVU now that the matching text content exists in the Page: namespace regardless of the matching source file on Commons. All the credit should really go to Tarmstro99; he's the one with an array of Python scripts and the main Bot. -- George Orwell III (talk) 12:32, 3 September 2011 (UTC)

Broken code when page number includes alpha character
When attempting to cite to the Patent and Trademark Office Efficiency Act, 113 Stat. 1501A-572 (which is referring to page 572 of the set of appendices to 113 Stat. 1501, inserted after page 1537), the template chokes on the 'A':

resolves to:
 * 113 Stat. Expression error: Unrecognised word "a".

Any workarounds? What I did was to use Special:ExpandTemplates to generate the subst'd code without the offending character, which I then edited and copied into the article. (Actually, I was using USStatute, but it invoked USStat, which did the actual choking). TJRC (talk) 00:36, 6 April 2012 (UTC)
 * Wow; that's tricky. Thanks for bringing it to our attention. Let me look at it and see if I can resolve it. It might take some time.—GoldRingChip  01:53, 6 April 2012 (UTC)

Link to GPO FDsys
Because there doesn't seem to have been any action on the linking issues above, I boldly changed the template to link to the GPO FDsys for volumes 65 and higher. (I did look at Wikisource, but there doesn't seem to be any way currently to translate page and volume to the correct Wikisource page name). It may not satisfy the people that want searchable/accessible/whatever, but for the vast majority of users who just want to read the text of the law from the cite link, it does the job. If the Google books version of the couple of volumes in that range is really superior, we could add a couple more switches to handle going there instead, but it seemed unnecessary at this point. —&#91;  Alan M 1  (talk) &#93;— 09:02, 26 June 2013 (UTC)
 * Boldness is acceptable, as long as it improves matters! ;) Wikisource Statutes at Large indexes (PDF page<->Stat. page mappings) still need to be completed. After they are, I think we can use those offsets for linking. I also note that many if not most Wikisource pages have not been correctly OCR'd and thus are not searchable (or machine-readable), so Google Books may be a better alternative unless someone can rip that Google OCR text somehow. (Hint hint hackers out there!) Int21h (talk) 11:40, 26 June 2013 (UTC)

URL replacement proposal
I propose we use LegisWorks.org. LegisWorks.org can be used used for all USSAL, not just the current smorgasbord of links. LegisWorks.org appears to use Government Printing Office works as appropriate, and I note that many, if not all, of the Google Books links are not available in all states outside the United States, e.g., Germany, whereas LegisWorks.org is not limited so. I also think we should plan on eventually incorporating all this material into the Wikisource effort and linking there. USStat/sandbox and USStat/testcases have been updated. Int21h (talk) 21:26, 20 September 2014 (UTC)
 * ✅ Int21h (talk) 02:20, 1 October 2014 (UTC)

Avoiding inline external links
Doesn't this perpetuate inline external links which are supposed to be avoided as mentioned on External links? Would it be better to have the template create a ref or similar? --Slivicon (talk) 15:59, 11 June 2015 (UTC)

Appendix volumes
The LegisLink site is broken for the appendix volumes (68A, 70A, 76A, or 77A), so I modified this template to link to the GPO directly for them.

While I was at it, I added the ability to get the entire volume by specifying only the volume (1st) parm. I wasn't clear on what notation to use, so in the case of the appendix volumes, I used e.g. "", which is the page number used in the GPO link. For the rest, I used e.g. "". Please fix or yell if there's a better notation, or if there are any other issues. —[ Alan M 1 (talk) ]— 01:15, 29 January 2019 (UTC)
 * Thanks for your work on this. These are very useful templates. Will USStatute automatically pick up this edit as well? TJRC (talk) 02:14, 29 January 2019 (UTC)

goes to: and mentions: it needs to also point to: also, is there a template for congress bills ?
 * https://uslaw.link/citation/stat/80/92
 * https://www.govtrack.us/congress/bills/89/hr8030
 * https://www.congress.gov/bill/89th-congress/house-bill/8030
 * .... 0mtwb9gd5wx (talk) 04:48, 27 August 2021 (UTC)'
 * .... 0mtwb9gd5wx (talk) 04:48, 27 August 2021 (UTC)'

LegisLink is down
The resolver used by the template, namely Legislink, has not been working for the last few weeks. Based on the archive.org captures, its been down since at least Jan 17th. The problem has been noted on the GitHub page, but no response/fix yet. If the site doesn't come back up, we should consider pointing somewhere else, as the template is currently sending readers to a 502 error. &#12296; Forbes72 &#124; Talk &#12297; 03:02, 31 January 2024 (UTC)
 * Actually, see main discussion at Template talk:USPL. &#12296; Forbes72 &#124; Talk &#12297; 03:34, 31 January 2024 (UTC)