]> git.lyx.org Git - lyx.git/blob - src/output_latex.h
* add PreBabelPreamble to Language definition (fixes #4786).
[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 "Paragraph.h"
19 #include "ParIterator.h"
20 #include "ParagraphList.h"
21
22
23 namespace lyx {
24
25 class Buffer;
26 class BufferParams;
27 class Encoding;
28 class Layout;
29 class Paragraph;
30 class OutputParams;
31 class TexRow;
32 class Text;
33
34 /// Export up to \p reqargs required arguments and
35 /// \p optargs optional ones. If not enough required
36 /// ones are given, we'll output: {}. The optional ones
37 /// must all come first.
38 int latexArgInsets(Paragraph const & par,
39                 odocstream & os, OutputParams const & runparams,
40                 unsigned int reqargs, unsigned int optargs);
41
42 /** Export \p paragraphs of buffer \p buf to LaTeX.
43     Don't use a temporary stringstream for \p os if the final output is
44     supposed to go to a file.
45     \sa Buffer::writeLaTeXSource for the reason.
46  */
47 void latexParagraphs(Buffer const & buf,
48                      Text const & text,
49                      odocstream & ofs,
50                      TexRow & texrow,
51                      OutputParams const &,
52                      std::string const & everypar = std::string());
53
54 /** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
55     \p force forces this also within non-default or -auto encodings.
56     \return (did the encoding change?, number of characters written to \p os)
57  */
58 std::pair<bool, int> switchEncoding(odocstream & os,
59                      BufferParams const & bparams,
60                      OutputParams const &, Encoding const & newEnc,
61                      bool force = false);
62
63 /// FIXME: this should not be visible.
64 ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
65                       Text const & text,
66                       ParagraphList::const_iterator pit,
67                       odocstream & os, TexRow & texrow,
68                       OutputParams const & runparams,
69                       std::string const & everypar = std::string(),
70                       int start_pos = -1, int end_pos = -1);
71
72 } // namespace lyx
73
74 #endif