[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] New LaTeX code export option: engraved

From: Max Nikulin
Subject: Re: [PATCH] New LaTeX code export option: engraved
Date: Thu, 5 May 2022 23:48:29 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

On 05/05/2022 22:17, Timothy wrote:
Subject: [PATCH 1/4] ox-latex: Refactor `org-latex-src-block'

When I was trying to fix an issue with caption, I was not brave enough for massive changes. I do not like the original code of the function.

There are some unit tests for exporting of src blocks. Maybe the new option should be tested as well.

+(defun org-latex-src-block--verbatim
+    (src-block info _lang caption caption-above-p _label
+               _num-start _retain-labels _attributes float)

On the one hand I have no a better suggestion, but on the other hand 10 arguments is too much for straightforward code from my point of view. Unsure that getting parameters in each function or passing a property list would not be worse however.

It reminds me a case when a colleague failed in despair trying to figure out what was wrong with his 15 argument fortran function. I do not remember exactly whether it was a missed argument or an extra one. The last one was assumed to be a parameter (constant) and the identifier was not available in debugger since compiler just substituted the number without creation of a symbol and it added even more confusion.

My other notes are rather loosely related to your patches. The issues may be postponed till someone will start a new thread for them. My hope is that some of them might be easily addressed so that they will not need separate testing.

A problem with percent sign in captions is tracked on updates.orgmode.org. Some environments has not fixed yet:

That time I was puzzled why the option is named "multicolumn" while only regular "figure" is added:

+    (cond ((string= "multicolumn" float)
+           (format "\\begin{figure*}[%s]\n%s%s\n%s\\end{figure*}"

If language is added to "#+begin_example:" than the block content is properly fontified in the Emacs buffer. It would be great to treat such example similar to source block during export. When some code is not supposed to be executed, it is natural to use example block. I am curious if new functions may be reused.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]