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 // Check if we have an empty language stack
41 bool languageStackEmpty();
43 /** Return a reference to the last active language opened with
44 polyglossia or when using begin/end commands. If none or when
45 using babel with only a begin command, return a reference to
48 std::string const & openLanguageName();
50 /** Export optional and required arguments of the paragraph \p par.
51 Non-existing required arguments are output empty: {}.
53 void latexArgInsets(Paragraph const & par,
54 otexstream & os, OutputParams const & runparams,
55 Layout::LaTeXArgMap const & latexargs,
56 std::string const & prefix = std::string());
57 /// Same for merged environments
58 void latexArgInsets(ParagraphList const & pars,
59 ParagraphList::const_iterator pit,
60 otexstream & os, OutputParams const & runparams,
61 Layout::LaTeXArgMap const & latexargs,
62 std::string const & prefix = std::string());
63 /// Same for InsetLayouts
64 void latexArgInsetsForParent(ParagraphList const & pars, otexstream & os,
65 OutputParams const & runparams,
66 Layout::LaTeXArgMap const & latexargs,
67 std::string const & prefix = std::string());
68 /** Export \p paragraphs of buffer \p buf to LaTeX.
69 Don't use a temporary stringstream for \p os if the final output is
70 supposed to go to a file.
71 \sa Buffer::writeLaTeXSource for the reason.
73 void latexParagraphs(Buffer const & buf,
77 std::string const & everypar = std::string());
79 /** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
80 \p force forces this also within non-default or -auto encodings.
81 \return (did the encoding change?, number of characters written to \p os)
83 std::pair<bool, int> switchEncoding(odocstream & os,
84 BufferParams const & bparams,
85 OutputParams const &, Encoding const & newEnc,
86 bool force = false, bool noswitchmacro = false);
88 /// FIXME: this should not be visible.
89 void TeXOnePar(Buffer const & buf,
93 OutputParams const & runparams,
94 std::string const & everypar = std::string(),
95 int start_pos = -1, int end_pos = -1,
96 bool const force = false);