Template talk:Sidenotes begin

Proposal: new parameter "anchor"
Proposal: Let us add a new optional parameter anchor, leading to the creation of &lt;a name="{ { anchor } } ">, similarly to. Let this parameter be added to all four templates for sidenotes.

Motivation: Such a parameter would come in handy in Ethics (Aristotle), where the sidenotes serve as identifiers of the location within the text, so referring to them using, say, "#1177a" makes sense. --Dan Polansky 13:39, 30 May 2008 (UTC)


 * Have you looked at number, which I created for a similar purpose? Or do you need something more complex?--T. Mazzei 00:53, 31 May 2008 (UTC)


 * Looking at Ethics (Aristotle), it looks like you should be able to use a combination of sidenotes begin, sidenotes begin, and number. Rather than using ...pages...  use sidenotes begin...pages...sidenotes end.  In the Page namespace, replace verse with number.  It won't look right in the Page namespace (the sidenote will overlap the main text), but it should look all right when the pages are transcluded into the main document (though I haven't tested it).--T. Mazzei 01:17, 31 May 2008 (UTC)


 * I see. Thanks. The seems suitable, just that I would prefer to have an option to have no brackets around the number, to align the appearance with the one of the original printed book of Aristotle's Ethics. Could you add an optional parameter to  that removes the brackets? --Dan Polansky 15:23, 6 June 2008 (UTC)


 * I have changed so that if you enter "nb" as the second parameter ( ex.  ), the brackets do not appear.--T. Mazzei 04:32, 12 June 2008 (UTC)


 * Thanks. --Dan Polansky 15:05, 13 June 2008 (UTC)

Use of SMALL tag, rather than text:SMALLER
At [] the use of the Left Sidenote with br tag within it puts big line space in the left margin text. Would the use of the text:smaller smaller be useful? Maybe I am just too fussy .

FWIW the use of Ems and directions doesn't clarify anything for me on screen. -- billinghurst (talk) 00:53, 1 January 2009 (UTC)

