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