Method: MaRuKu::Out::Latex#to_latex_entity

Defined in:
lib/maruku/output/to_latex_entities.rb

#to_latex_entityObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/maruku/output/to_latex_entities.rb', line 28

def to_latex_entity 
	MaRuKu::Out::Latex.need_entity_table
	
	entity_name = self.entity_name

	entity = ENTITY_TABLE[entity_name]
	if not entity
		maruku_error "I don't know how to translate entity '#{entity_name}' "+
		"to LaTeX."
		return ""
	end
	replace = entity.latex_string
	
	entity.latex_packages.each do |p|
		@doc.latex_require_package p
	end
	
#		if replace =~ /^\\/
#			replace = replace + " "
#		end
	
		if replace
		return replace + "{}"
	else
		tell_user "Cannot translate entity #{entity_name.inspect} to LaTeX."
		return entity_name
	end
end