public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Apostrophes not coming out curly in ConTeXt output
@ 2012-03-19  0:06 John Magolske
       [not found] ` <20120319000610.GA22702-fRz41mDJ4SjwXfRSRkZCw3nhMCiq3JZZ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: John Magolske @ 2012-03-19  0:06 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

When using Pandoc (1.9.1.2) to generate ConTeXt, apostrophes are not
coming out "curly" when using the --smart option. When generating HTML
this is not a problem, but for ConTeXt, even a unicode U2019 character
input to the source gets converted back to a U0027 straight apostrophe
in the output:

    % cat test-1.md
    Why don't the apostrophe’s show up as "curly"?
    The 'single quotes' and "double quotes" are fine...

    % pandoc --smart -s -f markdown -t context test-1.md -o test-1.tex
    % pandoc --smart -s -f markdown -t html test-1.md -o test-1.html

Relevant section of the test-1.tex output:
    Why don't the apostrophe's show up as \quotation{curly}? The
    \quote{single quotes} and \quotation{double quotes} are fine\ldots{}

In test-1.html, U0027 gets converted to U2019, and the U2019 is passed
through:
    <p>Why don’t the apostrophe’s show up as “curly”?
    The ‘single quotes’ and “double quotes” are fine…</p>

Thanks for any help sorting this out.

John

-- 
John Magolske
http://B79.net/contact

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to pandoc-discuss+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pandoc-discuss?hl=en.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Apostrophes not coming out curly in ConTeXt output
       [not found] ` <20120319000610.GA22702-fRz41mDJ4SjwXfRSRkZCw3nhMCiq3JZZ@public.gmane.org>
@ 2012-03-19  5:20   ` John MacFarlane
       [not found]     ` <20120319052000.GB32250-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2012-03-19  5:20 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

+++ John Magolske [Mar 18 12 17:06 ]:
> When using Pandoc (1.9.1.2) to generate ConTeXt, apostrophes are not
> coming out "curly" when using the --smart option. When generating HTML
> this is not a problem, but for ConTeXt, even a unicode U2019 character
> input to the source gets converted back to a U0027 straight apostrophe
> in the output:

Yes, it is parsed as a Str "\x2019" and then escaped by the
ConTeXt writer as "'".

If enough ConTeXt people tell me that this escaping is undesirable,
I could change it.  However, see below:

>     % cat test-1.md
>     Why don't the apostrophe’s show up as "curly"?
>     The 'single quotes' and "double quotes" are fine...
> 
>     % pandoc --smart -s -f markdown -t context test-1.md -o test-1.tex
>     % pandoc --smart -s -f markdown -t html test-1.md -o test-1.html
> 
> Relevant section of the test-1.tex output:
>     Why don't the apostrophe's show up as \quotation{curly}? The
>     \quote{single quotes} and \quotation{double quotes} are fine\ldots{}
> 
> In test-1.html, U0027 gets converted to U2019, and the U2019 is passed
> through:
>     <p>Why don’t the apostrophe’s show up as “curly”?
>     The ‘single quotes’ and “double quotes” are fine…</p>
> 
> Thanks for any help sorting this out.

I'm no ConTeXt expert, but I just did a little experiment, and
context seemed to interpret the apostrophe the same way as
latex does -- turning it into a curly apostrophe.

Does it show up straight when you generate a PDF from your
source using context?

