4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
12 #ifndef OUTPUT_LATEX_H
13 #define OUTPUT_LATEX_H
17 #include "support/docstream.h"
19 #include "Paragraph.h"
20 #include "ParIterator.h"
21 #include "ParagraphList.h"
35 /** Export optional and required arguments of the paragraph \p par.
36 Non-existing required arguments are output empty: {}.
38 void latexArgInsets(Paragraph const & par,
39 otexstream & os, OutputParams const & runparams,
40 Layout::LaTeXArgMap const & latexargs,
41 std::string const & prefix = std::string());
42 /// Same for multi-par sequences (e.g. merged environments or InsetLayouts)
43 void latexArgInsets(ParagraphList const & pars, ParagraphList::const_iterator pit,
44 otexstream & os, OutputParams const & runparams,
45 Layout::LaTeXArgMap const & latexargs,
46 std::string const & prefix = std::string());
47 /** Export \p paragraphs of buffer \p buf to LaTeX.
48 Don't use a temporary stringstream for \p os if the final output is
49 supposed to go to a file.
50 \sa Buffer::writeLaTeXSource for the reason.
52 void latexParagraphs(Buffer const & buf,
56 std::string const & everypar = std::string());
58 /** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
59 \p force forces this also within non-default or -auto encodings.
60 \return (did the encoding change?, number of characters written to \p os)
62 std::pair<bool, int> switchEncoding(odocstream & os,
63 BufferParams const & bparams,
64 OutputParams const &, Encoding const & newEnc,
67 /// FIXME: this should not be visible.
68 void TeXOnePar(Buffer const & buf,
72 OutputParams const & runparams,
73 std::string const & everypar = std::string(),
74 int start_pos = -1, int end_pos = -1);