Template talk:Brace2

From Wikisource
Jump to navigation Jump to search

That module could be used instead of {{loop}} :
{{loop|{{#if:{{{1|}}}|{{#expr: {{{1}}}-1 }}|0}}|\quad}} could be replaced by
{{#invoke:String|rep|\quad|{{{1|}}}}}, but you have to endure that there ends up being a space between \overbrace{ and the {{#invoke:String}} code, or you get a parsing error. —Jerome Charles Potts (talk) 18:58, 1 May 2020 (UTC)[reply]

Bug, or feature ? & "padright" magic word[edit]

  • {{brace2|1|u}} gives
  • {{brace2|2|u}} gives
  • {{brace2|3|u}} gives
  • {{brace2|4|u}} gives

because these do

{{#tag:math|\scriptstyle{\overbrace{ {{#invoke:String|rep|\quad|{{#expr: {{{1|1}}}-1 }}}} } } }}

Asking 1 or 2 makes no difference; is this on purpose ?


Using the {{padright:}} magic word instead of calling the String module :

{{padright:|{{#expr: 5 * {{{1|1}}} }}|\quad}}

we get

(and it's probably cheaper).


For the vertical braces, it works like this:

{{padright:|{{#expr: 2 * {{{1|1}}} }}|\\}}

Jerome Charles Potts (talk) 07:41, 12 February 2023 (UTC)[reply]