du
dudido
Posts: 24
Joined: Mon Dec 02, 2013 9:04 pm
Platform: Mac + Windows
Hi,

how do I create a linebreak within metadata?

I'm using the Affiliation key from MMD6 and export using the Memoir (Book) settings to Latex. I checked the MMD6 Documentation which claims:

You can have more than one line in this field --- use two extra spaces at the end of the line, and a newline character will be used in LaTeX.

(Taken from https://github.com/fletcher/MultiMarkdown/wiki/MultiMarkdown-Syntax-Guide#affiliation)

Scrivener doesn't seem to respect that, but I tried passing //, ////, and /n - all to no avail.
--
Thanks for the support.

Using Scrivener 3.1.5 on macOS 10.15.5

Online
AmberV
Posts: 24213
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:
Hmm, we in fact use a large multiline text field here specifically because that should be valid (and easy to do). You of course have to follow the syntax rules within that field, but I presume you’re doing so. I’ve attached a simple demonstration of a multiline metadata field in action. Here we are supplying a little CSS to the HTML output, using the “HTML Header” metadata field. The compiled result has the expected formatting.
Attachments
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

du
dudido
Posts: 24
Joined: Mon Dec 02, 2013 9:04 pm
Platform: Mac + Windows
Thank you for your reply and the example. If I export Multimarkdown->HTML your HTML-Header tag is present however line breaks have been removed, too. If I create an additional tag Affiliation in your example and set it to:

Code: Select all

test1  test2  test3

this yields the following results -
Multimarkdown -> Latex:
\def\affiliaton{test1 test2 test3}

Multimarkdown->HTML:
<meta name="affiliaton" content="test1 test2 test3"/>

If I understand the MMD6 manual correctly the outcome should be
\def\affiliaton{test1\\test2\\test3}
--
Thanks for the support.

Using Scrivener 3.1.5 on macOS 10.15.5

Online
AmberV
Posts: 24213
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:
That seems to be something you should report to the MMD discussion board in that case. I do not see what Scrivener would be doing here to alter this result, and indeed if I test MMD directly on the command-line I get the same result you indicated as unexpected behaviour:

Code: Select all

\$ mmd2texTitle: Test MetadataAffiliation: test1test2test3The End

Output:

Code: Select all

\def\mytitle{Test Metadata}\def\affiliation{test1 test2 test3}The End\end{document}
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

du
dudido
Posts: 24
Joined: Mon Dec 02, 2013 9:04 pm
Platform: Mac + Windows
Ah - I never considered it was an unexpected behaviour on the part of MMD and didn't get around to testing it on the command line. Yes I'll report the behaviour in that forum. Thanks for helping narrow it down!

Could you think of any work around? I tried

Code: Select all

'test1\\test2\\test3'{=latex}

which yielded

\def\affiliaton{'test1\textbackslash{}\textbackslash{}test2\textbackslash{}\textbackslash{}test3'\{=latex\}}

So even if the passing of two extra spaces does not work in MMD contrary to its manual, I don't see any way at all of passing a line break in the metadata to a Latex output.
--
Thanks for the support.

Using Scrivener 3.1.5 on macOS 10.15.5

Online
AmberV
Posts: 24213
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:
After having experimented with a few different approaches, it looks like the Markdown convention of adding a single backslash to the end of a line that is intended to be a hard line break is coded to be functional within the Metadata block—and thus visually provides a result that will be familiar to any shell scripter:

Code: Select all

Title: Test MetadataAffiliation: test1\test2\test3LaTeX Config: articleThe End

That typesets correctly in my testing, producing affiliations, one per line, below the author line in the title block. So it may be that what needs to be reported is that the MMD documentation needs to be updated.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

du
dudido
Posts: 24
Joined: Mon Dec 02, 2013 9:04 pm
Platform: Mac + Windows
Thank you for reasearching this further, I thought I had tried the slash, but clearly I must have not done so. I can confirm that your solution works for me too, and it also seems to be the standard way following this documentation here:

https://fletcher.github.io/MultiMarkdow ... lines.html

After our discussion I posted to the MMD forums here: