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 or begin/end commands.
33 Set \p localswitch to true if a local command switch is used.
35 void pushLanguageName(std::string const & lang, bool localswitch = false);
37 /** Unregister the last language switch when using polyglossia
38 or begin/end commands.
40 void popLanguageName();
42 /** Export optional and required arguments of the paragraph \p par.
43 Non-existing required arguments are output empty: {}.
45 void latexArgInsets(Paragraph const & par,
46 otexstream & os, OutputParams const & runparams,
47 Layout::LaTeXArgMap const & latexargs,
48 std::string const & prefix = std::string());
49 /// Same for merged environments
50 void latexArgInsets(ParagraphList const & pars,
51 ParagraphList::const_iterator pit,
52 otexstream & os, OutputParams const & runparams,
53 Layout::LaTeXArgMap const & latexargs,
54 std::string const & prefix = std::string());
55 /// Same for InsetLayouts
56 void latexArgInsetsForParent(ParagraphList const & pars, otexstream & os,
57 OutputParams const & runparams,
58 Layout::LaTeXArgMap const & latexargs,
59 std::string const & prefix = std::string());
60 /** Export \p paragraphs of buffer \p buf to LaTeX.
61 Don't use a temporary stringstream for \p os if the final output is
62 supposed to go to a file.
63 \sa Buffer::writeLaTeXSource for the reason.
65 void latexParagraphs(Buffer const & buf,
69 std::string const & everypar = std::string());
71 /** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
72 \p force forces this also within non-default or -auto encodings.
73 \return (did the encoding change?, number of characters written to \p os)
75 std::pair<bool, int> switchEncoding(odocstream & os,
76 BufferParams const & bparams,
77 OutputParams const &, Encoding const & newEnc,
80 /// FIXME: this should not be visible.
81 void TeXOnePar(Buffer const & buf,
85 OutputParams const & runparams,
86 std::string const & everypar = std::string(),
87 int start_pos = -1, int end_pos = -1);