I am writing course notes in LaTeX. In the part where I am describing model-fitting functions in R I want to use a ~ character inline. If I am displaying an example of R code in its own environment I use the alltt environment, which protects the ~ character. I have forgotten how to protect the ~ when I am writing something like The operator `~' is used to define a model formula in \R. The left hand side is evaluated as the response. The right hand side can consist of several \Emph{terms} with special meanings I welcome suggestions. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On 16 Jan 2001, Douglas Bates wrote:> I am writing course notes in LaTeX. In the part where I am describing > model-fitting functions in R I want to use a ~ character inline. If I > am displaying an example of R code in its own environment I use the > alltt environment, which protects the ~ character. I have forgotten > how to protect the ~ when I am writing something like > The operator `~' is used to define a model formula in \R. > The left hand side is evaluated as the response. The right hand > side can consist of several \Emph{terms} with special meanings > > I welcome suggestions.There is no really good simple idea. $sim$ is not too bad, \verb|~| will give a raised tilde in most TeX fonts: you can also use \textasciitilde (as used by Rdconv) in normal text. V&R (well, R) made a virtual monospaced font taking ~ from a IBM public version of Courier, scaled to fit, plus \def\~{{\tt\char'176}} which make \~ work as you might hope. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Use \verb"~" for example. See http://www.psych.upenn.edu/~baron/rpsych.tex for examples. The result is ... rpsych.pdf Jon -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On 16-Jan-2001 Douglas Bates wrote:> I am writing course notes in LaTeX. In the part where I am describing > model-fitting functions in R I want to use a ~ character inline. If I > am displaying an example of R code in its own environment I use the > alltt environment, which protects the ~ character. I have forgotten > how to protect the ~ when I am writing something like > The operator `~' is used to define a model formula in \R. > The left hand side is evaluated as the response. The right hand > side can consist of several \Emph{terms} with special meaningsHow about \sim? That's what I use when I need a ~ meaning ``is distributed as.'' You may need \usepackage{amsmath} with this, but I'm not sure. ______________________________________________________________________ Stuart Luppescu -=-=- University of Chicago $(B:MJ8$HCRF`H~$NIc(B -=-=- s-luppescu at uchicago.edu http://www.consortium-chicago.org/people/sl.html Finger sl70 at musuko.uchicago.edu forPGP Public Key ICQ #21172047 AIM: psycho7070 Acceptance testing: An unsuccessful attempt to find bugs.>> Sent on 16-Jan-2001 at 15:20:58 with xfmail-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Douglas Bates <bates at stat.wisc.edu> writes:> I am writing course notes in LaTeX. In the part where I am describing > model-fitting functions in R I want to use a ~ character inline. If I > am displaying an example of R code in its own environment I use the > alltt environment, which protects the ~ character. I have forgotten > how to protect the ~ when I am writing something like > The operator `~' is used to define a model formula in \R. > The left hand side is evaluated as the response. The right hand > side can consist of several \Emph{terms} with special meanings > > I welcome suggestions.I have at a similar spot: As mentioned earlier, e.g.\ in connection with boxplots and stripplots, the argument to |lm| is a \emph{model formula}, in which the tilde symbol (|~|) should be read as ``described by''. (with \usepackage{shortvrb} and \MakeShortVerb| ) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._