From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wMziNdGt4l9hRQAA0tVLHw (envelope-from ) for ; Wed, 23 Dec 2020 02:39:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id YGi6MdGt4l9TSAAAbx9fmQ (envelope-from ) for ; Wed, 23 Dec 2020 02:39:13 +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 04D03940481 for ; Wed, 23 Dec 2020 02:39:12 +0000 (UTC) Received: from localhost ([::1]:54982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kru3S-0002Yd-AD for larch@yhetil.org; Tue, 22 Dec 2020 21:39:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kru2i-0002YP-4j for emacs-orgmode@gnu.org; Tue, 22 Dec 2020 21:38:24 -0500 Received: from gateway20.websitewelcome.com ([192.185.61.9]:33415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kru2f-0005s2-Ru for emacs-orgmode@gnu.org; Tue, 22 Dec 2020 21:38:23 -0500 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id B4147400D4FCF for ; Tue, 22 Dec 2020 20:33:11 -0600 (CST) Received: from box2035.bluehost.com ([74.220.219.237]) by cmsmtp with SMTP id ru2SkZzPsoE4Dru2SkyBth; Tue, 22 Dec 2020 20:38:09 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tsdye.online; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:In-reply-to:Subject:To:From:References:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mebMeWw/cXT2y9Q/FuEiiuish3OtkJkoow0kkD+eDhE=; b=Pma9qgobbIQuh5+hs4TZvFGXOz i8yB8hf0X6ycUyx3RVSPAGsEchrkj2LjRu9XdLh8+KlUbQow9Z72xAAPkAdLQY+B3tUgZYJvWragu ne1XBmLupViqcblULpotI8O5u/VYOZxjismBC6FRKnk5Z5EKyFqfDuE+6eQZGjdPUruNytOaJczw9 QnDDTGUYJXBt9G3q0e2MI2B+sdBMYebS3UMxR/9ilvQ09VEU8BbG8mhAldD6KvwQp0ZrvxLup/5Fw RQCEydZV8af1Tmzr0wQu2IfilkI0oi6vuzqgKT4h7bXWgwczdZOFmsif/5y9gxHQObYT9jmrFIO6n JzyAmSpA==; Received: from cpe-50-113-36-248.hawaii.res.rr.com ([50.113.36.248]:45444 helo=poto-foou.tsdye.online) by box2035.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kru2S-001dSd-Cc for emacs-orgmode@gnu.org; Tue, 22 Dec 2020 19:38:08 -0700 References: <87ft3xff0q.fsf@posteo.net> User-agent: mu4e 1.2.0; emacs 26.3 From: "Thomas S. Dye" To: emacs-orgmode@gnu.org Subject: Re: [TIP] Export to LaTeX and HTML with a watermark In-reply-to: <87ft3xff0q.fsf@posteo.net> Date: Tue, 22 Dec 2020 16:38:06 -1000 Message-ID: <87im8t4581.fsf@tsdye.online> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box2035.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tsdye.online X-BWhitelist: no X-Source-IP: 50.113.36.248 X-Source-L: No X-Exim-ID: 1kru2S-001dSd-Cc X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-50-113-36-248.hawaii.res.rr.com (poto-foou.tsdye.online) [50.113.36.248]:45444 X-Source-Auth: tsd@tsdye.online X-Email-Count: 5 X-Source-Cap: dHNkeWVvbmw7dHNkeWVvbmw7Ym94MjAzNS5ibHVlaG9zdC5jb20= X-Local-Domain: yes Received-SPF: pass client-ip=192.185.61.9; envelope-from=tsd@tsdye.online; helo=gateway20.websitewelcome.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.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, FROM_SUSPICIOUS_NTLD=0.5, PDS_OTHER_BAD_TLD=1.999, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 X-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=tsdye.online header.s=default header.b=Pma9qgob; dmarc=none; 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: 04D03940481 X-Spam-Score: -1.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: DDvNUeQDt37c Nice! This is the kind of thing I like to find here:=20 https://orgmode.org/worg/org-hacks.html Please consider adding it to Worg! All the best, Tom Juan Manuel Mac=C3=ADas writes: > Hi, > > Recently, I needed to export a document to both LaTeX and HTML=20 > with a > watermark background. I came to write this little function (for=20 > LaTeX, > the 'draftwatermark' package is used; for html, a bit of CSS.=20 > The > optional arg `text' is the text of the watermark; by default=20 > what is > printed is "DRAFT"): > > #+begin_src org > ,#+begin_src emacs-lisp :exports results :results none > (defun my-watermark (&optional text) > (cond ((org-export-derived-backend-p=20 > org-export-current-backend 'latex) > (concat "#+LaTeX_Header:\\usepackage" > (if text > (format "[text=3D%s]" (replace-regexp-in-string " " "~"=20 > text)) > "") > "{draftwatermark}")) > ((org-export-derived-backend-p org-export-current-backend=20 > 'html) > (concat "@@html:

" > (if text > (format "%s" text) > "DRAFT") > "

@@")))) > > ,#+end_src > #+end_src > > The CSS could be (source: > https://stackoverflow.com/questions/68569/text-watermark-on-website-how-t= o-do-it): > > #+begin_src org > ,#+html_HEAD: > #+end_src > > And then, this replacement macro: > > #+begin_src org > ,#+MACRO: wmark (eval (if (org-string-nw-p $1)(my-watermark=20 > $1)(my-watermark))) > #+end_src > > And finally, an example: > > #+begin_src org > {{{wmark(Top secret!)}}} > > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. > accumsan nisl. > > (...) > #+end_src > > Regards, > > Juan Manuel -- Thomas S. Dye https://tsdye.online/tsdye