]> git.lyx.org Git - features.git/blob - src/output_latex.h
#10285 and #10542 - Add sips as a fallback converter for Mac to provide preview of...
[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 "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.
33     Set \p localswitch to true if the \text<lang> command is used.
34  */
35 void pushPolyglossiaLang(std::string const & lang, bool localswitch = false);
36
37 /** Unregister the last language switch when using polyglossia.
38  */
39 void popPolyglossiaLang();
40
41 /** Export optional and required arguments of the paragraph \p par.
42     Non-existing required arguments are output empty: {}.
43  */
44 void latexArgInsets(Paragraph const & par,
45                     otexstream & os, OutputParams const & runparams,
46                     Layout::LaTeXArgMap const & latexargs,
47                     std::string const & prefix = std::string());
48 /// Same for merged environments
49 void latexArgInsets(ParagraphList const & pars,
50                     ParagraphList::const_iterator pit,
51                     otexstream & os, OutputParams const & runparams,
52                     Layout::LaTeXArgMap const & latexargs,
53                     std::string const & prefix = std::string());
54 /// Same for InsetLayouts
55 void latexArgInsetsForParent(ParagraphList const & pars, otexstream & os,
56                              OutputParams const & runparams,
57                              Layout::LaTeXArgMap const & latexargs,
58                              std::string const & prefix = std::string());
59 /** Export \p paragraphs of buffer \p buf to LaTeX.
60     Don't use a temporary stringstream for \p os if the final output is
61     supposed to go to a file.
62     \sa Buffer::writeLaTeXSource for the reason.
63  */
64 void latexParagraphs(Buffer const & buf,
65                      Text const & text,
66                      otexstream & ofs,
67                      OutputParams const &,
68                      std::string const & everypar = std::string());
69
70 /** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
71     \p force forces this also within non-default or -auto encodings.
72     \return (did the encoding change?, number of characters written to \p os)
73  */
74 std::pair<bool, int> switchEncoding(odocstream & os,
75                      BufferParams const & bparams,
76                      OutputParams const &, Encoding const & newEnc,
77                      bool force = false);
78
79 /// FIXME: this should not be visible.
80 void TeXOnePar(Buffer const & buf,
81                    Text const & text,
82                    pit_type pit,
83                    otexstream & os,
84                    OutputParams const & runparams,
85                    std::string const & everypar = std::string(),
86                    int start_pos = -1, int end_pos = -1);
87
88 } // namespace lyx
89
90 #endif