Skip to content
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

Best markup for poetry regions (Markdown→Sile) #408

Closed
alerque opened this issue Nov 10, 2016 · 3 comments · Fixed by #1610
Closed

Best markup for poetry regions (Markdown→Sile) #408

alerque opened this issue Nov 10, 2016 · 3 comments · Fixed by #1610
Labels
question Ask for advice or investigate solutions

Comments

@alerque
Copy link
Member

alerque commented Nov 10, 2016

I'm touching up some odds and ends in the Pandoc SILE writer and am not sure the best solution for a format. Markdown supports blockquotes of course, but Pandoc's flavor also has a nestable style that forces hard line wrapping. Here's an except from the wild:

Tanrı’nın yürekleri katılıştırma işi sadece İsrailli olmayanlarla sınırlı
değildi. Aslında bu gerçek, tarihin bu döneminde İsrail’in yaşamında merkez bir
rol oynamaktadır. Romalılar 11:7–9’da Pavlus, İsrail’in aradığı kurtuluşa ve
doğruluğa ulaşmaktaki başarısızlığından bahsetmektedir:

> İsrail aradığına kavuşamadı, seçilmiş olanlar ise kavuştular. Geriye
> kalanlarınsa yürekleri nasırlaştırıldı. Yazılmış olduğu gibi:
>
> | “Tanrı onlara uyuşukluk ruhu verdi;
> | Bugüne dek görmeyen gözler, duymayan kulaklar verdi.”
>
> Davut da şöyle diyor:
>
> | “Sofraları onlara tuzak,
> | Kapan, tökez ve ceza olsun.
> | Gözleri kararsın, göremesinler.
> | Bellerini hep iki büklüm et!”

Her ne kadar Tanrı’nın buyruğunun, halkının görmesi, duyması ve imanla cevap
vermesi (Yeşaya 42:18) olmasına rağmen yine de, sadece kendisinin bildiği
nedenlerden ötürü bazı kişilerin buyruklarına uymaması için inatçılık ruhu
vermektedir.

That's a couple paragraphs with a blockquote in between. Inside the blockquote are four paragraphs, two normal and two specifically poetry formatted so the line breaks have to come across.

At the moment the way Pandoc's internal representation of this works is the blockquote section is a block level item but the line break thing is inline. Right now this comes out in SILE looking like this:

Tanrı’nın yürekleri katılıştırma işi sadece İsrailli olmayanlarla sınırlı
değildi. Aslında bu gerçek, tarihin bu döneminde İsrail’in yaşamında merkez bir
rol oynamaktadır. Romalılar 11:7–9’da Pavlus, İsrail’in aradığı kurtuluşa ve
doğruluğa ulaşmaktaki başarısızlığından bahsetmektedir:

\begin{quote}
İsrail aradığına kavuşamadı, seçilmiş olanlar ise kavuştular. Geriye
kalanlarınsa yürekleri nasırlaştırıldı. Yazılmış olduğu gibi:

“Tanrı onlara uyuşukluk ruhu verdi;\break
Bugüne dek görmeyen gözler, duymayan kulaklar verdi.”

 Davut da şöyle diyor:

“Sofraları onlara tuzak,\break
Kapan, tökez ve ceza olsun.\break
Gözleri kararsın, göremesinler.\break
Bellerini hep iki büklüm et!”
\end{quote}

Her ne kadar Tanrı’nın buyruğunun, halkının görmesi, duyması ve imanla cevap
vermesi (Yeşaya 42:18) olmasına rağmen yine de, sadece kendisinin bildiği
nedenlerden ötürü bazı kişilerin buyruklarına uymaması için inatçılık ruhu
vermektedir.

This would render alright if inside a ragged environment, but what happens when it is justified is not pretty:

selection_299

I can think of a couple options. One would be to output \hfill\break in this scenario. That's nice for most documents, but what if the document was typeset ragged left? Or center? That would mess everything up.

Of course everything is messed up anyway in those cases because it's possible to indent poetry lines like this:

| Line one
|     Line two
| Line three
|     Line four

This I'm outputting using \kern[width=1spc] for each space of indent. Which works, but again a centered document would get all wonky pretty fast.

Another option would be to wrap each line in some kind of function that could then be styled. Or I can try to hack on it to make this a block level format that wraps all the affected lines.

What would be the best scenario for this markup to end up looking like in a SILE document?

@alerque alerque added the question Ask for advice or investigate solutions label Nov 10, 2016
@simoncozens
Copy link
Member

Does the verbatim package give you any clues? I think in terms of markup your best possible situation would be to have a \begin{verse}...\end{verse} style of markup. I'll note in passing that Latex's verse environment requires help from the user to get centered verses right.

@Omikhleia
Copy link
Member

What would be the best scenario for this markup to end up looking like in a SILE document?

For the record, though it doesn't really answer the question, Pandoc-style "line blocks" (used here for poetry) are discussed in #416 - focusing on the "native/internal" markdown support for them.

This being said, I don't think the output should be using \break, \cr, \hfill etc. I concur with @simoncozens, the output should be some semantic markup, e.g.

::: {.poetry }
| Line one
| Line two
| 
| And so on
:::

... should yield something like:

\begin{poetry}
\v{Line one}
\v{Line two}
\stanza
\v{And so on}
\end{poetry}

And classes or packages would provide their necessary poetry environment. This is the approach I took in markdown.sile, where the markdown support package provides a default fallback layout, but it can be overridden to use another poetry package. E.g. with my own poetry support in resilient.sile, it could be rendered with appropriate stanza skips, verse numbering, &c.

image

Of course, it would be best, for such 3rd-party "poetry packages" to share some common SIL-level API (commands and options), so one could use one or the other... That ideal is perhaps hard to attain (when I look at the myriad of LaTeX packages for poetry, none have the same commands and options for even the simplest things...) Anyhow, deferring the actual rendering to a well-formed package is probably better than trying to hard-code low-level things with manual breaks, fills, etc.

Admittedly, my above-mentioned resilient.poetry environment wouldn't work well too with centered poetry (... just tested, ouch, it gets ugly...). That's however an issue with it (or I should use another better package!)... rather than with the underlying parsing and structuring methods.

I'd be glad if that provides some sort of answer to the 4-year old question that was raised here, so it might get closed eventually. But feel free to comment and discuss -- or even best, give a try to markdown.sile and resilient.poetry (patches welcome) 😆

@alerque
Copy link
Member Author

alerque commented Sep 12, 2023

c.f. #1866

@alerque alerque closed this as completed Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Ask for advice or investigate solutions
Projects
Development

Successfully merging a pull request may close this issue.

3 participants