summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/upquote/upquote.sty
blob: 67b4703525aaf54e75f8715974eb43250c6376fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{upquote}[2003/08/11 v1.1 Covington's upright-quote
                          modification to verbatim and verb]

%% Copyright 2000 Michael A. Covington.
%% Copyright 2003 Michael A. Covington, Frank Mittelbach.
%%
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.2 or later is part of all distributions of LaTeX
%% version 1999/12/01 or later.
%%

% Problem: Computer Modern Typewriter is the best font for program listings,
%           *but* it prints ` ' as bent opening and closing single quotes.
%           Other fonts, and most programming languages, print ` as a grave
%           accent and ' upright; ' is used both to open and to close quoted
%           strings.

%           See also M. Covington, "Computer Languages in Type," Journal of
%           Scholarly Publishing 26.1:34-41 (1994).

% Solution: This package switches the typewriter font to Computer Modern
%           Typewriter (regardless of other fonts in use, so long as this
%           package is called afterward) and modifies the behavior of
%           verbatim, verbatim*, verb, and verb* to print ` ' the desired way.
%           It does not affect \tt, \texttt, etc.

% Author:   Michael A. Covington
%           Artificial Intelligence Center
%           The University of Georgia
%           http://www.ai.uga.edu/~mc
%
%           and
%
%           Covington Innovations (Consulting and Typesetting)
%           http://www.CovingtonInnovations.com

% The modification is done by adding instructions to \@noligs,
% which is called by verbatim and verb in order to turn the
% characters ` < > , ' - into active characters that merely
% print themselves rather than activating ligatures.
%
% What is added is code to redefine ` as grave and ' as upright single quote.
%

% Bug fix, 2000/12/11: previously, '0 (or ' and any digit) would print as a
% nonexistent character.  (The reason: \char13 or \char18 was combining with
% the digit to make \char130, etc.)  Fixed by adding curly brackets.



%% Rewritten by FMi 2003/06/19
%
%
% Use textcomp official chars so that change works in various
% encodings
%
% Extend \@noligs (this also works with the latest listings package
% that recognizes that the package was loaded)

\RequirePackage{textcomp}

\begingroup
\catcode`'=\active               
\catcode``=\active               
\g@addto@macro\@noligs
   {\let`\textasciigrave
    \let'\textquotesingle}
\endgroup


\endinput