LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

View:

 Message: [ First | Previous | Next | Last ] By Topic: [ First | Previous | Next | Last ] By Author: [ First | Previous | Next | Last ] Font: Proportional Font

Subject:

Re: Text Commands in XeLaTeX and LuaLaTeX

From:

Date:

Thu, 10 Jan 2019 15:42:09 +0100

Content-Type:

text/plain

Parts/Attachments:

 text/plain (59 lines)
 > I know that text commands (as defined by \DeclareTextCommand) have > been important because of the various font encodings that arose over > LaTeX’s history, but it seems that the situation is quite different > for the XeTeX and LuaTeX engines. > Given that both XeLaTeX and LuaLaTeX accept UTF-8 input and use only > the TU font encoding, is it acceptable to forgo \DeclareTextCommand > for most—if not all—cases? > For example, ® can simply be included directly in the document source, > so \textcopyright is not much more than an ASCII alias. Well I can't "simply" include the symbol - I have no idea how to reach it on my keyboard, so I would have to find some table and copy and paste, or remember the unicode number and insert it with \symbol. > As for less common symbols, one could simply wrap the text in a > document command. > Excuse my naîveté, as there are probably important advantages to the > text command approach that I’ve completely overlooked. Even with unicode around you don't always want one input to give always the same output. E.g. you perhaps want sometimes a € and sometimes EUR. Another example is different glyph coverage of fonts. E.g. the font Old Standard has double bracket, but libertine has not. With text commands and font encodings you can define things so that Old Standard uses its native glyphs and libertine falls back to textcomp: \documentclass{article} \usepackage{fontspec} \usepackage{textcomp} \makeatletter %hm \DeclareUnicodeEncoding{TUwithbrack} {  \input{tuenc.def}  \DeclareTextSymbol{\textrbrackdbl}  \UnicodeEncodingName{12315}  \DeclareTextSymbol{\textlbrackdbl}  \UnicodeEncodingName{12314} } \setmainfont{Old Standard}[NFSSEncoding=TUwithbrack] \setsansfont{Linux Libertine O} \begin{document} Old Standard uses its symbol: Inter omnes \textlbrackdbl men\textrbrackdbl mensurarum \sffamily linux libertine uses textcomp Inter omnes \textlbrackdbl men\textrbrackdbl mensurarum \end{document} -- Mit freundlichen Grüßen Ulrike Fischer