Quotation mark in drop caps
Hi list! I have a three-part question. First, when using \placeinitial, how would you detect whether the first character is a quotation mark, and, if so, override the setupinitial to use m=2? Second, when using m=2 to capture a quotation mark, how would you change the font size of only the quotation mark, leaving the font size for the remaining characters the same? Third, can this be accomplished using setupinitial alone? Such as: \setupinitial[ quotefont=\SmallerFont, quotecolour=\QuoteColour, ] A few typographic examples of what I'd like to accomplish: Re: https://i.ibb.co/7rJYBS6/initial-Matching-Quotes.gif Re: https://i.ibb.co/Hz8v5w4/atlantips-drop-caps-and-quotation-marks-10.png My understanding of what exists in ConTeXt: \starttext \startchapter % This detaches the quotation mark from the paragraph, which looks strange. \placeinitial "We held ConTeXt in high esteem." \stopchapter \startchapter % This looks great. \placeinitial \input knuth \stopchapter \startchapter % I'd like to eliminate this next line. \setupinitial[m=2] % The quotation mark is a drop cap, albeit too big. \placeinitial "We held ConTeXt in high esteem." \stopchapter \startchapter % I'd like to eliminate this next line. \setupinitial[m=1] % The setups are reinitialized, which in theory should not be needed. \placeinitial \input knuth \stopchapter \stoptext Here's how I'd like to typeset the document (using setupinitial alone): \setupinitial[ % When a quotation mark is detected, the given font is applied to it. quotefont=\SmallerFont, % Not necessary, but could be useful to other people? quotecolour=\QuoteColour, ] \starttext \startchapter % The quotation mark gets attached and applies the smaller font size. \placeinitial "We held ConTeXt in high esteem." \stopchapter \startchapter % Only captures the first letter, because no quotation mark is present. \placeinitial \input knuth \stopchapter \stoptext Is this possible? If so, how? Thank you!
From TeX.SE, the following solution works; however, it doesn't feel like the "ConTeXt way": % SOT \setuplocalboxes[leftmargin][ style=\bfd, color=darkred, distance=0pt, ] \unprotect \define\quoteinitial{% \futureexpandisap“\quoteinitial_true\quoteinitial_false% } \define\quoteinitial_true{% \localmargintext[leftmargin]{“}% \expandafter\placeinitial% \gobbleoneargument% } \let\quoteinitial_false\placeinitial \protect \starttext \quoteinitial “We held ConTeXt in high esteem.” \samplefile{bryson} \quoteinitial We held ConTeXt in high esteem. \samplefile{bryson} \stoptext %EOT Any suggestions for how to improve it? See also: https://tex.stackexchange.com/q/722275/2148 Thanks again!
On 7/10/2024 9:10 AM, Thangalin wrote:
From TeX.SE, the following solution works; however, it doesn't feel like the "ConTeXt way":
% SOT \setuplocalboxes[leftmargin][ style=\bfd, color=darkred, distance=0pt, ]
\unprotect \define\quoteinitial{% \futureexpandisap“\quoteinitial_true\quoteinitial_false% }
\define\quoteinitial_true{% \localmargintext[leftmargin]{“}% \expandafter\placeinitial% \gobbleoneargument% }
\let\quoteinitial_false\placeinitial \protect
\starttext \quoteinitial “We held ConTeXt in high esteem.” \samplefile{bryson}
\quoteinitial We held ConTeXt in high esteem. \samplefile{bryson} \stoptext %EOT
Any suggestions for how to improve it?
See also: https://tex.stackexchange.com/q/722275/2148 https://tex.stackexchange.com/q/722275/2148 \starttext
\setupbodyfont[dejavu,9pt] \defineinitial[two][m=1,method=auto] \setinitial[two] Knuth :\ignorespaces\input knuth \par \setinitial[two] \quotation {Knuth} :\ignorespaces\input knuth \par \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Thank you Hans. That's pretty close. Is there a way to make the opening quotation mark smaller? Ideally, control the font and colour? Cheers! On Wed, Jul 10, 2024 at 12:25 AM Hans Hagen via ntg-context < ntg-context@ntg.nl> wrote:
On 7/10/2024 9:10 AM, Thangalin wrote:
From TeX.SE, the following solution works; however, it doesn't feel like the "ConTeXt way":
% SOT \setuplocalboxes[leftmargin][ style=\bfd, color=darkred, distance=0pt, ]
\unprotect \define\quoteinitial{% \futureexpandisap“\quoteinitial_true\quoteinitial_false% }
\define\quoteinitial_true{% \localmargintext[leftmargin]{“}% \expandafter\placeinitial% \gobbleoneargument% }
\let\quoteinitial_false\placeinitial \protect
\starttext \quoteinitial “We held ConTeXt in high esteem.” \samplefile{bryson}
\quoteinitial We held ConTeXt in high esteem. \samplefile{bryson} \stoptext %EOT
Any suggestions for how to improve it?
See also: https://tex.stackexchange.com/q/722275/2148 https://tex.stackexchange.com/q/722275/2148 \starttext
\setupbodyfont[dejavu,9pt]
\defineinitial[two][m=1,method=auto]
\setinitial[two] Knuth :\ignorespaces\input knuth \par \setinitial[two] \quotation {Knuth} :\ignorespaces\input knuth \par
\stoptext
----------------------------------------------------------------- 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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
On 7/10/2024 10:56 AM, Thangalin wrote:
Thank you Hans.
That's pretty close. Is there a way to make the opening quotation mark smaller? Ideally, control the font and colour?
You can try this (patch): \protected\def\typo_initial_handle_indeed#1#2% {\dontleavehmode \begingroup \cdef\currentinitial{#1}% \setupcurrentinitial[#2]% \resetfontfeature % might be needed in more places \ifempty{\initialparameter\c!style}% \definedfont[\initialparameter\c!font]% \else \useinitialstyleparameter\c!style \fi \ifempty{\initialparameter\c!color}% \c_attr_color \attributeunsetvalue \c_attr_transparency\attributeunsetvalue \else \useinitialcolorparameter\c!color \fi ...... \starttext \setupbodyfont[dejavu,9pt] \defineinitial[two][m=1,method=auto] \setupquotation[symcolor=red] \setinitial[two] Knuth :\ignorespaces\input knuth \par \setinitial[two] \quotation {Knuth} :\ignorespaces\input knuth \par \stoptext
Cheers!
On Wed, Jul 10, 2024 at 12:25 AM Hans Hagen via ntg-context
mailto:ntg-context@ntg.nl> wrote: On 7/10/2024 9:10 AM, Thangalin wrote: > From TeX.SE, the following solution works; however, it doesn't feel > like the "ConTeXt way": > > % SOT > \setuplocalboxes[leftmargin][ > style=\bfd, > color=darkred, > distance=0pt, > ] > > \unprotect > \define\quoteinitial{% > \futureexpandisap“\quoteinitial_true\quoteinitial_false% > } > > \define\quoteinitial_true{% > \localmargintext[leftmargin]{“}% > \expandafter\placeinitial% > \gobbleoneargument% > } > > \let\quoteinitial_false\placeinitial > \protect > > \starttext > \quoteinitial “We held ConTeXt in high esteem.” \samplefile{bryson} > > \quoteinitial We held ConTeXt in high esteem. \samplefile{bryson} > \stoptext > %EOT > > Any suggestions for how to improve it? > > See also: https://tex.stackexchange.com/q/722275/2148 https://tex.stackexchange.com/q/722275/2148 > <https://tex.stackexchange.com/q/722275/2148 https://tex.stackexchange.com/q/722275/2148> \starttext
\setupbodyfont[dejavu,9pt]
\defineinitial[two][m=1,method=auto]
\setinitial[two] Knuth :\ignorespaces\input knuth \par \setinitial[two] \quotation {Knuth} :\ignorespaces\input knuth \par
\stoptext
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl http://www.pragma-ade.nl | www.pragma-pod.nl http://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 mailto:ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl https://www.pragma-ade.nl / https://context.aanhet.net https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net https://wiki.contextgarden.net ___________________________________________________________________________________
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Hi again, The output shows a closing red opening quotation mark, which is the opposite of what I'd like to achieve. Using \quotation won't work in my situation because the text mixes and matches numerous types of quotation marks and the user is writing in Markdown. Matching against “ would work for most cases; however, the quotation marks could include: " -- straight quote “ -- opening curly double quote ‘ -- opening curly single quote (or apostrophe) « -- opening double quote (French, Spanish, etc.) ‹ -- opening single quote 「 -- opening Japanese quote % SOT \protected\def\typo_initial_handle_indeed#1#2% {\dontleavehmode \begingroup \cdef\currentinitial{#1}% \setupcurrentinitial[#2]% \resetfontfeature % might be needed in more places \ifempty{\initialparameter\c!style}% \definedfont[\initialparameter\c!font]% \else \useinitialstyleparameter\c!style \fi \ifempty{\initialparameter\c!color}% \c_attr_color \attributeunsetvalue \c_attr_transparency\attributeunsetvalue \else \useinitialcolorparameter\c!color \fi} \starttext \setupbodyfont[dejavu,9pt] \defineinitial[two][m=1,method=auto] \setupquotation[symcolor=red] \setinitial[two] Knuth :\ignorespaces\input knuth \par \setinitial[two] \symbol[leftquotation]Knuth\symbol[rightquotation] :\ignorespaces\input knuth \par \stoptext % EOT This produces: https://i.ibb.co/P5hDLH5/opening-quote.png What I'm looking to produce is: https://i.ibb.co/6PPGxxY/opening-quote-small.png Using \quotation instead of \symbol[leftquotation] or “ produces a red closing quote: https://i.ibb.co/VY1wqZ1/closing-quote-red.png Any other ideas? Thank you!
On 11/07/2024 01:55, Thangalin wrote:
Any other ideas?
Yes, change/edit the text to avoid the quotation marks in the first place. e.g. There are always better/simpler ways to achieve the story to be told. Trace back to the underlying idea as why these drop capitals were invented in the first place. Most likely to visually separate blocs of mono colored bread text with the lead characters from the drawer below. These days there are (better) alternatives to solve the issue of separation text paragraphs. (avoiding a problem instead of trying to solve it afterwards) .F
Thanks vm!
Sadly, I have no way of telling the 4,000+ people who have downloaded my
Markdown editor how they ought to compose and typeset their prose.
I'll let Robert Bringhurst know, though, and ask him to change Rule 4.1.5
of his Elements of Typographic Style from "include the initial quotation
mark" to "rewrite your prose." ;-)
https://i.imgur.com/ne991lZ.jpeg
TX
On Wed, Jul 10, 2024 at 11:35 PM vm via ntg-context
On 11/07/2024 01:55, Thangalin wrote:
Any other ideas?
Yes, change/edit the text to avoid the quotation marks in the first place.
e.g. There are always better/simpler ways to achieve the story to be told. Trace back to the underlying idea as why these drop capitals were invented in the first place. Most likely to visually separate blocs of mono colored bread text with the lead characters from the drawer below. These days there are (better) alternatives to solve the issue of separation text paragraphs.
(avoiding a problem instead of trying to solve it afterwards)
.F
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
participants (3)
-
Hans Hagen
-
Thangalin
-
vm