From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8HNkLYozkWI67gAAbAwnHQ (envelope-from ) for ; Fri, 27 May 2022 22:24:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UGRkLYozkWL9JwEAauVa8A (envelope-from ) for ; Fri, 27 May 2022 22:24:42 +0200 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 3C26F3BF26 for ; Fri, 27 May 2022 22:24:41 +0200 (CEST) Received: from localhost ([::1]:54160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nugVk-0001HD-Gx for larch@yhetil.org; Fri, 27 May 2022 16:24:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuevQ-0007Tp-US for emacs-orgmode@gnu.org; Fri, 27 May 2022 14:43:05 -0400 Received: from mout01.posteo.de ([185.67.36.65]:38225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuevL-00081u-6X for emacs-orgmode@gnu.org; Fri, 27 May 2022 14:43:04 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id F0B96240026 for ; Fri, 27 May 2022 20:42:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1653676977; bh=V8D4pk6pMrqazV19idXhu9X7ZWegyF2BArMcEQ9w3TY=; h=From:To:Cc:Subject:Date:From; b=j9uHfytUm9qpX2R2NJv0o9/3TWKZh+XmK4Eg+QeaDedoROcEmimEdIQufnVLd4t+f MY5dgqXWY2Uv+k7Gke17ncsp+MhjVffDuwld7Y5XCdZURcDYDKiMJYemv9jO+KmNjn v/pYBuoUFPsMQyvf0te6avIn58Qipmq2POHvbx0V4XjTUcAM8dgb2KMt/6hU4vzBLd 9EV0dd5+04ymE3u3z6oKeIfoFoGAOS+FqB4bV1fwTvbvy3z6zKdqtSkRfxRcPSx82S GmJTEI6JfwdjxIjtUdr4JMvz0pGaWKxpvedm4EIcHjGp368Fi0MbNVno4KFMgBWhe3 UzADtur2MYkJQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4L8twJ28nJz6tmL; Fri, 27 May 2022 20:42:56 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Uwe Brauer Cc: orgmode Subject: Re: how to export an org file, to 2 different locations (in to different formats) References: <87r14flzaa.fsf@mat.ucm.es> Date: Fri, 27 May 2022 18:42:53 +0000 In-Reply-To: <87r14flzaa.fsf@mat.ucm.es> (Uwe Brauer's message of "Fri, 27 May 2022 18:23:57 +0200") Message-ID: <87a6b2stoy.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -39 X-Spam_score: -4.0 X-Spam_bar: ---- X-Spam_report: (-4.0 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653683082; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=kL7WVOcl3NbsdhIcYN99rCfbtJ5AkDfzgk3kjxjbocA=; b=TrJCefyILcVg7vsmjQ5Evkeg07AkYbb/EHXO0U/EgX7hebL9gPGWnD3ycBrI8H7XFjSFWS F0i8vXmERWtco3RrI8A91V8IG+lZykQfrmgEqYLYn1LvKn3E6BiA3PZJKm36Y1A7AnDwV7 NL3oq+ksayTtjKC6scsbABa9ILQCd4nmJbK1hsfMziMpeMCbym15vvrYBuLT2e8CR8wXQ7 DMzYrd8QezskoFyF5v3fKa+f4hdm8JnVjUEM6YeJDOxkY2SliXXoRRBIaeENsVg3dui9Qi Relc8QkWTg1gusvKtPTxnjvOImwhnW4zZ8A0o69L3QIBezNID1uSSSOuZEGt+A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653683082; a=rsa-sha256; cv=none; b=KI7bvnc8uYMHLm4Tn6LXyl0rHzF6VcEhJ83tITqAjpZlsRoVOQSMYYa4MTilI7HusK8IEj UXmEsh6vd0a7RBRjDNc+3AR9PyqkrfWgdy2ndX/AcfO6VAHZqUUUNmzMEzeA0/WflYT32m oItFZnWnjnfcld+NcbRHZ2DIOKMY+YDT5DPDlwL9s2YYwaUc2lVqUBZrgODC0kBFb4Ff62 18sTIfjDuA4AzHzFnoRNqZzTEk8zSOTeIplmPXtdT2qVmwd0V2s5AIxkRz/ud8yy3T+CQZ L4joNdm72wYkWBG9wG96dzGRKPN1tgB/7H/PHZQ5VV7bBj7ya4bGmWVz+qWqPw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=j9uHfytU; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -7.74 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=j9uHfytU; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3C26F3BF26 X-Spam-Score: -7.74 X-Migadu-Scanner: scn0.migadu.com X-TUID: eStddXBCuoya Hi Uwe, Uwe Brauer writes: > Hi > > Currently I use > #+EXPORT_FILE_NAME: /home/oub/Desktop/some-stuff.html > > To export my org file in html format to that location. > > But I would also like to export it as a latex file to a different > location, without modifying the above line, or to be more precise to add > a different location, like > > 1. if export to latex use that folder > > 2. If export to html use this folder > > Anybody know about such a functionality? > > Thanks and regards > > Uwe Brauer One (pedestrian) way to achieve it, with this function: (defun my-org/export-to-path (backend export-path extension) (org-element-map (org-element-parse-buffer) 'keyword (lambda (k) (when (string= (org-element-property :key k) "EXPORT_FILE_NAME") (let ((value (org-element-property :value k))) (org-export-to-file backend (format "%s%s.%s" export-path value extension))))))) And then you could evaluate it inside a block in your document, with the chosen arguments. For example: #+EXPORT_FILE_NAME: myfile #+begin_src emacs-lisp :exports none :eval never-export :results silent (my-org/export-to-path 'html "~/Desktop/" "html") #+end_src Best regards, Juan Manuel