From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: ox-latex and small caps links Date: Wed, 22 Apr 2015 11:08:45 +0200 Message-ID: <874mo88r8i.fsf@gmx.us> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkqeT-0001d3-68 for emacs-orgmode@gnu.org; Wed, 22 Apr 2015 05:09:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkqeP-00019W-QM for emacs-orgmode@gnu.org; Wed, 22 Apr 2015 05:09:01 -0400 Received: from plane.gmane.org ([80.91.229.3]:55498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkqeP-00019K-Ix for emacs-orgmode@gnu.org; Wed, 22 Apr 2015 05:08:57 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YkqeO-00085D-BE for emacs-orgmode@gnu.org; Wed, 22 Apr 2015 11:08:56 +0200 Received: from tsn109-201-152-7.dyn.nltelcom.net ([109.201.152.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Apr 2015 11:08:51 +0200 Received: from rasmus by tsn109-201-152-7.dyn.nltelcom.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Apr 2015 11:08:51 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, David Dynerman writes: > I've been using links to render text in small caps when exporting to > LaTeX and HTML, e.g. > > [[latex:textsc][this is in small caps]] > > This worked fine in 8.2.10, but causes an error in latest. When I try to > export the file to LaTeX, the export fails with: > > Unable to resolve link latex:textsc Perhaps you did not add the latex link type. You could also use a macro. I use the following hack, which (tries to) captures words like ThIs, THIS, or thIS and export is as \textsc{t}h\textsc{i}s, \textsc{this}, or th\textsc{is}. It won't manage e.g. (i). For html you need to add support for a small-caps class. (defun rasmus/org-guess-textsc (content backend info) "Automatically downcase and wrap all-caps words in textsc. The function is a bit slow... TODO: Make the function work with headlines, but without doing it on subsequent text. TODO: Add ODT support." (if (org-export-derived-backend-p backend 'latex 'html) (let* (case-fold-search (latexp (org-export-derived-backend-p backend 'latex)) (wrap (if latexp "\\textsc{%s}" "%s"))) (replace-regexp-in-string "\\w+" (lambda (str) (if (or (string-equal str (downcase str)) (string-equal str (capitalize str))) str (replace-regexp-in-string "[[:upper:]]+" (lambda (x) (format wrap (downcase x))) str t t))) content t t)) content)) (add-to-list 'org-export-filter-plain-text-functions 'rasmus/org-guess-textsc) I have also found the slantsc latex package useful for emphases with small caps. Here's what I have used for small caps in css. body { font-family: "Linux Libertine"; -moz-font-feature-settings:"onum" 1, "kern" 1, "liga" 1; -moz-font-feature-settings:"onum=1, kern=1, liga=1"; -ms-font-feature-settings:"onum" 1, "kern" 1, "liga" 1; -o-font-feature-settings:"onum" 1, "kern" 1, "liga" 1; -webkit-font-feature-settings:"onum" 1, "kern" 1, "liga" 1; font-feature-settings:"onum" 1, "kern" 1, "liga" 1;} .small-caps { -ms-font-feature-settings: "smcp"; -moz-font-feature-settings: "smcp"; -webkit-font-feature-settings: "smcp"; font-feature-settings: "smcp"; letter-spacing:.02em; font-variant-caps: small-caps; text-transform: lowercase;} Hope it helps, Rasmus -- I hear there's rumors on the, uh, Internets. . .