Re: Account for latex snippet width in fill paragraph

2021-02-09 Thread Matt Huszagh
Eric S Fraga writes: > I don't have this issue because I use visual-line-mode (together with > org-indent-mode) and text reflows automatically. Every paragraph is a > single "line" in the org file but is (soft) wrapped automatically at the > window edge. But this may not suit you, of course.

Account for latex snippet width in fill paragraph

2021-02-08 Thread Matt Huszagh
Hello, I make extensive use of inline latex image snippets in my Org buffers. One thing that has annoyed me for a while is that `org-fill-paragraph' (unsurprisingly) uses the width of the underlying text when determining the characters which make up each line. Because the characters which make up

Re: babel default header args as functions

2020-12-21 Thread Matt Huszagh
Bastien, Any chance you've had the time to look at this? I know how much time you put into org-mode, so no rush if you need more time! Let me know if there's anything I can do on my end. Thanks! Matt

Re: [PATCH] babel latex headers and image generation commands

2020-10-24 Thread Matt Huszagh
Bastien writes: > sorry for the delayed answer. No worries! > Can you provide a patch against etc/ORG-NEWS announce this? Attached. Let me know what you think. Matt >From 51fb3ef9843ae45884803142f150c5d2f4f4d4c9 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Sat, 24 Oct 2020

Re: babel default header args as functions

2020-10-14 Thread Matt Huszagh
rey-coyrehourcq writes: > I'm unfamilliar with patch by mail but i try to apply your patch to my melpa > local org 9.4 version used by doom emacs. > Patch hang on Hunk #3, i attach the .rej file. You might need to start from a different org commit. I believe 6a182b690f works. Otherwise, you

Re: babel default header args as functions

2020-10-14 Thread Matt Huszagh
rey-coyrehourcq writes: > I'm interested by this functionality, do you know if it was merged or i need > to apply patch locally ? Hi SR, This hasn't been merged yet. I believe it's ready, but we're just waiting on a maintainer to apply it upstream. If you're able to apply the patch locally

Re: [PATCH] Omit file description when :file-desc has nil value

2020-10-06 Thread Matt Huszagh
eparately (didn't post to the thread since the PDF is too large). Thanks Matt >From 7452f3e8315be63fa8ae160f6be00963bac898a7 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Tue, 29 Sep 2020 14:11:59 -0700 Subject: [PATCH] lisp/ob-core.el: Allow passing empty vector to :file-desc to omit

Re: [PATCH] Omit file description when :file-desc has nil value

2020-09-29 Thread Matt Huszagh
xplicitly. I think this behavior is clearer. Thanks, Matt >From 749fd5ade6b65f9d07e87b4af44ebb1afef2bee6 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Tue, 29 Sep 2020 14:11:59 -0700 Subject: [PATCH] list/ob-core.el: Allow passing empty vector to :file-desc to omit description * doc/org-man

Re: [PATCH] Omit file description when :file-desc has nil value

2020-09-24 Thread Matt Huszagh
Kyle Meyer writes: > But it's not a direct comparison against that use case and the use case > you want to support. The potential breakage of existing documents is a > big factor to go against. Yep, I agree. I think my phrasing could have just been better. I meant to include the breakage as a

Re: official orgmode parser

2020-09-16 Thread Matt Huszagh
"Gerry Agbobada" writes: > I'm currently toying with the idea of trying a tree-sitter parser for Org. > The very static nature of a shared object parser (knowing TODO keywords are > pretty dynamic for example) is a challenge I'm not sure to overcome ; to be > honest even without that I can't

Re: basic org questions

2020-09-15 Thread Matt Huszagh
Emanuel Berg writes: > Yeah, but in LaTeX being left aligned is not some > property of the table, everything is left-aligned, > and if you want it otherwise, you put between > \begin{center} and \end{center} ... That page also describes how to set float parameters, which the table can be

Re: basic org questions

2020-09-15 Thread Matt Huszagh
Emanuel Berg via "General discussions about Org-mode." writes: > Yes, after export to PDF, they are centered. they = > the whole table items. I think this link (https://orgmode.org/manual/Tables-in-LaTeX-export.html) is the relevant part of the documentation. I haven't used this though, so I

Re: basic org questions

2020-09-15 Thread Matt Huszagh
Emanuel Berg via "General discussions about Org-mode." writes: > Heh...? What's strange with that? > > Anyway that's what I mean. I guess I'm just not sure what you mean. I was under the impression that tables were always left-aligned and table alignment in the manual refers to column alignment

Re: basic org questions

2020-09-15 Thread Matt Huszagh
Emanuel Berg via "General discussions about Org-mode." writes: > 2) How do I have tables not appear centered > by default, but left-aligned? Do you mean the alignment of columns, or the table itself? You can control column alignment with ``, ``, ``, e.g., | title | description

Re: [PATCH] Omit file description when :file-desc has nil value

2020-09-15 Thread Matt Huszagh
> Kyle Meyer writes: > >> I also don't find the current behavior particularly intuitive. (I'm >> also not really a babel user, so my opinion probably shouldn't count for >> much.) If we were adding it today, I think what you describe would be >> better, but, as you mention, breakage also now

Re: [PATCH] Omit file description when :file-desc has nil value

2020-09-09 Thread Matt Huszagh
Kyle Meyer writes: > I also don't find the current behavior particularly intuitive. (I'm > also not really a babel user, so my opinion probably shouldn't count for > much.) If we were adding it today, I think what you describe would be > better, but, as you mention, breakage also now also

Re: [PATCH] babel latex headers and image generation commands

2020-09-09 Thread Matt Huszagh
are some cases where dvisvgm may fail (see https://github.com/mgieseki/dvisvgm/issues/139) due to changes in ghostscript. Still, dvisvgm generally does a very good job with PDF inputs. Let me know your thoughts, I'd be happy to set the default to a dvisvgm command instead. Matt >From 1ff86f2267

Re: babel default header args as functions

2020-09-09 Thread Matt Huszagh
Bastien writes: > Also, if we integrate the change, `eval-default-headers' would be > better named `org-babel-eval-default-headers'. I've changed the function name to `org-babel-eval-headers'. The reason for dropping "default" is that this function is now used as part of

