]> git.lyx.org Git - features.git/blob - src/output_latex.h
Change label "Show Zoom" to "Show Zoom Value"
[features.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 "Layout.h"
18 #include "ParagraphList.h"
19
20
21 namespace lyx {
22
23 class Buffer;
24 class BufferParams;
25 class Encoding;
26 class Paragraph;
27 class OutputParams;
28 class Text;
29
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.
32  */
33 void pushLanguageName(std::string const & lang, bool localswitch = false);
34
35 /** Unregister the last language switch when using polyglossia
36     or begin/end commands.
37  */
38 void popLanguageName();
39
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
43     an empty string.
44  */
45 std::string const & openLanguageName();
46
47 /** Export optional and required arguments of the paragraph \p par.
48     Non-existing required arguments are output empty: {}.
49  */
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.
69  */
70 void latexParagraphs(Buffer const & buf,
71                      Text const & text,
72                      otexstream & ofs,
73                      OutputParams const &,
74                      std::string const & everypar = std::string());
75
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)
79  */
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);
84
85 /// FIXME: this should not be visible.
86 void TeXOnePar(Buffer const & buf,
87                    Text const & text,
88                    pit_type pit,
89                    otexstream & os,
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);
94
95 } // namespace lyx
96
97 #endif