Template talk:Sidenotes begin

Latest comment: 8 months ago by Bloated Dummy in topic Controlling the margin width

Proposal: new parameter "anchor" edit

Proposal: Let us add a new optional parameter anchor, leading to the creation of <a name="{ { anchor } } ">, similarly to {{verse}}. 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)Reply

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)Reply
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 <div class=lefttext>...pages...</div> 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)Reply
I see. Thanks. The {{number}} 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 {{number}} that removes the brackets? --Dan Polansky 15:23, 6 June 2008 (UTC)Reply
I have changed {{number}} so that if you enter "nb" as the second parameter ( ex. {{number|123|nb}} ), the brackets do not appear.--T. Mazzei 04:32, 12 June 2008 (UTC)Reply
Thanks. --Dan Polansky 15:05, 13 June 2008 (UTC)Reply

Use of SMALL tag, rather than text:SMALLER edit

At [[1]] 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 <g>.

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

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

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)Reply
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 {{sidenotes begin|25|21}} 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 {{sidenotes left/right}} 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 {{sidenotes left|note|20|1}} and {{sidenotes right|note|16|5}} 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)Reply
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)Reply
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)Reply

Created {{Force sidenote}} edit

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.

  • {{force_sidenote|left|text text text}} has sidenote on left for PAGE and main namespace
  • {{force_sidenote|right|text text text}} has sidenote on right for PAGE and on the left for main namespace

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.

Anyway, it is there for opinion and trial. -- billinghurst (talk) 15:11, 2 May 2009 (UTC)Reply

Why not force them right, to prevent conflicts with the page template? --Spangineerwp (háblame) 02:45, 12 May 2009 (UTC)Reply
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 <div class=prose>, so I hadn't noticed the interference with the page template. -- billinghurst (talk) 09:56, 14 May 2009 (UTC)Reply
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)Reply
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)Reply

Relative width? edit

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)Reply

I think what you want is {{float left}}--T. Mazzei (talk) 02:48, 14 May 2009 (UTC)Reply
It would be, except that it doesn't really work. --Spangineerwp (háblame) 12:13, 14 May 2009 (UTC)Reply
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)Reply
I'm ok with that—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)Reply
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—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)Reply
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)Reply

New approach edit

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 side parameter (can be left/right/both, and defaults to both).
The current sidenotes width parameter (2) 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 side 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? Inductiveloadtalk/contribs 14:30, 8 June 2020 (UTC)Reply
@Inductiveload: {{rvsn}} Docs are still todo, but it works like {{rvh}} but for {{sidenotes begin}}. Typical use would be in the header field of an Index: as {{rvsn|{{{pagenum}}}}}, which is the same as {{rvsn|{{{pagenum}}}|right|left}} (the defaults), or {{rvsn|{{{pagenum}}}|left|right}} 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)Reply
@Xover: 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 phab:T226275 so we can define index-wise CSS which defines rules like .pp-recto ._sidenote_container { padding-left: 7em; }. Inductiveloadtalk/contribs 12:08, 13 July 2020 (UTC)Reply
@Inductiveload: 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)Reply
@Xover: 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 _sidenotes_left/right/both class and do something smart in the left/right 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 body.ns-104 .sidenoteLeft 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 2 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! Inductiveloadtalk/contribs 13:28, 13 July 2020 (UTC)Reply
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)Reply

Line height and alignment edit

Currently, line height and alignment does not work for {{left sidenote}} and {{right sidenote}}. I believe this can be resolved by setting the CSS display:inline-block; 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? Inductiveloadtalk/contribs 16:47, 8 June 2020 (UTC)Reply

Controlling the margin width edit

I'm confused about how to actually control the width of the margin. Using e.g. {{Sidenotes begin||6}} 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)Reply