Re: babel default header args as functions

2020-09-09 Thread Matt Huszagh
ed when they are used as part of the final set of headers. >From 4a461a90ec4f3c5f9634b687a6685ea3ba74f168 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Fri, 28 Aug 2020 11:05:59 -0700 Subject: [PATCH] ob-core.el: Add ability to use closures as default header arguments * lisp/ob-core.el (org-babel-default-header-ar

Re: [PATCH] Omit file description when :file-desc has nil value

2020-09-03 Thread Matt Huszagh
Matt Huszagh writes: > This patch omits a file description when :file-desc has a nil > value. I've modified the patch to yield the same effect when executing a source block. Matt >From 24d156e421973b5a97f1c797d48f1daa95348898 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Wed, 2

[PATCH] Omit file description when :file-desc has nil value

2020-09-03 Thread Matt Huszagh
quot; part of the link will be omitted. Full disclaimer: I wrote this section of the documentation as part of this patch: https://lists.gnu.org/archive/html/emacs-orgmode/2020-07/msg00320.html Thanks Matt >From edcfa85add6ac71a1e13b7731779ccf4a8e12868 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Dat

Re: [PATCH] babel latex headers and image generation commands

2020-09-02 Thread Matt Huszagh
Matt Huszagh writes: > I've added a few changes to the patch that additionally allow custom the > begin and end document environments. The purpose here is to allow latex > code within the document environment that is ignored by the body > export. For instance, I can set th

Re: [PATCH] babel latex headers and image generation commands

2020-09-02 Thread Matt Huszagh
Matt Huszagh writes: > Ok, I've finally gotten around to taking a crack at this. The patch is > attached. Basically, it allows a lot more control when converting a > latex source block into an svg image file. I've added a few changes to the patch that additionally allow custom the begi

Re: babel default header args as functions

2020-09-02 Thread Matt Huszagh
Matt Huszagh writes: > I've generated a patch for this. Please let me know your thoughts. I > believe this adds valuable flexibility to default header > arguments. I've added an additional fix that makes this work during export too. >From aec4e905d5d72f9a124adfde877835a783bd637b M

Re: babel latex headers and image generation commands

2020-08-29 Thread Matt Huszagh
invasive to these workflows, though it will break workflows in an easily recoverable way for anyone using htlatex for svg output. Anyway, I'd be curious to hear thoughts and I'd be interested to discuss options for further refactoring the latex execute function. Matt On Fri, Aug 28, 2020 at 11:10 PM

Re: babel default header args as functions

2020-08-28 Thread Matt Huszagh
Matt Huszagh writes: > I've added the ability in my own configuration to use lambda functions > that evaluate to a string as babel default header arguments, instead of > just the plain strings currently allowed. Would anyone else be > interested in this feature? Shall I pre

Re: incorrect documentation for file-desc header argument?

2020-07-29 Thread Matt Huszagh
20a24b3416f8f8ba0892a8e47221 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Tue, 28 Jul 2020 22:10:12 -0700 Subject: [PATCH] org-manual.org: Modify file-desc header argument to match action --- doc/org-manual.org | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/org

Re: incorrect documentation for file-desc header argument?

2020-07-28 Thread Matt Huszagh
Matt Huszagh writes: > Hello, > > The org info documentation states > > The ‘file-desc’ header argument defines the description (see *note > Link Format::) for the link. If ‘file-desc’ has no value, Org uses > the generated file name for both the “link” an

incorrect documentation for file-desc header argument?

2020-07-28 Thread Matt Huszagh
Hello, The org info documentation states The ‘file-desc’ header argument defines the description (see *note Link Format::) for the link. If ‘file-desc’ has no value, Org uses the generated file name for both the “link” and “description” parts of the link. However, if I

Re: patch: add custom latex->html conversion command

2020-02-16 Thread Matt Huszagh
Will do, thanks! On Sun, Feb 16, 2020 at 5:10 PM Bastien wrote: > Hi Matt, > > Matt Huszagh writes: > > > Thanks for the feedback. I've filled out the form you sent and sent it > > to the email listed. > > Thanks! It looks good. > > Let me know when you get

Re: patch: add custom latex->html conversion command

2020-02-16 Thread Matt Huszagh
>From 6b2495c8aef0b67fd00ad27a0056e79f42c23c06 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Sun, 16 Feb 2020 16:52:02 -0800 Subject: [PATCH] add custom command option when converting latex fragments to html * lisp/org.el (org-latex-to-html-convert-command): Add custom command opt

Re: patch: add custom latex->html conversion command

2020-02-16 Thread Matt Huszagh
, 2020 at 4:06 PM Bastien wrote: > Hi Matt, > > Matt Huszagh writes: > > > The patch below allow's you to provide your own shell command the > > generates HTML from a latex fragment and places the output directly in > > the exported HTML file. > > Can you get

patch: add custom latex->html conversion command

2020-02-15 Thread Matt Huszagh
iated! >From 056d23d9e5caa6fc22907014e0128519fcc84b6e Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Sat, 15 Feb 2020 18:42:11 -0800 Subject: [PATCH] add custom command option when converting latex fragments to html This allows you to set a custom command `org-latex-to-html-convert-command' that will take as input a latex

babel default header args as functions

2020-02-07 Thread Matt Huszagh
I've added the ability in my own configuration to use lambda functions that evaluate to a string as babel default header arguments, instead of just the plain strings currently allowed. Would anyone else be interested in this feature? Shall I prepare a patch? There are a number of use cases for

babel comma escape with :wrap

2020-02-07 Thread Matt Huszagh
There appears to be no way to disable the comma escape when using :wrap for a babel source block. I'm essentially trying to replicate this example from the manual #+NAME: attr_wrap #+BEGIN_SRC sh :var data="" :var width="\\textwidth" :results output echo "#+ATTR_LATEX: :width

babel link bug

2020-02-07 Thread Matt Huszagh
The patch below fixes a bug with the behavior of link without file for babel source blocks. All explained in patch message, but let me know if any concerns. >From 25d363bbc3cd7122287364f25f9b5d653bcae232 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Fri, 7 Feb 2020 23:09:48 -0800 Subj

Re: latex fragments in html export

2020-02-05 Thread Matt Huszagh
Nvm, I found the issue.

latex fragments in html export

2020-02-05 Thread Matt Huszagh
Hello, Has anyone had success getting the html export to process latex fragments? It's leaving mine completely alone and I can't figure out why. Latex babel source blocks work fine. I've set (setq org-html-with-latex luasvgm) luasvgm is a process-alist element I defined. I went through ox-html

Re: babel latex headers and image generation commands

2020-02-04 Thread Matt Huszagh
I've thought about this more and the solution I presented above isn't quite sufficient for me. I need something where I get complete control over what goes in the latex source block on a block-by-block basis. In other words, I don't want a user-configurable option like org-format-latex-header plus

Re: babel latex headers and image generation commands

2020-02-04 Thread Matt Huszagh
Ok, here's an implementation that seems to be working pretty well so far. `org-latex-img-process` is the new customization. Most of the execute function is unaltered, but I've added the condition: ``` ((and (not imagemagick) (assoc extension org-latex-img-process))

babel latex headers and image generation commands

2020-02-03 Thread Matt Huszagh
I spent some time today trying to get latex babel source blocks to work for me and discovered that calling `org-babel-execute:latex` ignores the :headers header if the output file is a png without setting imagemagick to t. It's easy to see this in the source code: the conditions mentioned above

preview src blocks that generate image files

2020-01-26 Thread Matt Huszagh
Hi, I'm considering adding the ability to display an image preview overlay of source blocks that generate an image file, much in the same way that latex fragments can be previewed. Is anyone else interested in this feature? Any general thoughts/feature requests? Matt

Re: Issues with nested begin..end blocks in inline math environments

2019-12-16 Thread Matt Huszagh
Nicolas Goaziou writes: > I don't think this patch is a good idea, as it mixes elements from > different types: LaTeX fragment (inline), and LaTeX environment (block). > For example, the regexp you modify is used as a paragraph separator, > which doesn't make sense for inline LaTeX. No worries.

Re: Issues with nested begin..end blocks in inline math environments

2019-12-14 Thread Matt Huszagh
I'm submitting this as a patch. I've used it on hundreds of latex fragments over the past week or so and haven't experienced any issues (which is expected since the change is small). >From a699b699ed4132839c39f1152868bb13364422c7 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Sat, 14

Re: Removing horizontal space in latex fragments

2019-12-14 Thread Matt Huszagh
t; > is slightly less low-level. Appreciate the nitpick; your version is better! I've attached an updated patch. Best, Matt >From bdb93a13a43d90ad6e66449797111e836a67a219 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Thu, 5 Dec 2019 23:25:32 -0800 Subject: [PATCH] org.el: Remove l

Re: Issues with nested begin..end blocks in inline math environments

2019-12-07 Thread Matt Huszagh
"Fraga, Eric" writes: > The identification of LaTeX fragments is somewhat fragile (in my > experience). I would suggest you enclose complex LaTeX code fragments > within an #+begin_export latex ... #+end_export environment. > > Assuming your export target is LaTeX and/or PDF. Changing the

Re: Issues with nested begin..end blocks in inline math environments

2019-12-07 Thread Matt Huszagh
"Fraga, Eric" writes: > The identification of LaTeX fragments is somewhat fragile (in my > experience). I would suggest you enclose complex LaTeX code fragments > within an #+begin_export latex ... #+end_export environment. > > Assuming your export target is LaTeX and/or PDF. Thanks for the

Issues with nested begin..end blocks in inline math environments

2019-12-06 Thread Matt Huszagh
I'm experiencing incorrect and seemingly inconsistent behavior when nesting `\begin` `\end` environments inside `\(\)` or `$$`. For example, the following is valid latex code: ``` \(\begin{aligned} b_n &= \frac{1}{\pi} \int_{0}^{\pi} x \sin{\left(nx\right)}dx \\ b_0 &= 0 \\ \int_{0}^{\pi} udv &=

Re: Removing horizontal space in latex fragments

2019-12-06 Thread Matt Huszagh
is preferable. On Thu, Dec 5, 2019 at 2:24 PM Fraga, Eric wrote: > On Thursday, 5 Dec 2019 at 11:03, Matt Huszagh wrote: > > Is anyone else interested in this modification? Should I submit it as a > > patch? > > I think so. And I am not sure all those \n's are necessary. Wi

Removing horizontal space in latex fragments

2019-12-05 Thread Matt Huszagh
I've modified the behavior of `org-create-formula-image' so that `\definecolor' etc do not create unnecessary whitespace in the output PDF. Here's the relevant change: ``` ... ;; remove tex \par at end of line (if (string= (substring string -1 nil) "\n") (aset string

latex preview parallel processes

2019-11-03 Thread Matt Huszagh
Hello. I have an org document with many latex snippets for which I use the org latex preview facility. As the document has gotten bigger, any changes requiring a rebuild of all images (e.g. changing `org-format-latex-header') takes longer and longer to the point where it now takes me over an hour