我想定义html代码的组织模式宏,如下所示
#+MACRO: img <div class="figure"><p><img src="dir/$1" alt="$1" width="$2"></p></div>
基本上,这个宏打算将宽度为$ 2的图像$ 1插入到org文件中。但是,当我将其导出到html并打开它时,宏只会被字符串“<div class="figure"><p><img src="dir/$1" alt="$1" width="$2"></p></div>
”替换。
同样,#+MACRO: img #+attr_html: :width $2 \n [[file:dir/$1]]
也不起作用。
有什么想法可以解决这类问题吗?我尝试将#+BEGIN_HTML
和#+END_HTML
插入宏中,但宏仍然被字符串替换为html代码....
提前致谢