]> git.lyx.org Git - lyx.git/blob - src/output_latex.h
Account for old versions of Pygments
[lyx.git] / src / output_latex.h
1 // -*- C++ -*-
2 /**
3  * \file output_latex.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef OUTPUT_LATEX_H
13 #define OUTPUT_LATEX_H
14
15 #include <utility>
16
17 #include "support/docstream.h"
18 #include "Layout.h"
19 #include "ParagraphList.h"
20
21
22 namespace lyx {
23
24 class Buffer;
25 class BufferParams;
26 class Encoding;
27 class Layout;
28 class Paragraph;
29 class OutputParams;
30 class Text;
31
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.
34  */
35 void pushLanguageName(std::string const & lang, bool localswitch = false);
36
37 /** Unregister the last language switch when using polyglossia
38     or begin/end commands.
39  */
40 void popLanguageName();
41
42 /** Export optional and required arguments of the paragraph \p par.
43     Non-existing required arguments are output empty: {}.
44  */
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.
64  */
65 void latexParagraphs(Buffer const & buf,
66                      Text const & text,
67                      otexstream & ofs,
68                      OutputParams const &,
69                      std::string const & everypar = std::string());
70
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)
74  */
75 std::pair<bool, int> switchEncoding(odocstream & os,
76                      BufferParams const & bparams,
77                      OutputParams const &, Encoding const & newEnc,
78                      bool force = false);
79
80 /// FIXME: this should not be visible.
81 void TeXOnePar(Buffer const & buf,
82                    Text const & text,
83                    pit_type pit,
84                    otexstream & os,
85                    OutputParams const & runparams,
86                    std::string const & everypar = std::string(),
87                    int start_pos = -1, int end_pos = -1);
88
89 } // namespace lyx
90
91 #endif