From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qHFtHvp+zmEcGQEAgWs5BA (envelope-from ) for ; Fri, 31 Dec 2021 04:54:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GALUG/p+zmHZUQAA9RJhRA (envelope-from ) for ; Fri, 31 Dec 2021 04:54:34 +0100 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 1FBFAE573 for ; Fri, 31 Dec 2021 04:54:34 +0100 (CET) Received: from localhost ([::1]:58324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n38zw-0006qS-PQ for larch@yhetil.org; Thu, 30 Dec 2021 22:54:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n38zA-0006qH-SI for emacs-orgmode@gnu.org; Thu, 30 Dec 2021 22:53:44 -0500 Received: from [2a00:1450:4864:20::42f] (port=41488 helo=mail-wr1-x42f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n38z9-0000BD-AP for emacs-orgmode@gnu.org; Thu, 30 Dec 2021 22:53:44 -0500 Received: by mail-wr1-x42f.google.com with SMTP id a9so53849729wrr.8 for ; Thu, 30 Dec 2021 19:53:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=3iAP4514n2U1JRombg6zVSmiJ0e/cmuLInLMGAt7jn4=; b=Kjs0NTBysmx2vxGF2lKqjSx7mRXiiZd4L7aOh8hoVeuhEPEVVU6loDy/ZTC5EYP34M HZR0n7mTf5Hih03yrKYNxQsrelzrS6wBetZeb/qaxHz9C/DCKPhSQ7g9jIxxO37ec7ay VF+TD95aWZNZfKwNzaqAb9WcI0ma9egdBo0+bbXfB3rCiq0BvvSXAC22x8ny2WE9+a4Z kotf03XeJ4F7/mvNmCTN5RhnwYkBSsc6GTQpSFA9nZq79o5LXK8c31JLRrdCNv7+MLh7 oyGSPEEcHdMVwDXVsKNe7so9vXdA41g+nLn6h0WaWyzmOOj0o7aUtkYYXaeSLuK01JGY BSNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=3iAP4514n2U1JRombg6zVSmiJ0e/cmuLInLMGAt7jn4=; b=LDT+fkmE1nTXQbNh9aWsBvlROHQF+xSJgmwIWUfxU4ODaadBb9+kW1Muf8YL71WBU+ jC7+gkzlCtHaPnN5RY426iHc9mg2wjWx2pllF6mXD7XaawvhB8mjiHcj51V3jTxW1qge dPWp8UIO88/15tV41FcjG4B3BZXNWbeFIZ+cWXo2xRhVO8FOgwnhwIiacLfYUFS6oQPk itZgu+9IaGZTZ8MuP7A0u4zG/YFmVljROhYV45NmvT00+ikx3L0+x0uXrLYVKu4Bhb1I Q7DkB0Q4sFrIpZ+b0fV5OADkmn9o6I/OSsByJ2fGowrFKAoi4tfjTcCGge2MQvXsbanG rDhg== X-Gm-Message-State: AOAM530Qcrl3IIQyd8ANYw4uZcxmpe4hGybXl1WfyvKejGVOn1spIGyx Nej9nfB6EqOawbb4RqnWrPc1ZS/S/fvXgQ== X-Google-Smtp-Source: ABdhPJzB9bLTvAdq7oA9+kA2iV3yzgbZTu7j+y4qIIuxGwcVoFEW+LZhQFVaMoKm1oCB3cMKejKRXQ== X-Received: by 2002:adf:ecc8:: with SMTP id s8mr29171912wro.184.1640922821163; Thu, 30 Dec 2021 19:53:41 -0800 (PST) Received: from localhost ([91.210.107.150]) by smtp.gmail.com with ESMTPSA id k9sm24975397wro.80.2021.12.30.19.53.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Dec 2021 19:53:40 -0800 (PST) From: Ihor Radchenko To: emacs-org list Subject: [PATCH] ox-latex: Scale inlinetasks according to column width Date: Fri, 31 Dec 2021 11:55:01 +0800 Message-ID: <87k0fl1l9m.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=yantar92@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=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.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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640922874; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=3iAP4514n2U1JRombg6zVSmiJ0e/cmuLInLMGAt7jn4=; b=Oe0qRVhBKCoMwunWcVjCq6Z2TCVn3WTHu5iAA60YZ7Fx5YVdCWXHzcfmT+rV/01WaRpADN FT43/syHm8ZBNHQLRsiXr7MV+kncSALKn5aHLagJntYATWhO4oNn+RnIVmOQ3HcH5DNxOM m9peYlTP2swJTM6XiKxJkt65nT2XikuJ3tMwfqxE6J54GijU1PE0ZL/t1mD1UfbV/vodJ3 fZIcJjFH2izLEceoVwk6sg//ufb573+fNIDPaoz1cUMb077nq082OBmRr3GD3mCv303syi Awb6DeOjh8lu18kD+OBp1NRMZI6lDUOVOPwuiYgZBSTFR3JpvZHSdTvzPL2tMA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640922874; a=rsa-sha256; cv=none; b=rGTkA0mhXUMXqjQ+/OrGGUILx2cM+vEbrEpzVXfx7+VMgdcTLTNZ9wsGWyJYGV1Z9xQ0h8 iLETQuHLbOioqt6U5GGNViyR/czmqJQLzB4/xcMeFNQvPfP3TWMYd1bTLqwiDaGV8jq5MH EhQkNpBGTXNNwAhCG3ZMilm+W6+LlQg3+9/TxMKAQOrhzY9tERtBysH5SOkzjTG7NX08wT dFUpnZnH2ex66vbx9ZLnuL+5QCubMQBqVVpW/wmK2J6gmSGXf6wZkcDkwkr4PO6nsho6aW e2UTaKohYcNvrEtPcAINgJYMNQnPFWMs4CPH/upcoajRgAj2YxApJYhxwrSstQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Kjs0NTBy; dmarc=pass (policy=none) header.from=gmail.com; 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: -3.78 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Kjs0NTBy; dmarc=pass (policy=none) header.from=gmail.com; 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: 1FBFAE573 X-Spam-Score: -3.78 X-Migadu-Scanner: scn1.migadu.com X-TUID: joFJT70Qud/9 --=-=-= Content-Type: text/plain Hi, I recently had a need to export org into multi-column latex and noticed that inlinetasks are exported into boxes that are wider than column width. That looks ugly. The attached patch fixes this. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-latex-Scale-inlinetasks-according-to-column-width.patch >From 40f6e9a4e66ca733f9be27097bfa6cc814868032 Mon Sep 17 00:00:00 2001 Message-Id: <40f6e9a4e66ca733f9be27097bfa6cc814868032.1640922780.git.yantar92@gmail.com> From: Ihor Radchenko Date: Fri, 31 Dec 2021 11:51:01 +0800 Subject: [PATCH] ox-latex: Scale inlinetasks according to column width * lisp/ox-latex.el (org-latex-format-inlinetask-default-function): Set inlinetask box width relative to \linewidth in current column. Using \textwidth scales the box wider than column in multi-column documents. --- lisp/ox-latex.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 32d29cc44..8f50c06f3 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2191,10 +2191,10 @@ (defun org-latex-format-inlinetask-default-function (mapcar #'org-latex--protect-text tags))))))) (concat "\\begin{center}\n" "\\fbox{\n" - "\\begin{minipage}[c]{.6\\textwidth}\n" + "\\begin{minipage}[c]{.6\\linewidth}\n" full-title "\n\n" (and (org-string-nw-p contents) - (concat "\\rule[.8em]{\\textwidth}{2pt}\n\n" contents)) + (concat "\\rule[.8em]{\\linewidth}{2pt}\n\n" contents)) "\\end{minipage}\n" "}\n" "\\end{center}"))) -- 2.32.0 --=-=-=--