• No results found

upquote – upright-quote and grave-accent glyphs in verbatim∗

N/A
N/A
Protected

Academic year: 2021

Share "upquote – upright-quote and grave-accent glyphs in verbatim∗"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

upquote – upright-quote and grave-accent glyphs

in verbatim

Michael A. Covington

, Frank Mittelbach, Markus G. Kuhn

2012/04/19

Introduction

By default, the LATEX \verb macro and verbatim environment display ASCII

characters 27 and 60 as ’ and ‘, respectively, in line with how these two charac-ters are used to typeset opening and closing quotation marks elsewhere in TEX. However, the character-set standards define character 27 to represent a straight single quotation mark ' and character 60 as a grave accent `. This is what most modern fonts show, and what readers of software source code are now likely to expect [1, 2]. The curly quotation mark characters ‘ and ’ are instead associated with Unicode positions U+2018 and U+2019.

Usage

Add \usepackage{upquote} to the preamble (preferably after any packages that change fonts or font encoding), and the behaviour of the macros \verb and \verb* and the environments verbatim and verbatim* will change such that ASCII char-acters 27 and 60 appear as ' and ` rather than ’ and ‘. This does not affect \tt, \texttt, etc.

When the Computer Modern typewriter font cmtt in Knuth’s original OT1 encoding is used (i.e., \encodingdefault=OT1, \ttdefault=cmtt), then the two replacement glyphs are taken from that same font, where they are already available at positions 13 and 18. If any other font or font encoding is used, then the textcomp package is loaded and its \textquotesingle and \textasciigrave macros are used to typeset these characters.

This package loads textcomp.sty only if the use of a non-cmtt font or a non-OT1 font encoding was already evident at the point where upquote.sty was loaded. If such changes happen later, add \usepackage{textcomp} yourself.

This file describes version v1.3, last revised 2012/04/19.

Artificial Intelligence Center, The University of Georgia, http://www.ai.uga.edu/~mc/University of Cambridge, Computer Laboratory, http://www.cl.cam.ac.uk/~mgk25/

(2)

Appendix

Implementation

We check \encodingdefault and \ttdefault to see whether the glyphs that are already in cmtt as \char13 (') and \char18 (`) can be used, or whether textcomp has to be loaded to access such glyphs.

1\newcommand\upquote@cmtt{cmtt} 2\newcommand\upquote@OTone{OT1} 3\ifx\encodingdefault\upquote@OTone 4 \ifx\ttdefault\upquote@cmtt\else\RequirePackage{textcomp}\fi 5\else 6 \RequirePackage{textcomp} 7\fi

The \@noligs macro is called by \verb and \begin{verbatim} to turn the char-acters ‘ < > , ’ - into active charchar-acters that merely print themselves rather than activating ligatures.

This package merely adds code to \@noligs that changes the glyphs used for ‘ and ’. 8\begingroup 9\catcode‘’=\active 10\catcode‘‘=\active 11\g@addto@macro\@noligs 12 {\let’\textquotesingle 13 \let‘\textasciigrave 14 \ifx\encodingdefault\upquote@OTone 15 \ifx\ttdefault\upquote@cmtt 16 \def’{\char13 }% 17 \def‘{\char18 }% 18 \fi\fi} 19\endgroup

We check \encodingdefault and \ttdefault again at each invocation of \verb or \begin{verbatim}, such that users can change fonts and encodings within a document.

References

[1] M. Covington, Computer Languages in Type, Journal of Scholarly Publishing, 26.1:34–41, 1994.

[2] M. Kuhn, ASCII and Unicode quotation marks, 1999. http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html

Referenties

GERELATEERDE DOCUMENTEN

*[rf], gets greater support from WT : spub/spubs ' turn upside down ', spur ' make fly', spel ' augment', and a number of others in sp-, spy-, and spr- (there is no such member as

The term svarabhakti is familiar to Sanskrit scholars, and to students of Iingustics in general, as a means of accounting for a 'vowel fragment' or vowel glide,

The analysis is developed w ithin a formal model of utterance interpretation, Labelled Deductive Systems for Natural Language (LDSNL), proposed in Kempson, Meyer-Viol

Guerssel, in a paper in which he discusses variation between high vowels and glides in Berber, suggests that the distinction between glides and vowels is a

This work is protected against unauthorized copying under Title 17, United States C o d e M icroform Edition © ProQuest LLC.. ProQuest

If one accepts the sugges- tion that ḫphags is the past of phog, then the verb phog, ḫphags ‘strike’ is another case where the present with -o- does not coincide with g- (which

Unfortunately, her discussion of the Vedic reduplicated formations (perfect, present, intensive) is very superficial and even reveals poor knowledge of the relevant literature;

Hereby establish this Constitution of the Republic of Poland as the basic law for the State, based on respect for freedom and justice, cooperation between the public powers,