* How do I get an empty line in a \framed[align=flushleft]{} item? @ 2020-04-30 20:47 Gerben Wierda 2020-04-30 20:51 ` Henning Hraban Ramm 2020-04-30 20:54 ` Wolfgang Schuster 0 siblings, 2 replies; 12+ messages in thread From: Gerben Wierda @ 2020-04-30 20:47 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 285 bytes --] In normal TeX, when I type Aap\\\\Aap I get something like Aap Aap But inside a \framed[align=]{} the empty line disappears. How do I get it back? Minimal example: \starttext Testing\\\\Testing \page \framed[align=flushleft]{Testing\\\\Testing} \stoptext [-- Attachment #1.2: Type: text/html, Size: 1955 bytes --] [-- Attachment #2: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-04-30 20:47 How do I get an empty line in a \framed[align=flushleft]{} item? Gerben Wierda @ 2020-04-30 20:51 ` Henning Hraban Ramm 2020-04-30 23:07 ` Gerben Wierda 2020-04-30 20:54 ` Wolfgang Schuster 1 sibling, 1 reply; 12+ messages in thread From: Henning Hraban Ramm @ 2020-04-30 20:51 UTC (permalink / raw) To: mailing list for ConTeXt users > Am 30.04.2020 um 22:47 schrieb Gerben Wierda <gerben.wierda@rna.nl>: > > In normal TeX, when I type > > Aap\\\\Aap > > I get something like > > Aap > > Aap > > But inside a \framed[align=]{} the empty line disappears. How do I get it back? Try \framedtext instead; multi line text needs a \vbox, and \framedtext does that. (If I understood correctly.) Maybe you need to set the align option. Best, Hraban ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-04-30 20:51 ` Henning Hraban Ramm @ 2020-04-30 23:07 ` Gerben Wierda 0 siblings, 0 replies; 12+ messages in thread From: Gerben Wierda @ 2020-04-30 23:07 UTC (permalink / raw) To: mailing list for ConTeXt users > On 30 Apr 2020, at 22:51, Henning Hraban Ramm <texml@fiee.net> wrote: > > > >> Am 30.04.2020 um 22:47 schrieb Gerben Wierda <gerben.wierda@rna.nl>: >> >> In normal TeX, when I type >> >> Aap\\\\Aap >> >> I get something like >> >> Aap >> >> Aap >> >> But inside a \framed[align=]{} the empty line disappears. How do I get it back? > > Try \framedtext instead; multi line text needs a \vbox, and \framedtext does that. (If I understood correctly.) > > Maybe you need to set the align option. I did set the align option to get a vbox. G > > Best, Hraban > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-04-30 20:47 How do I get an empty line in a \framed[align=flushleft]{} item? Gerben Wierda 2020-04-30 20:51 ` Henning Hraban Ramm @ 2020-04-30 20:54 ` Wolfgang Schuster 2020-04-30 21:26 ` Gerben Wierda 2020-04-30 23:44 ` Gerben Wierda 1 sibling, 2 replies; 12+ messages in thread From: Wolfgang Schuster @ 2020-04-30 20:54 UTC (permalink / raw) To: mailing list for ConTeXt users, Gerben Wierda Gerben Wierda schrieb am 30.04.2020 um 22:47: > In normal TeX, when I type > > Aap\\\\Aap > > I get something like > > Aap > > Aap > > But inside a \framed[align=]{} the empty line disappears. How do I get > it back? > > Minimal example: > > \starttext > > Testing\\\\Testing > \page > > \framed[align=flushleft]{Testing\\\\Testing} > \stoptext Use \blank Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-04-30 20:54 ` Wolfgang Schuster @ 2020-04-30 21:26 ` Gerben Wierda 2020-04-30 23:44 ` Gerben Wierda 1 sibling, 0 replies; 12+ messages in thread From: Gerben Wierda @ 2020-04-30 21:26 UTC (permalink / raw) To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users Brilliant! Thank you! > On 30 Apr 2020, at 22:54, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote: > > Gerben Wierda schrieb am 30.04.2020 um 22:47: >> In normal TeX, when I type >> Aap\\\\Aap >> I get something like >> Aap >> Aap >> But inside a \framed[align=]{} the empty line disappears. How do I get it back? >> Minimal example: >> \starttext >> Testing\\\\Testing >> \page >> \framed[align=flushleft]{Testing\\\\Testing} >> \stoptext > > Use \blank > > Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-04-30 20:54 ` Wolfgang Schuster 2020-04-30 21:26 ` Gerben Wierda @ 2020-04-30 23:44 ` Gerben Wierda 2020-05-01 7:38 ` Hans Hagen 1 sibling, 1 reply; 12+ messages in thread From: Gerben Wierda @ 2020-04-30 23:44 UTC (permalink / raw) To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 2081 bytes --] > On 30 Apr 2020, at 22:54, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote: > > Gerben Wierda schrieb am 30.04.2020 um 22:47: >> In normal TeX, when I type >> Aap\\\\Aap >> I get something like >> Aap >> Aap >> But inside a \framed[align=]{} the empty line disappears. How do I get it back? >> Minimal example: >> \starttext >> Testing\\\\Testing >> \page >> \framed[align=flushleft]{Testing\\\\Testing} >> \stoptext > > Use \blank Too happy too soon. And I recall I ran into this earlier a while ago in another setting ago. But I thought of a solution. Background: I am automatically converting input from an XML file to METAPOST/ConTeXt. The input may contain one or more newlines.The text must end up in \framed[align=??, width=??] to be typeset. I use lua to convert and make it safe to pass to METAPOST as a string argument that METAPOST can pass on to textext(), using the following function: function doubleQuotableEscapedConTeXtString( str) local rep = lpeg.replacer { { '\n', '\\blank ' }, { '{', '{\\textbraceleft}' }, { '}', '{\\textbraceright}' }, { '#', '{\\texthash}' }, { '$', '{\\textdollar}' }, { '&', '{\\textampersand}' }, { '%', '{\\textpercent}' }, { '\\','{\\textbackslash}' }, { '|', '{\\textbar}' }, { '_', '{\\textunderscore}' }, { '~', '{\\textasciitilde}' }, { '^', '{\\textasciicircum}' }, { '"', "\"&ditto&\"" }, } return rep:match(str) end Where it now says \\blank, it used to say \\\\. Problem \\\\ gets me what I want if there is one \n (it turns into one new line), but with two \n in succession it still gets me only a single ’newline' \\blank gets me what I want if there are multiple newlines, but gets me an extra empty line when I only want ’next line’ and multiple \blanks do not work But I found the solution by using \strut\\ instead of \blank. In the above table: { ‘\n', ‘\\strut\\\\' }, This fools ConTeXt in thinking there actually is something on that line and so multiple \\ will work. G [-- Attachment #1.2: Type: text/html, Size: 5006 bytes --] [-- Attachment #2: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-04-30 23:44 ` Gerben Wierda @ 2020-05-01 7:38 ` Hans Hagen 2020-05-01 8:21 ` Gerben Wierda 0 siblings, 1 reply; 12+ messages in thread From: Hans Hagen @ 2020-05-01 7:38 UTC (permalink / raw) To: mailing list for ConTeXt users, Gerben Wierda, Wolfgang Schuster On 5/1/2020 1:44 AM, Gerben Wierda wrote: > { ‘\n', ‘\\strut\\\\' }, often a \zwj or \zwno also works ok (has zero dimensions, contraty to strut; you could also try \crlf Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-05-01 7:38 ` Hans Hagen @ 2020-05-01 8:21 ` Gerben Wierda 2020-05-01 11:28 ` Hans Hagen 0 siblings, 1 reply; 12+ messages in thread From: Gerben Wierda @ 2020-05-01 8:21 UTC (permalink / raw) To: Hans Hagen; +Cc: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1892 bytes --] > On 1 May 2020, at 09:38, Hans Hagen <j.hagen@xs4all.nl> wrote: > > On 5/1/2020 1:44 AM, Gerben Wierda wrote: >> { ‘\n', ‘\\strut\\\\' }, > often a \zwj or \zwno also works ok (has zero dimensions, contraty to strut; you could also try \crlf I tried \crlf{} and that worked too (the “{}” because I do not know what comes after even if I think any whitespace is eaten and to influence any catcode trickery, just feels it is more robust than a space). Hans, an additional question about lmtx’s XML interface. As I want the TeX special characters to be able to be part of a label, I replace all of them. That works. But what if I would like a way to introduce TeX commands again by using some other UTF8 character, would there be a character that curvies the pass through lmtx, can be used in a lua table so that I can (in a preferred order) get unescaped characters passed that flow? E.g. code a \ as some weird UTF8 character in the XML file, and in that table I use local rep = lpeg.replacer { { '\n', '\\crlf{}' }, { '{', '{\\textbraceleft}' }, { '}', '{\\textbraceright}' }, { '#', '{\\texthash}' }, { '$', '{\\textdollar}' }, { '&', '{\\textampersand}' }, { '%', '{\\textpercent}' }, { '\\','{\\textbackslash}' }, { '|', '{\\textbar}' }, { '_', '{\\textunderscore}' }, { '~', '{\\textasciitilde}' }, { '^', '{\\textasciicircum}' }, { '"', "\"&ditto&\"" }, } code it back to a \ ? E.g. something like { ‘\U{XXX}', '\' }, > > Hans > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > ----------------------------------------------------------------- [-- Attachment #1.2: Type: text/html, Size: 4906 bytes --] [-- Attachment #2: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-05-01 8:21 ` Gerben Wierda @ 2020-05-01 11:28 ` Hans Hagen 2020-05-01 11:45 ` Gerben Wierda 0 siblings, 1 reply; 12+ messages in thread From: Hans Hagen @ 2020-05-01 11:28 UTC (permalink / raw) To: Gerben Wierda; +Cc: mailing list for ConTeXt users On 5/1/2020 10:21 AM, Gerben Wierda wrote: > code it back to a \ ? E.g. something like > > { ‘\U{XXX}', '\' }, \utfchar{100} \Uchar 100 ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-05-01 11:28 ` Hans Hagen @ 2020-05-01 11:45 ` Gerben Wierda 2020-05-01 11:58 ` Hans Hagen 2020-05-01 12:00 ` Hans Hagen 0 siblings, 2 replies; 12+ messages in thread From: Gerben Wierda @ 2020-05-01 11:45 UTC (permalink / raw) To: Hans Hagen; +Cc: mailing list for ConTeXt users > On 1 May 2020, at 13:28, Hans Hagen <j.hagen@xs4all.nl> wrote: > > On 5/1/2020 10:21 AM, Gerben Wierda wrote: >> code it back to a \ ? E.g. something like >> { ‘\U{XXX}', '\' }, > \utfchar{100} > \Uchar 100 Yes, but the question was: how do I code this in the XML and get it through my XML-lua-METAPOST-textext() path so that e.g.  or  in the XML end up as \ in my textext() string? E.g. a 
 in XML becomes a \n when lmtx XML handling has read the XML (so gets transformed on read). I’ve been thinking about the route 
 -> \r -> \ (so, misusing \r to code a TeX-\ in the XML, but that would probably not robust. The question is more: what is a good UTF8 character to use (the first 32 would be good candidates if they would work and end in the strings that xml.foo() of lmtx produces). G > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-05-01 11:45 ` Gerben Wierda @ 2020-05-01 11:58 ` Hans Hagen 2020-05-01 12:00 ` Hans Hagen 1 sibling, 0 replies; 12+ messages in thread From: Hans Hagen @ 2020-05-01 11:58 UTC (permalink / raw) To: Gerben Wierda; +Cc: mailing list for ConTeXt users [-- Attachment #1: Type: text/plain, Size: 1275 bytes --] On 5/1/2020 1:45 PM, Gerben Wierda wrote: > > >> On 1 May 2020, at 13:28, Hans Hagen <j.hagen@xs4all.nl> wrote: >> >> On 5/1/2020 10:21 AM, Gerben Wierda wrote: >>> code it back to a \ ? E.g. something like >>> { ‘\U{XXX}', '\' }, >> \utfchar{100} >> \Uchar 100 > > Yes, but the question was: how do I code this in the XML and get it through my XML-lua-METAPOST-textext() path so that e.g.  or  in the XML end up as \ in my textext() string? > > E.g. a 
 in XML becomes a \n when lmtx XML handling has read the XML (so gets transformed on read). I’ve been thinking about the route 
 -> \r -> \ (so, misusing \r to code a TeX-\ in the XML, but that would probably not robust. > > The question is more: what is a good UTF8 character to use (the first 32 would be good candidates if they would work and end in the strings that xml.foo() of lmtx produces). did you try the attached approach? (a recent lmtx) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- [-- Attachment #2: strings-001.tex --] [-- Type: application/octet-stream, Size: 675 bytes --] [-- Attachment #3: Type: text/plain, Size: 493 bytes --] ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How do I get an empty line in a \framed[align=flushleft]{} item? 2020-05-01 11:45 ` Gerben Wierda 2020-05-01 11:58 ` Hans Hagen @ 2020-05-01 12:00 ` Hans Hagen 1 sibling, 0 replies; 12+ messages in thread From: Hans Hagen @ 2020-05-01 12:00 UTC (permalink / raw) To: mailing list for ConTeXt users On 5/1/2020 1:45 PM, Gerben Wierda wrote: > > >> On 1 May 2020, at 13:28, Hans Hagen <j.hagen@xs4all.nl> wrote: >> >> On 5/1/2020 10:21 AM, Gerben Wierda wrote: >>> code it back to a \ ? E.g. something like >>> { ‘\U{XXX}', '\' }, >> \utfchar{100} >> \Uchar 100 > > Yes, but the question was: how do I code this in the XML and get it through my XML-lua-METAPOST-textext() path so that e.g.  or  in the XML end up as \ in my textext() string? > > E.g. a 
 in XML becomes a \n when lmtx XML handling has read the XML (so gets transformed on read). I’ve been thinking about the route 
 -> \r -> \ (so, misusing \r to code a TeX-\ in the XML, but that would probably not robust. > > The question is more: what is a good UTF8 character to use (the first 32 would be good candidates if they would work and end in the strings that xml.foo() of lmtx produces). you could try \xmltexentity{foo}{[overloaded foo]} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2020-05-01 12:00 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-04-30 20:47 How do I get an empty line in a \framed[align=flushleft]{} item? Gerben Wierda 2020-04-30 20:51 ` Henning Hraban Ramm 2020-04-30 23:07 ` Gerben Wierda 2020-04-30 20:54 ` Wolfgang Schuster 2020-04-30 21:26 ` Gerben Wierda 2020-04-30 23:44 ` Gerben Wierda 2020-05-01 7:38 ` Hans Hagen 2020-05-01 8:21 ` Gerben Wierda 2020-05-01 11:28 ` Hans Hagen 2020-05-01 11:45 ` Gerben Wierda 2020-05-01 11:58 ` Hans Hagen 2020-05-01 12:00 ` Hans Hagen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).