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