* [PATCH] ox-latex: Scale inlinetasks according to column width
@ 2021-12-31 3:55 Ihor Radchenko
2022-05-29 10:07 ` Ihor Radchenko
0 siblings, 1 reply; 2+ messages in thread
From: Ihor Radchenko @ 2021-12-31 3:55 UTC (permalink / raw)
To: emacs-org list
[-- Attachment #1: Type: text/plain, Size: 214 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-latex-Scale-inlinetasks-according-to-column-width.patch --]
[-- Type: text/x-diff, Size: 1264 bytes --]
From 40f6e9a4e66ca733f9be27097bfa6cc814868032 Mon Sep 17 00:00:00 2001
Message-Id: <40f6e9a4e66ca733f9be27097bfa6cc814868032.1640922780.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ox-latex: Scale inlinetasks according to column width
2021-12-31 3:55 [PATCH] ox-latex: Scale inlinetasks according to column width Ihor Radchenko
@ 2022-05-29 10:07 ` Ihor Radchenko
0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2022-05-29 10:07 UTC (permalink / raw)
To: emacs-org list
Ihor Radchenko <yantar92@gmail.com> writes:
> 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.
Applied onto main via d37e4dc0f.
Best,
Ihor
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-29 10:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-31 3:55 [PATCH] ox-latex: Scale inlinetasks according to column width Ihor Radchenko
2022-05-29 10:07 ` Ihor Radchenko
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).