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 "ParagraphList.h"
32 /** Register a language switch when using polyglossia.
33 Set \p localswitch to true if the \text<lang> command is used.
35 void pushPolyglossiaLang(std::string const & lang, bool localswitch = false);
37 /** Unregister the last language switch when using polyglossia.
39 void popPolyglossiaLang();
41 /** Export optional and required arguments of the paragraph \p par.
42 Non-existing required arguments are output empty: {}.
44 void latexArgInsets(Paragraph const & par,
45 otexstream & os, OutputParams const & runparams,
46 Layout::LaTeXArgMap const & latexargs,
47 std::string const & prefix = std::string());
48 /// Same for multi-par sequences (e.g. merged environments or InsetLayouts)
49 void latexArgInsets(ParagraphList const & pars, ParagraphList::const_iterator pit,
50 otexstream & os, OutputParams const & runparams,
51 Layout::LaTeXArgMap const & latexargs,
52 std::string const & prefix = std::string());
53 /** Export \p paragraphs of buffer \p buf to LaTeX.
54 Don't use a temporary stringstream for \p os if the final output is
55 supposed to go to a file.
56 \sa Buffer::writeLaTeXSource for the reason.
58 void latexParagraphs(Buffer const & buf,
62 std::string const & everypar = std::string());
64 /** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
65 \p force forces this also within non-default or -auto encodings.
66 \return (did the encoding change?, number of characters written to \p os)
68 std::pair<bool, int> switchEncoding(odocstream & os,
69 BufferParams const & bparams,
70 OutputParams const &, Encoding const & newEnc,
73 /// FIXME: this should not be visible.
74 void TeXOnePar(Buffer const & buf,
78 OutputParams const & runparams,
79 std::string const & everypar = std::string(),
80 int start_pos = -1, int end_pos = -1);