[texworks] unwanted translation of ascii apostrophe in resulting pdf file

Lorne Dudley dudleyl at queensu.ca
Sun Feb 22 02:14:16 CET 2015

I have attached a simple test case and resulting files demonstrating the 

Software used is
python 2.7.9
TexWorks 0.4.5 r1280 (MiKTeX 2.9)

apostrophe.rst is the start point.

C:\Python27\Scripts> python rst2html.py apostrophe.rst apostrophe.html

apostrophe.html displays correctly.

C:\Python27\Scripts> python rst2latex.py apostrophe.rst apostrophe.tex
(note that apostrophe.tex still contains unmodified apostrophes)

open apostrophe.tex in TexWorks

Typeset pdfLaTex

apostrophe.pdf is produced

Notice that in the resulting apostrophe.pdf
     the second line apostrophe and the
     apostrophes within the php code block appear different, but

  In each case, if the resulting "apostrophe" is cut and pasted into an 
ascii based text editor, the result is
an ascii character with hex code 92 rather than the original ascii hex 
code 27 character.

This causes great problems for people who like to cut and paste code 
examples from a tutorial pdf document.

Is there anyway to configure TexWorks so that the correct ascii 27 code 
appears in the pdf document ???


Lorne Dudley
Kingston, Ontario

----- configuration info -----
TeXworks version : 0.4.5r1280 (MiKTeX 2.9)
Install location : C:/Program Files/MiKTeX 
Library path : C:/Users/RedFox/AppData/Local/MiKTeX/2.9/TeXworks/0.4\
pdfTeX location : C:/Program Files/MiKTeX 2.9/miktex/bin/pdftex.exe
Operating system : Windows Microsoft Windows 7 Home Premium Edition, 
32-bit Service Pack 1 (build 7601)
Qt4 version : 4.8.4 (build) / 4.8.4 (runtime)

-------------- next part --------------
TexWorks Apostrophe Alteration

Example of alteration of ' (apostrophe)

APOSTROPHE is hex code 27 in both ascii and utf-8.

.. code-block:: php

    // app/Model/User.php
    App::uses('AppModel', 'Model');

    class User extends AppModel {
        public $validate = array(
            'username' => array(
                'required' => array(
                    'rule' => array('notEmpty'),
                    'message' => 'A username is required'
            'password' => array(
                'required' => array(
                    'rule' => array('notEmpty'),
                    'message' => 'A password is required'
            'role' => array(
                'valid' => array(
                    'rule' => array('inList', array('admin', 'author')),
                    'message' => 'Please enter a valid role',
                    'allowEmpty' => false

End of apostrophe alteration example.

.. meta::
    :title lang=en: TexWorks Apostrophe Alteration
    :keywords lang=en: texworks,latex,apostrophe alteration
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texworks/attachments/20150221/650c9506/attachment-0001.html>
-------------- next part --------------
% generated by Docutils <http://docutils.sourceforge.net/>
\usepackage{fixltx2e} % LaTeX patches, \textsubscript
\usepackage{cmap} % fix search and cut-and-paste in Acrobat

%%% Custom LaTeX preamble
% PDF Standard Fonts
\usepackage{mathptmx} % Times

%%% User specified packages and stylesheets

%%% Fallback definitions for Docutils-specific commands
% basic code highlight:

% subtitle (in document title)
\providecommand*{\DUdocumentsubtitle}[1]{{\large #1}}

% inline markup (custom roles)
% \DUrole{#1}{#2} tries \DUrole#1{#2}
  \ifcsname DUrole#1\endcsname%
    \csname DUrole#1\endcsname{#2}%
  \else% backwards compatibility: try \docutilsrole#1{#2}
    \ifcsname docutilsrole#1\endcsname%
      \csname docutilsrole#1\endcsname{#2}%

% hyperlinks:
  \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
  pdftitle={TexWorks Apostrophe Alteration},

%%% Title Data
  TexWorks Apostrophe Alteration%
  \\ % subtitle%
  \DUdocumentsubtitle{Example of alteration of ' (apostrophe)}%

%%% Body

APOSTROPHE is hex code 27 in both ascii and utf-8.
\begin{quote}{\ttfamily \raggedright \noindent

\section{End of apostrophe alteration example.%

-------------- next part --------------
A non-text attachment was scrubbed...
Name: apostrophe.pdf
Type: application/pdf
Size: 43970 bytes
Desc: not available
URL: <http://tug.org/pipermail/texworks/attachments/20150221/650c9506/attachment-0001.pdf>

More information about the texworks mailing list