If so, we may need to see what your context preamble looks like
(assuming you're not using the default pandoc template).  I think
that with fontspec you can disable interpretation of latex
ligatures.  Maybe that's what you're doing?

John

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to pandoc-discuss+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pandoc-discuss?hl=en.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Apostrophes not coming out curly in ConTeXt output
       [not found]     ` <20120319052000.GB32250-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
@ 2012-03-19  5:45       ` John Magolske
       [not found]         ` <20120319054503.GI22366-fRz41mDJ4SjwXfRSRkZCw3nhMCiq3JZZ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: John Magolske @ 2012-03-19  5:45 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

* John MacFarlane <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> [120318 22:24]:
> I'm no ConTeXt expert, but I just did a little experiment, and
> context seemed to interpret the apostrophe the same way as
> latex does -- turning it into a curly apostrophe.
> 
> Does it show up straight when you generate a PDF from your
> source using context?

The apostrophe is turning up straight in the PDF output by ConTeXt.
The only way I can get a curly apostrophe is to edit the *.tex file
and manually change the U0027 characters to curly U2019's.

> If so, we may need to see what your context preamble looks like
> (assuming you're not using the default pandoc template).  I think
> that with fontspec you can disable interpretation of latex
> ligatures.  Maybe that's what you're doing?

I did change a few things in the pandoc template, but I can't make out
if any of that would be affecting this apostrophe issue. Here's the
full test-1.tex file:

\startmode[*mkii]
  \enableregime[utf-8]
  \setupcolors[state=start]
\stopmode

\usetypescriptfile[type-lemonde]
\usetypescript[lemond-1]
\setupbodyfont[LeMonde,11pt]

%\setupalign[nothyphenated]
\setupalign[nothyphenated,right,broad]

% Enable hyperlinks
\setupinteraction[state=start, color=middleblue]

\setuppapersize [letter][letter]
\setuplayout    [width=middle,  backspace=0.85in, cutspace=0.75in,
                 height=middle, topspace=0.0in, bottomspace=0.15in]

%\setuppagenumbering[location={footer,center}]
\setuppagenumbering[location=]

\setupbodyfont[11pt]

\setupwhitespace[medium]

\setuphead[chapter]      [style=\tfd]
\setuphead[section]      [style=\tfc]
\setuphead[subsection]   [style=\tfb]
\setuphead[subsubsection][style=\bf]

\setuphead[chapter, section, subsection, subsubsection][number=no]

\definedescription
  [description]
  [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm]

\setupitemize[autointro]    % prevent orphan list intro
\setupitemize[indentnext=no]

\setupthinrules[width=15em] % width of horizontal rules

\setupdelimitedtext
  [blockquote]
  [before={\blank[medium]},
   after={\blank[medium]},
   indentnext=no,
  ]

\starttext

Why don't the apostrophe's show up as \quotation{curly}? The
\quote{single quotes} and \quotation{double quotes} are fine\ldots{}

\stoptext


-- 
John Magolske
http://B79.net/contact


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Apostrophes not coming out curly in ConTeXt output
       [not found]         ` <20120319054503.GI22366-fRz41mDJ4SjwXfRSRkZCw3nhMCiq3JZZ@public.gmane.org>
@ 2012-03-19  6:21           ` Aditya Mahajan
       [not found]             ` <alpine.LNX.2.02.1203190214190.12340-c5hX+hAU7icM2ZW16uGe0b0CBTrrRgWUYd+qtm0fIG0@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2012-03-19  6:21 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On Sun, 18 Mar 2012, John Magolske wrote:

> * John MacFarlane <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> [120318 22:24]:
>> I'm no ConTeXt expert, but I just did a little experiment, and
>> context seemed to interpret the apostrophe the same way as
>> latex does -- turning it into a curly apostrophe.
>>
>> Does it show up straight when you generate a PDF from your
>> source using context?
>
> The apostrophe is turning up straight in the PDF output by ConTeXt.
> The only way I can get a curly apostrophe is to edit the *.tex file
> and manually change the U0027 characters to curly U2019's.

I am assuming that you are using MkIV and not MkII.

By default, the translation of 0x0027 to 0x2019 is controlled by a font 
feature `tlig`. `tlig` is enabled in the default font features, so either 
something is wrong with your font (unlikely, as in that case 0x2019 will 
also not work) or your typesscripts.

In your example below, if I comment out your typescripts then I get curly 
apostrophe. This means that you are missing something in your typescripts.

>> If so, we may need to see what your context preamble looks like
>> (assuming you're not using the default pandoc template).  I think
>> that with fontspec you can disable interpretation of latex
>> ligatures.  Maybe that's what you're doing?
>
> I did change a few things in the pandoc template, but I can't make out
> if any of that would be affecting this apostrophe issue. Here's the
> full test-1.tex file:
>
> \usetypescriptfile[type-lemonde]
> \usetypescript[lemond-1]
> \setupbodyfont[LeMonde,11pt]

As I said, most likely something is missing in your typescript files. 
However, if you are using MkIV, the simplest way to use system fonts is to 
use the simplefonts module:

\usemodule[simplefonts][size=11pt]
\setmainfont[LeMonde]

This should give you the right apostrophe.

Aditya


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Apostrophes not coming out curly in ConTeXt output
       [not found]             ` <alpine.LNX.2.02.1203190214190.12340-c5hX+hAU7icM2ZW16uGe0b0CBTrrRgWUYd+qtm0fIG0@public.gmane.org>
@ 2012-03-22  6:28               ` John Magolske
  0 siblings, 0 replies; 5+ messages in thread
From: John Magolske @ 2012-03-22  6:28 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Thanks for the quick & informative reply.

* Aditya Mahajan <adityam-63aXycvo3TyHXe+LvDLADg@public.gmane.org> [120318 23:23]:
> In your example below, if I comment out your typescripts then I get
> curly apostrophe. This means that you are missing something in your
> typescripts. [...] if you are using MkIV, the simplest way to use
> system fonts is to use the simplefonts module:
> 
> \usemodule[simplefonts][size=11pt] setmainfont[LeMonde]
>
> This should give you the right apostrophe.

I am using MkIV, but for some reason ConTeXt hangs when I try using
the simplefonts approach. I'll investigate this further at some point,
but for now I'd like to get my typescripts working. Heading over to
the ConTeXt list now to get some advice there.

Regards,

John

-- 
John Magolske
http://B79.net/contact


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-22  6:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-19  0:06 Apostrophes not coming out curly in ConTeXt output John Magolske
     [not found] ` <20120319000610.GA22702-fRz41mDJ4SjwXfRSRkZCw3nhMCiq3JZZ@public.gmane.org>
2012-03-19  5:20   ` John MacFarlane
     [not found]     ` <20120319052000.GB32250-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
2012-03-19  5:45       ` John Magolske
     [not found]         ` <20120319054503.GI22366-fRz41mDJ4SjwXfRSRkZCw3nhMCiq3JZZ@public.gmane.org>
2012-03-19  6:21           ` Aditya Mahajan
     [not found]             ` <alpine.LNX.2.02.1203190214190.12340-c5hX+hAU7icM2ZW16uGe0b0CBTrrRgWUYd+qtm0fIG0@public.gmane.org>
2012-03-22  6:28               ` John Magolske

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).