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
18 #include "ParagraphList.h"
30 /** Register a language switch when using polyglossia or begin/end commands.
31 Set \p localswitch to true if a local command switch is used.
33 void pushLanguageName(std::string const & lang, bool localswitch = false);
35 /** Unregister the last language switch when using polyglossia
36 or begin/end commands.
38 void popLanguageName();
40 /** Return a reference to the last active language opened with
41 polyglossia or when using begin/end commands. If none or when
42 using babel with only a begin command, return a reference to
45 std::string const & openLanguageName();
47 /** Export optional and required arguments of the paragraph \p par.
48 Non-existing required arguments are output empty: {}.
50 void latexArgInsets(Paragraph const & par,
51 otexstream & os, OutputParams const & runparams,
52 Layout::LaTeXArgMap const & latexargs,
53 std::string const & prefix = std::string());
54 /// Same for merged environments
55 void latexArgInsets(ParagraphList const & pars,
56 ParagraphList::const_iterator pit,
57 otexstream & os, OutputParams const & runparams,
58 Layout::LaTeXArgMap const & latexargs,
59 std::string const & prefix = std::string());
60 /// Same for InsetLayouts
61 void latexArgInsetsForParent(ParagraphList const & pars, otexstream & os,
62 OutputParams const & runparams,
63 Layout::LaTeXArgMap const & latexargs,
64 std::string const & prefix = std::string());
65 /** Export \p paragraphs of buffer \p buf to LaTeX.
66 Don't use a temporary stringstream for \p os if the final output is
67 supposed to go to a file.
68 \sa Buffer::writeLaTeXSource for the reason.
70 void latexParagraphs(Buffer const & buf,
74 std::string const & everypar = std::string());
76 /** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
77 \p force forces this also within non-default or -auto encodings.
78 \return (did the encoding change?, number of characters written to \p os)
80 std::pair<bool, int> switchEncoding(odocstream & os,
81 BufferParams const & bparams,
82 OutputParams const &, Encoding const & newEnc,
83 bool force = false, bool noswitchmacro = false);
85 /// FIXME: this should not be visible.
86 void TeXOnePar(Buffer const & buf,
90 OutputParams const & runparams,
91 std::string const & everypar = std::string(),
92 int start_pos = -1, int end_pos = -1,
93 bool const force = false);