From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MAm+DcyyaWHKFAEAgWs5BA (envelope-from ) for ; Fri, 15 Oct 2021 18:56:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YF9zCcyyaWHcTgAA1q6Kng (envelope-from ) for ; Fri, 15 Oct 2021 16:56:44 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B49321302D for ; Fri, 15 Oct 2021 18:56:43 +0200 (CEST) Received: from localhost ([::1]:42182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbQVd-0005MJ-R7 for larch@yhetil.org; Fri, 15 Oct 2021 12:56:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbQV9-0005LQ-Tw for emacs-orgmode@gnu.org; Fri, 15 Oct 2021 12:56:11 -0400 Received: from mout01.posteo.de ([185.67.36.65]:59483) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbQV6-0007gn-JE for emacs-orgmode@gnu.org; Fri, 15 Oct 2021 12:56:11 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 1EAC3240027 for ; Fri, 15 Oct 2021 18:56:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1634316963; bh=vEfjFTsKjkbZnpird2qH+cjuyXtZEjImK46Xaudx3xI=; h=From:To:Subject:Date:From; b=ph2Uy10CTlA5/rXn6Ig2x8uhmwTbugILo9K4gsgueZh7t4kmpicHpuq2kNG2x81O8 AMLvsXYu9qvJu0eeQsVYiiE4idv0a912avUTnfPjkciouHPxOwfHerM3q1LDlnzv9u +EzATbwQrP+7z8QrVnuqDixX7OKFnvLBAzT7v8LmJpZCtrnfH3v+57Y4A8Xro5kwgO S0hnL3UWMM2xr1B4jUollhaqhAWOCZ6SBGl3n6Q0SCOszHUxjCsulLkdshgquSFyI0 lEzNxyTs2245lo2cyCKTUwO7c84Ijxe1kaG6k+NMlO2T8+UaD/VyVlqXT86bhjSfHu m0rmG0rtWlUcg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HWC8L2pC9z9rxW for ; Fri, 15 Oct 2021 18:56:02 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: orgmode Subject: [minor tip] "TeXify" strings "TeX" and "LaTeX" when exporting to HTML Date: Fri, 15 Oct 2021 16:56:01 +0000 Message-ID: <87ilxyns66.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634317003; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=3YWTyzV81Na1lSJZC2xrtPSw/FHh3S34BQGGbVnpY74=; b=Gv6DYu4UQBqXkJGqc24y9XygDUDR0OQHlM2yHYZhci/JaoRC1zmF/cD4PXU7RX5nRNzGL3 D5MOwPRRxnRaitWC7yz6wvAoomJHNTI9wcU6aD0H/qUJx8G9IrZeuyIKTR/TV0tHqmBPn6 SXmy409nFE7/dLTImeLaXYVzFgGMHdpvERHJm394wLn+4qjGcCtZE4Bc6jPKztXELzCpi5 AcaaeVYfRHZYo/CphFulTToNtS1Zhcc1K0I582QLRk5k+oq0X/bA5J023G1xwOzfR7xBdu +wdVos44rYqPB+gXtSd6nrsC5v7WQyfJPWAeyf5xhgr9jCSsUv0C4WnZNhl7rA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634317003; a=rsa-sha256; cv=none; b=JY6swnd8MBCzXHlVAsHcVdtgQGFRq0B+FjC+5ARG9KirO3Nfbv8XZppqc7vMMYa3X071t4 1vDGz5SMNo/IxjY9+YQ5LizpqqpU2OlOpimiJoou0RkmNtE2UQuSP2lHT3SEUj+1SOQP17 gGjqF/q/3+OBp4OfSaACvaGm66Hp1lvPB1FOvND8q/s3yrkgmvI1j3sEcTDHfkpDgML+cP 3Hb1rzQ7b9N8YH7mHFAJEby5Qwpf9QHt1ra3AlG7X7fW+WsUDFP3vjy56iU9Xjykd6CzSJ cCOAgcEv7OhLZUrv/Wj8ZEtbACFONrOmTAzTkA79wBbhOuWlGCUoX/jDxMfQGw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ph2Uy10C; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.91 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ph2Uy10C; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: B49321302D X-Spam-Score: -3.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: c45gG75PFk1h Hi all, I wrote this simple filter for my blogs, which formats "TeX" and "LaTeX" strings in the TeX 'typographic' style (or something similar). First, these variables: #+begin_src emacs-lisp (setq my/tex-html-string "TEX") =20=20 (setq my/latex-html-string "LA<= /span>TEX") #+end_src Of course, the strings can be improved. Another alternative would be to use= the wikipedia images: 3D\"TeX\"/ 3D\"LaTeX\"/ The function: #+begin_src emacs-lisp (defun my/latex-string-html-filter (text backend info) (interactive) (when (org-export-derived-backend-p backend 'html) (let ((case-fold-search nil)) (with-temp-buffer (insert text) (save-excursion (goto-char (point-min)) (while (re-search-forward "\\([^La]\\)TeX" nil t) (replace-match (concat "\\1" my/tex-html-string)))) (save-excursion (goto-char (point-min)) (while (re-search-forward "LaTeX" nil t) (replace-match my/latex-html-string))) (setq text (buffer-string)))))) #+end_src And, finally: #+begin_src emacs-lisp (add-to-list 'org-export-filter-plain-text-functions #'my/latex-string-ht= ml-filter) #+end_src Fun fact. Donald Knuth explains in the first chapter of his /TeX book/, "The Name of the Game", the origin of the term TeX, and why it is formatted that way: #+begin_quote English words like `technology' stem from a Greek root beginning with the letters =CF=84=CE=B5=CF=87...; and this same Greek word means /art/ as = well as technology. [...] Insiders pronounce the =CF=87 of TeX as a Greek chi, not as an `x', so that TeX rhymes with the word blecchhh. It's the `ch' sound in Scottish words like /loch/ or German words like /ach/; it's a Spanish `j' and a Russian `kh'.=20 [...] On the other hand, it's important to notice another thing about TeX's name: The `E' is out of kilter. This logo displaced `E' is a reminder that TeX is about typesetting, and it distinguishes TeX from other system names. [...] The correct way to refer to TeX in a computer file, or when using some other medium that doesn't allow lowering of the `E', is to type `TeX'. Then there will be no confusion with similar names, and people will be primed to pronounce everything properly. #+end_quote Best regards, Juan Manuel=20