[R] Tabs in PDF documents

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Tue Jul 31 00:12:33 CEST 2007


I think you need to escape the '\' character in your string by adding an extra '\' in front of it. So try

	pdf("junk.pdf")
	par(family="mono")
	plot(1,1)
	text(1,1, "\\txx")
	mtext("\\txx")
	dev.off()

HTH,

Thierry

-----Oorspronkelijk bericht-----
Van: r-help-bounces op stat.math.ethz.ch namens Dennis Fisher
Verzonden: ma 30-7-2007 14:25
Aan: r-help op stat.math.ethz.ch
Onderwerp: [R] Tabs in PDF documents
 
Colleagues,

I am using R 2.5.1 on an Intel Mac (OS 10) to create PDF outputs  
using pdf(); same problem exists in Linux (RedHat 9)

While adding text to the document with text() and mtext(), I  
encounter the following problem:

In order to align the text, I have embedded tabs ("\t") in some of  
the text.  Each time I do so, I get the following error messages:
	Warning: font metrics unknown for character 0x9
	Warning: font width unknown for character 0x9
and the tabs are ignored.  I have tied par() with and without  
family="mono".

Is there a work-around available for this?

Dennis

COMMANDS:
	pdf("junk.pdf")
	par(family="mono")
	plot(1,1)
	text(1,1, "\txx")
	mtext("\txx")
	dev.off()

______________________________________________
R-help op stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list