Same as stored procedures & views adding in publication, we can add functions in publication for transactional replication with following script where you need to change type and add function name as a article.
<pre class="brush: plain"> USE PublisherDB GO exec sp_addarticle @publication = N'PublicationName', @article = N'FunctionName', @source_owner = N'SchemaName', @source_object = N'FunctionName', @type = N'func schema only', @description = N'', @creation_script = N'', @pre_creation_cmd = N'drop', @schema_option = 0x0000000008000001, @destination_table = N'FunctionName', @destination_owner = N'SchemaName', @status = 16 GO </pre>
You can refer previous just learned tip here, http://beyondrelational.com/justlearned/posts/709/add-stored-procedures-in-publication-in-transactional-replication-using-script-sql-server.aspx