- Synopsis
texcaller_convert(source text, source_format text, result_format text, max_runs integer) returns bytea stable strict
- Description
These PostgreSQL functions are simple wrappers around the Texcaller C interface library functions, bringing TeX typesetting into the world of relational databases.
Invalid TeX documents are handled gracefully by simply returning NULL
rather than aborting with an error. On failure as well as on success, additional processing information is provided via NOTICEs.
- Example
set standard_conforming_strings = on;
create table documents (
name varchar(32) primary key,
latex_source text
);
insert into documents (name, latex_source) values (
'hello',
'\documentclass{article}\begin{document}Hello world!\end{document}'
);
select
texcaller_convert(latex_source, 'LaTeX', 'PDF', 5)
from
documents
where
name = 'hello';
select
texcaller_convert(
'\documentclass{article}'
|| '\usepackage[utf8x]{inputenc}'
|| '\begin{document}'
|| texcaller_escape_latex('Téxt → "with" $peciäl <characters>')
|| '\end{document}',
'LaTeX', 'PDF', 5
);