It would also be useful to have a center capability within the Left Sidenote. -- billinghurst (talk) 01:30, 1 January 2009 (UTC)


 * Regarding the big space between lines: this is because the template currently uses small text, but with the same line spacing as for normal size text. I will fix that and I will add parameters for text size and justification.
 * Many thanks, though I fear that I did not express my needs well enough. I had meant CENTER the text around its center point, NOT center the sidenote within the channel.


 * Also, when I apply the template in the main namespace, the LEFT and RIGHT sidenotes end up making the page a little unusual (back and forth) example -> Joseph Knight example. What would be REALLY useful is for their the ability from within the template setting (via namespace?) to apply a condition there that would force/override the sidenotes settings and place to a determined side, despite the setting used elsewhere/another namespace.


 * To explain ... when I am using within the PAGE: namespace, I have included the Sidenotes begin in the Header (noinclude): and Sidenotes end in the Footer (noinclude):.  Then when I apply in the main namespace, the templates enwrap the inserted pages.  This methodology then allows tweaking as per the set out --billinghurst (talk) 04:06, 3 January 2009 (UTC)


 * Regarding the spacing sidenotes begin takes two arguements, the first being the width of the main body (in ems), the second being the width needed for the notes. left sidenote and right sidenote takes two arguments the width of the text of the note, and the width of the space between the note and the main body.  The two arguements should (but don't have to) add up to the second argument for "sidenotes begin".
 * The defaults for sidenotes begin are "35 ems" and "11 ems" and the defaults for the left and right sidenotes are "10 em" and "1 em". This results in a page layout of :
 * [10 em for notes] [1 em space] [35 em main body] [1 em space] [10 em for notes]
 * If you want a wider space for notes and narrower space for the main body you could use which would result in:
 * [21 em total space for notes] [25 em main body] [21 em total space for notes]
 * You can then divy the total space for notes as you like with templates.  They can be different widths on either side, and they can be different widths on each call of a left or right sidenote (although the total space for notes always stays the same). for example the above and  and  would result in:
 * [20 em for notes] [1 em space] [25 em main body] [5 em space] [16 em for notes]
 * Clear?--T. Mazzei (talk) 05:20, 1 January 2009 (UTC)


 * I was more meaning that I don't do EMS on screens, I am more used to them on paper. I need to retrain myself. :-)   It was also remiss of me to not say thinks for a very nice template.  Very useful for a number of old books on which I am working.  (ab)


 * Thinking overarching. For the page from that book, there will be b/w 100 and 200 sidesnotes.  Rather than having to apply alignment text for each sidenote it would be useful to look to have more control and modify settings that apply throughout.  Thx. -- billinghurst (talk) 04:22, 3 January 2009 (UTC)


 * Thank you. It would be ideal to define all the settings in sidenotes begin that are to apply throughout, and what I originally envisioned.  However, I have no idea how to accomplish this (my web layout skills are limited to what I've picked up editing wikisource).  For a project with a large number of notes with "non-standard" settings, my only suggestion would be to create a separate sidenote left/right template specifically for that project, with the desired formatting.--T. Mazzei (talk) 19:19, 3 January 2009 (UTC)

Created Force sidenote
I had an issue where a book had left and right sidenotes, which was fine in the PAGE namespace, however, messy when these pages were transcluded to the main namespace. To alleviate this I have created a rustic overlay that utilises the underlying components of the Sidenotes family and keeps them as set in PAGE namespace, though forces them to the left when transcluded. I haven't set all the fine tuning parameters that were in the original as I tend to use the defaults. It is not to say, that it won't happen at sometime. Documentation is scant at the moment.
 *  has sidenote on left for PAGE and main namespace
 *  has sidenote on right for PAGE and on the left for main namespace

Anyway, it is there for opinion and trial. -- billinghurst (talk) 15:11, 2 May 2009 (UTC)
 * Why not force them right, to prevent conflicts with the page template? --Spangineerwp (háblame) 02:45, 12 May 2009 (UTC)
 * Just seemed more appropriate to set the books that I have been working upon to the left. Books like this I have been using with , so I hadn't noticed the interference with the page template. -- billinghurst (talk) 09:56, 14 May 2009 (UTC)
 * There should be an option in page to force the page numbers to the right. There are always going to be cases where it makes more sense for the note to be on the left (ex. that is the typical position for notes in legislation).  At the moment I can't think of an easy fix to allow both on the same side.--T. Mazzei (talk) 06:57, 18 May 2009 (UTC)
 * Probably easiest to ask for an option in page to have the label to the right, it shouldn't be too difficult at that level. Even with my rudimentary skills I could get something working for a variation in Template:Sandbox -- billinghurst (talk) 10:56, 18 May 2009 (UTC)

Relative width?
Is there a way to make this template use a relative width, preferably by specifying the width of the space for notes and allowing the main text body to fill the rest? I'm considering the possibility of using this series of templates to implement page numbers as in two-thirds of the way down Page:Nature and Character of our Federal Government.djvu/16. Hard coding the width when the notes should only take up a few ems seems like a poor way to handle this. --Spangineerwp (háblame) 02:54, 12 May 2009 (UTC)


 * I think what you want is float left--T. Mazzei (talk) 02:48, 14 May 2009 (UTC)


 * It would be, except that it doesn't really work. --Spangineerwp (háblame) 12:13, 14 May 2009 (UTC)


 * If you're talking about the float appearing on the line after the span tag, the Opera browser renders this correctly. Most other browsers render it on the proper line only if it is the first object in a new paragraph, otherwise it is rendered on the next line. For these browsers you can hack it to appear properly by playing around with a combination of negative margins/padding (of couse then it appears incorrectly on Opera).  There is no way to get this template to work as requested, as it uses absolute positioning rather than float positioning--the text will not flow around the note; the note must be outside the main body text.--T. Mazzei (talk) 02:38, 15 May 2009 (UTC)


 * I'm ok with that&mdash;I'm willing to sacrifice the text floating around the note in order to get it to appear on the proper line. I actually think it would look better if rendered outside the main text body anyway, like sidenotes or  page, assuming that the main text body could be set to take up most of the user's screen. --Spangineerwp (háblame) 12:18, 15 May 2009 (UTC)
 * I messed around with a modified version of this at Template:Sidenotes begin relative but didn't have much success. float left will have to do, and hopefully non-Opera browsers will get on board.  Still, the issue remains&mdash;is it really necessary to hard code the width of the body text?  There's a lot of white space on all the US statutes pages (for example) once the window size gets above 1000 pixels or so.  Setting the note width to a certain number and letting the body text fill the rest of the window would solve this, wouldn't it? --Spangineerwp (háblame) 21:55, 16 May 2009 (UTC)


 * The issue of hard-coding the body width is philosophical rather than technical. I happen to prefer a large amount of white space.  Also, it has been shown that there is an optimal line length beyond which reading becomes less comfortable / more difficult (ex in this study).  I believe this is what you want?

...that any two opinions could exist upon the subject; and yet the historical facts, upon which alone all parties must rely, although well authenticated and comparatively recent, have not been understood by all men alike. Our author was well aware of the importance of settling this question at the threshold of his work. Many of the powers which have been claimed for the federal government, by the political party to which he [ *10 ] *belongs, depend upon a denial of that separate existence, and separate sovereignty and independence, which the opposing party has uniformly claimed for the States. It is, therefore, highly important to the correct settlement of this controversy, that we should ascertain the precise political condition of the several colonies prior to the revolution. This will enable us to determine how far our author has done justice to his subject, ... --T. Mazzei (talk) 06:43, 18 May 2009 (UTC)

New approach

 * I have made a version in the Sidenotes begin/sandbox which has two changes:
 * It does not fix the width of the main column, so it will no longer overlap the image on all but the widest windows
 * It allows to turn one side of the sidenotes off with the parameter (can be left/right/both, and defaults to both).
 * The current sidenotes width parameter still works, but the current main col width parameter is ignored. The upshot of this is that this template should be a drop-in replacement. Users of the template can then choose to set  to left or right as needed to save space on the page (and allow the main column to expand).
 * A quick survey of the pages using sidenotes begin indicate that only 13 works (505 pages in total) even use the main text width parameter, mostly setting to 33 or 35 (the former I assume to try to avoid overlap and the latter I assume so that the sidenote col param can be accessed).
 * Thoughts? Inductiveload— talk/contribs  14:30, 8 June 2020 (UTC)
 * Docs are still todo, but it works like but for . Typical use would be in the header field of an Index: as , which is the same as   (the defaults), or   to swap the sidenotes margin around. And, yes, this only makes sense after your recent fix here. :) --Xover (talk) 17:32, 12 July 2020 (UTC)
 * neat! Looks like a decent way to reduce repetitive misery.
 * I do wonder if medium-term there is an even better way to do this by, say, imbuing the pages with a recto-verso property (perhaps via a class on a container) somehow. Probably needs better support from T226275 so we can define index-wise CSS which defines rules like . Inductiveload— talk/contribs   12:08, 13 July 2020 (UTC)
 * Ideally this should have support in MW/PP, yes; but it may be over-engineered for this alone, at least in light of the amount of resources we can expect allocated to that development and maintenance work. But we may conceivably be able to fake something more elegant (for the user; technically it'd be a hack) by having a visual control to set it (and insert a container template), by way of a Gadget. You set it manually on the first page, and then the gadget can look at the previous page and set the opposite by default for subsequent pages. Sidenotes, unlike running headers, should be possible to standardise sufficiently for this. And once we're using scripts, we can also let the script take care of choosing the correct left vs. right template to use in the page body. Some nice little affordances for the users all around.BTW, it may be worthwhile to check how many people actually use the parameters for this template that prevent us from just moving all the style into templatestyles, and what values they put there. I don't really imagine there's all that much usage, and less variation where it is used, so it may be possible to provide a few predefined classes and drop full customisability. If needed anywhere we could have separate fully-tweakable alternate templates ("at your own risk") for those cases that really need them. --Xover (talk) 12:56, 13 July 2020 (UTC)
 * something like User:Inductiveload/Running header.js?
 * In terms of choosing the correct left/right sidenote template, you could imagine a generic sidenote template + TemplateStyles CSS that can look at the container's  class and do something smart in the   case. That would cover nearly all
 * I don't think many pages use the sidenote column width (and many that do, use the default, 11em). We also need to untangle the mess resulting from  in MediaWiki:Gadget-Site.css, before moving forward, because that's setting sidenotes widths of 6em for some reason. I did a count of pages using params 1 & 2 before, there were 13 works and 550 pages. I removed from a handful of works which were using sidenotes in really weird ways, so I think it's about 7 works/530 pages ish now, nearly all of which can be removed.
 * Full tweakability is pretty pointless IMO, since this is only relevant at all in Page: namespace, after transclusion, control is yielded Dynamic Layouts (this template has zero effect in main NS). It'll be even more tractable once all the pages that set to something other than "11" are gone.
 * Regardless, I think the first thing to do is to replace as many instances of this template which use parameters 1 & 2 as possible, then move any relevant CSS out of MediaWiki: NS and into TemplateStyles. Then come back to more advanced idea. Otherwise, my brain will break while trying to make one huge leap! Inductiveload— talk/contribs  13:28, 13 July 2020 (UTC)
 * The User:Inductiveload/Running header.js approach was what I had in mind above, yes. Also agree on taking it step by step. I haven't really looked at this, I'm just trying to jot down loose thoughts as they occur. :) --Xover (talk) 13:42, 13 July 2020 (UTC)

Line height and alignment
Currently, line height and alignment does not work for left sidenote and right sidenote. I believe this can be resolved by setting the CSS  on the inner span of these templates.

If that is done, the alignment and line-height settings on the 15k+ usages of this template (fun freaky fact, these two templates have almost the exact same number of usages: 7730 vs 7731. Spooky.) will start working. This means sidenotes will take substantially less vertical space and we may see a reduction in "stacking" in the main namespace.

It also means that all left sidenote that don't set an alignment parameter will become right aligned, whereas they are currently left-aligned. We can either assume people wanted the right alignment (not a documented default, so I doubt most people know it's supposed to right-align) but were stymied by the template not working, or we can assume people have been formatting as if the template was supposed to be left-aligned, in which case we could change to default-left-if-not-specified. I think left-aligned is the more common format anyway (I can't find any right-aligned left-sidenotes in a quick survey of works, they're mostly left-aligned with a few centre-aligned), so perhaps do the latter and left-align by default? It's a trivial bot job to add align=right to any individual works that are right-aligned.

Thoughts? Inductiveload— talk/contribs  16:47, 8 June 2020 (UTC)

Controlling the margin width
I'm confused about how to actually control the width of the margin. Using e.g.  does shrink it, but then the actual sidenotes all get shifted left beyond the margin. Do I need to adjust something else for the notes to stay within the margin? Bloated Dummy (talk) 22:25, 17 August 2023 (UTC)