@@ -49,6 +49,18 @@ local function unlabeled_div()
4949 return " unlabeled-div-" .. (counter )
5050end
5151
52+ -- return [name] for latex, and (name) for html
53+ local function get_name (format , options )
54+ local name = options [" name" ]
55+ if not name then return " " end
56+ local template = {latex = " [%s]" , html = " (%s)" }
57+ name = string.format (template [format ], name )
58+ print_debug (" name -> " , name )
59+ -- remove data-name from option
60+ options [" name" ] = nil
61+ return name
62+ end
63+
5264-- Get metadata specific to bookdown for this filter
5365Meta = function (m )
5466 bookdownmeta = m .bookdown
@@ -109,23 +121,6 @@ Div = function (div)
109121 print (" [WARNING] data-latex attribute can't be used with one of bookdown custom environment. It has been removed." )
110122 options [" data-latex" ] = nil
111123 end
112-
113- -- return [name] for latex, and (name) for html
114- local function get_name (format , options )
115- local name = options [" name" ]
116- if (name == nil ) then return " " end
117- local template
118- if (format == ' latex' ) then
119- template = " [%s]"
120- elseif (format == ' html' ) then
121- template = " (%s)"
122- end
123- name = string.format (template , name )
124- print_debug (" name -> " , name )
125- -- remove data-name
126- options [" name" ] = nil
127- return name
128- end
129124
130125 -- create the custom environment
131126 local label
0 commit comments