[plt-scheme] string delimiters in SLaTeX

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Jun 5 14:23:14 EDT 2007

On Jun 5, 2007, at 1:23 PM, Prabhakar Ragde wrote:

> Matthias Felleisen wrote:
>> I pdf-ed your expression and it looks perfectly fine "This is a  
>> test" comes out as a string value, with the proper Scheme-style  
>> quote chars. Keep in mind that `` is a TeX convention for English  
>> type setting strings but is interpreted as two Scheme quote things  
>> in this case.
>>  I don't see any color whatsoever. Are you saying that you also  
>> ran something like tex2page over it? -- Matthias
> Here is a minimal document which demonstrates the problem. If I run  
> pdf-slatex on this, I get funny colours in the first sentence, and  
> close double quotes on both sides of the second sentence. --PR

Ah colors.

The behavior that you see is entirely correct. As I said, the `` in  
the first case are interpreted as two occurrences of 'backquote'. In  
particular, this means that with is outside of its scope and the rest  
is dealt with as plain Scheme.

The second one is exactly what you'd get in Scheme code. Perhaps it's  
confusing to use keyboard quotes for code in a document, especially  
because the Latex books has such a long passage on quote marks. But  
it is correct.

-- Matthias

> \documentclass{article}
> \usepackage[pdftex,usenames,dvipsnames]{color}
> \usepackage{slatex}
> \def\keywordfont#1{\textcolor{red}{#1}}
> \def\variablefont#1{\textcolor{blue}{#1}}
> \def\constantfont#1{\textcolor{Black}{#1}}
> \def\schemecodehook{\color{Violet}}
> \begin{document}
> \scheme|``Test with TeX quotes''|
> \scheme|"Test with hard quotes"|
> \end{document}

Posted on the users mailing list.