pdf/kramdown_latexnist/lib/kramdown/converter/latexnist.rb
# Helper method used by +convert_p+ to convert a paragraph that only contains a single :img
# element.
Helper method used by +convert_p+ to convert a paragraph that only contains a single :img
element.
Helper method used by + convert_p + to convert a paragraph that only contains a single : img element .
def convert_standalone_image(el, _opts, img)
				child = el.children.first
				if child.attr['latex-fig']
					attrs = attribute_list(el)
					if child.attr['latex-place']
						placement = '[' + child.attr['latex-place'] + ']'
					else
						placement = '[h]'
					end
					"\\begin{figure}#{placement}#{attrs}\n\\centering\n#{img}\n\n" \
					"\\renewcommand{\\figurename}{Figure}\n" \
					"\\renewcommand{\\thefigure}{#{child.attr['latex-fig']}}\n" \
					"\\caption{#{escape(child.attr['title'] || child.attr['alt'] || '')}}\n" \
					"\\hypertarget{fig-#{child.attr['latex-fig']}}{}\\label{fig-#{child.attr['latex-fig']}}\n" \
					"#{latex_link_target(el, true)}\n\\end{figure}#{attrs}\n"
				else
					super
				end
			end
def convert_standalone_image ( el , _opts , img ) child = el . children . first if child . attr [ 'latex-fig' ] attrs = attribute_list ( el ) if child . attr [ 'latex-place' ] placement = '[' + child . attr [ 'latex-place' ] + ']' else placement = '[h]' end "\\begin{figure}#{placement}#{attrs}\n\\centering\n#{img}\n\n" "\\renewcommand{\\figurename}{Figure}\n" "\\renewcommand{\\thefigure}{#{child.attr['latex-fig']}}\n" "\\caption{#{escape(child.attr['title'] || child.attr['alt'] || '')}}\n" "\\hypertarget{fig-#{child.attr['latex-fig']}}{}\\label{fig-#{child.attr['latex-fig']}}\n" "#{latex_link_target(el, true)}\n\\end{figure}#{attrs}\n" else super end end
Helper method used by +convert_p+ to convert a paragraph that only contains a single :img
element.
Helper method used by + convert_p + to convert a paragraph that only contains a single : img element .
el
<not_specific>
_opts
<not_specific>
img
<not_specific>