Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Braces that span lines #911

Closed
alerque opened this issue Jul 5, 2020 · 9 comments
Closed

Braces that span lines #911

alerque opened this issue Jul 5, 2020 · 9 comments
Labels
question Ask for advice or investigate solutions

Comments

@alerque
Copy link
Member

alerque commented Jul 5, 2020

Ran across this and it made me wonder: could we even pull this off if we wanted to? What changes would we have to make to get there?

pbs_twimg_com_media_Eb8i1caU8AA4

@rjmunro
Copy link
Contributor

rjmunro commented Jul 7, 2020

In Unicode, there's a bunch of symbols for making these:

             ⎧ Top
For example  ⎨ Middle
             ⎩ Botttom

Unfortunately, the way they are rendered here, they don't join up. They are listed on this page: https://unicode-search.net/unicode-namesearch.pl?term=BRACKET

I'm not sure if using them would be part of the solution for this.

@simoncozens
Copy link
Member

What are you reading?

Anyway, I would be tempted to render this as a three-column table, compute the height, and write out an SVG graphic to go in the middle column.

@alerque
Copy link
Member Author

alerque commented Jul 8, 2020

What are you reading?

OSINT Twitter.

Anyway, I would be tempted to render this as a three-column table, compute the height, and write out an SVG graphic to go in the middle column.

Are our tables robust enough for that yet? I remember giving up pretty quickly the last time I gave them a go. I'd be happy to know that's changed.

My initial thought was this would need some kind of grouping such as allowing vboxes to be assembled and pushed in a horizontal context. I also see we have a bunch of tangentially related issues waiting for something along those lines and they aren't very well cross referenced. I've never messed around with Github's "projects" before but it seems like it might be a way to organize this sort of thing.

@ctrlcctrlv
Copy link
Member

I managed to do this using the characters.

The biggest problem is that there's seemingly no way to center a table. You need to use a script, or eyeball it. (Remember kids: Never spend 6 minutes doing something by hand when you can spend 6 hours failing to automate it.)

Relevant portion:

\define[command=mathfourtd]{\td{\font[family=MathJax_Size4]{\process}}}
\script[src=simpletable]
\script{
-- From sile-project/sile documentation/macros.xml
-- I think probably us users aren't supposed to be using this yet lol
local simpletable = SILE.require("simpletable")
simpletable.init(SILE.documentState.documentClass, {
  tableTag = "table",
  trTag = "tr",
  tdTag = "td"
})
}
...
\begin{table}%
\tr{\font[size=18pt,weight=400]\mathfourtd{\glue[width=4.15cm]⎛}\td{\glue[width=2.3cm]\cjk{\rubyA[reading=BĒNG]{孟}\rubyA[reading=HOK]{福}\rubyA[reading=LÊ]{黎}} }\mathfourtd{⎞}}
\tr{\mathfourtd{\glue[width=4.15cm]\rebox[width=0pt]{⎜}\rebox[width=0pt]{\lower[height=5pt]{⎜}}\raise[height=5pt]{⎜}}\td{\font[size=18pt,weight=400]\cjk{\glue[width=0.3cm]フレッド・ブレンナン}}\mathfourtd{\rebox[width=0pt]{\lower[height=5pt]{⎟}}\raise[height=5pt]{⎟} }}
\font[family=Inconsolata]
\tr{\mathfourtd{\glue[width=4.15cm]⎝}\td{\font[size=18pt,weight=400]copypaste\font[family=Android Emoji]📧\font[family=Inconsolata]kittens.ph}\mathfourtd{⎠}}
\end{table}
\bigskip

@alerque alerque added the question Ask for advice or investigate solutions label Jul 16, 2020
@alerque alerque added this to To do in Math Aug 4, 2020
@Omikhleia
Copy link
Member

Omikhleia commented Mar 15, 2022

Do you mean...

image

EDIT - Hints: No "maths". No weird "math characters". No "table" (but close to it). No "SVG" (in the stricter sense). No manual "tweaking / eyeballing" (but automation).

@alerque
Copy link
Member Author

alerque commented Mar 16, 2022

@Amikhleia This is like "show and tell" without the "show" you tease.

@Omikhleia
Copy link
Member

No more teasing - with the modules from the above PR:

\parbox[valign=middle,width=20%lw]{\raggedright{\font[features=+smcp]{Civilian Central Wars}}}%
\hfill
\bracebox[bracewidth=0.8em]{\parbox[valign=middle,width=75%lw]{%
44. Spasm or Insensate War\par
43. Some Other Kinds of Controlled General War\par
42. Civilian Devastation Attack\par
41. Augmented Disarming Attack\par
40. Countervalue Salvo\par
39. Slow-Motion Countercity War\par
}}

@Omikhleia
Copy link
Member

So my full answer to the above question would now be:

For the general use case:

  • Use at least SILE 0.14.x
  • Install 3rd-party package: luarocks install --server=https://luarocks.org/dev ptable.sile
  • And then, in a document, use the code from my previous comment.

As an alternative for a table of contents (as said once earlier, kudos to @alerque for having brought such an example above to my eyes, I liked it some much that I used it in my own book made with SILE)

  • Use at least SILE 0.14.x
  • Install 3rd-party package: luarocks install --server=https://luarocks.org/dev fancytoc.sile (it will install the above too as a dependency)
  • And then, in a document, \fancytableofcontents (possibly with optional parameters, see the package doc.)

Is there anything from the question that would require this issue to remain opened?

@Omikhleia
Copy link
Member

Is there anything from the question that would require this issue to remain opened?

Nah, we like having plenty of open issues? :D

@sile-typesetter sile-typesetter locked and limited conversation to collaborators Mar 26, 2023
@Omikhleia Omikhleia converted this issue into discussion #1740 Mar 26, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Ask for advice or investigate solutions
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants