Skip to content

[R-pkg-devel] Producing ß in help files.

8 messages · Spencer Graves, Rolf Turner, Jeffrey Dick +2 more

#
In a help file that I am writing I wish to cite an item by a bloke whose 
surname is Wei?.

In LaTeX I would use the macro \ss, but Rd files don't accept that.

Is there any way that I can create the ? symbol in a help file?  I've 
done a bit of web-searching and found nothing helpful.

Of course I could just write "Weiss", but that's *so* non-U! :-)

Thanks for any ideas.

cheers,

Rolf Turner
#
On 2018-01-05 20:52, Rolf Turner wrote:
????? Write it "Weiss".


 ????? See "https://en.wikipedia.org/wiki/%C3%9F".


 ????? That name is written "Weiss" in Switzerland and Liechtenstein but 
"Wei?" in Germany and Austria.? German is the official language of 
Liechtenstein and the primary of four official languages of Switzerland.


 ????? Standard high German has several characters that are not used in 
English but have standard transliterations using the English latin 
alphabet.? These include "?" = "ss", "?" = "ae", "?" = "oe" and "?" = "ue".


 ????? Spencer Graves
#
On 06/01/18 16:19, Spencer Graves wrote:
<SNIP>

I'm sure that you're correct, but I find it frustrating not to be able 
to produce a symbol (which is readily available elsewhere --- e.g. in 
LaTeX or from the keyboard using the "compose key") under the ".Rd" 
system.  I'd like to be *able to produce it*, even if I shouldn't! :-)

cheers,

Rolf

P. S.  It also seems to me to be polite --- if that's the way the bloke 
writes his name, then  that's the way that I ought to write it when 
referring to him.

R.
#
On Sat, Jan 6, 2018 at 11:41 AM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
You could define a new macro in the Rd file (untested):

\newcommand{\ss}{\ifelse{latex}{\ss}{\ifelse{html}{\out{&szlig;}}{ss}}}

That would use "\ss" in LaTeX, "&szlig" in HTML, and "ss" in plain
text rendering.

Or, add \encoding{UTF-8} to the Rd file and ? is available in plain text:

\newcommand{\ss}{\ifelse{latex}{\ss}{\ifelse{html}{\out{&szlig;}}{?}}}
#
On 2018-01-05 21:41, Rolf Turner wrote:
????? Agreed -- except that people who have not studied German would 
not recognize "?" as sounding like "ss":? They might want to pronounce 
it "Weib" -- old German for "woman", though transliterated as "wife" -- 
very different from "Wei?" = "White".


 ????? "Solzhenitsyn" is the English and Spanish transliteration of a 
name that appears in German as "Solschenizyn", French as "Soljenitsyne", 
and Russian as "??????????", according to Wikipedia 
(https://en.wikipedia.org/wiki/Aleksandr_Solzhenitsyn).


 ????? Hope this helps.
 ????? spencer
#
And just writing it with a declared encoding in the Rd file des not work?

Section 2.14 in WRE tells us that \encoding{} can declare anm encoding 
and "For convenience, encoding names ?latin1? and ?latin2? are always 
recognized: these and
?UTF-8? are likely to work fairly widely. However, this does not mean 
that all characters in
UTF-8 will be recognized, and the coverage of non-Latin characters10 is 
fairly low. Using LATEX
inputenx (see ?Rd2pdf in R) will give greater coverage of UTF-8.
The \enc command (see Section 2.8 [Insertions], page 75) can be used to 
provide transliterations
which will be used in conversions that do not support the declared 
encoding."

And Secion 2.8 tells us

Text which might need to be represented differently in different 
encodings should be marked
by \enc, e.g. \enc{J?reskog}{Joreskog} (with no whitespace between the 
braces) where the
first argument will be used where encodings are allowed and the second 
should be ASCII (and
is used for e.g. the text conversion in locales that cannot represent 
the encoded form). (This is
intended to be used for individual words, not whole sentences or 
paragraphs.)



Hence a preamble with, e.g.
\encoding{latin1}
or
\encoding{UTF-8}
and later writing \enc{Wei?}{Weiss} seems most appropriate here.

Best,
Uwe Ligges
On 06.01.2018 04:41, Rolf Turner wrote:
#
Den 2018-01-06 kl. 04:41, skrev Rolf Turner:
I couldn't agree more: Thanks Rolf!

G?ran

PS. I follow Uwe's recommendation and write \enc{G?ran}{George} after
\encoding{UTF-8}. (Goeran?? Too ugly.)
11 days later
#
On 06/01/18 20:51, Uwe Ligges wrote:

            
Uh, yes.  It does indeed work just fine.  Thank you!  The point is that 
I had no idea of this possibility --- or even of the existence of 
"declared encoding".

For the record, what I did was:

* put "\encoding{UTF-8}" at the very beginning of the *.Rd file, just
   before the "\name{.}" command.
* wherever I referred to Prof. Wei?, use "\enc{Wei?}{Weiss}"

It's very easy once one has been told how to do this, impossible before 
that.  The discussion in WRE is opaque to me.

Many thanks, Uwe, for telling me how to do this, and to others who made 
similar suggestions.

My humblest apologies for taking so long to acknowledge the help that I 
was given.

cheers,

Rolf