<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Lorne,<br>
<br>
this is not really a TeXworks question as TeXworks is only the
front-end. Your problem lies with LaTeX itself, so you might be
better off asking this question, e.g., on the texhax mailing list.
Anyway, I was curious about this, so I searched the internet a
bit. Here's what I came up with.<br>
<br>
On 22.02.2015 02:14, Lorne Dudley wrote:<br>
</div>
<blockquote cite="mid:54E92D68.1090106@queensu.ca" type="cite">Notice
that in the resulting apostrophe.pdf
<br>
the second line apostrophe and the
<br>
apostrophes within the php code block appear different, but<br>
</blockquote>
<br>
They only appear different because they use different fonts. What
LaTeX apparently does is to try to make things typographically
correct (i.e., "look beautiful"). In particular, this means that it
alters all sorts of quotation marks and apostrophes. BTW, this
typically is language-dependent...<br>
<br>
<blockquote cite="mid:54E92D68.1090106@queensu.ca" type="cite">
Is there anyway to configure TexWorks so that the correct ascii 27
code appears in the pdf document ???
<br>
</blockquote>
<br>
Several way, apparently, all of which rely on the textcomp package
to produce the "correct" apostrophe.<br>
<br>
First of all, there is already a great package out there to produce
source code listings which is called listings (duh). It should be
possible to configure it to produce unaltered apostrophes (see
<a class="moz-txt-link-freetext" href="http://tex.stackexchange.com/a/50535">http://tex.stackexchange.com/a/50535</a>). However, this implies that
you can alter the way your tex file is generated (as it requires all
source code to be wrapped in \begin{lstlisting} ...
\end{lstlisting}).<br>
<br>
The second option is to replace all ' characters that should look
"normal" by {\textsinglequote}. Again, this requires altering the
way the tex file is produced (although probably much less than using
the listings package mentioned above).<br>
<br>
The third option (or rather: hack) is the following (after
<a class="moz-txt-link-freetext" href="http://en.wikibooks.org/wiki/LaTeX/Plain_TeX">http://en.wikibooks.org/wiki/LaTeX/Plain_TeX</a>):<br>
<meta name="qrichtext" content="1">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><!--StartFragment-->\usepackage{textcomp}</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">\catcode`'
= 13</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">\def'{\textquotesingle}</p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px;"><br>
It changes the way ' is interpreted by LaTeX. Beware that this
applies not only to the source code parts of your document, but to
all of your document. So you won't be able to produce
typographical quotation marks, for instance, and there may be
other side-effects as well.<br>
<!--EndFragment--></p>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style><br>
HTH<br>
Stefan<br>
</body>
</html>