2003-11-05 12:06:20 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file output_latex.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Lars Gullik Bjønnes
|
2003-11-05 12:06:20 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OUTPUT_LATEX_H
|
|
|
|
#define OUTPUT_LATEX_H
|
|
|
|
|
2007-07-05 19:19:41 +00:00
|
|
|
#include <utility>
|
|
|
|
|
2006-10-19 16:51:30 +00:00
|
|
|
#include "support/docstream.h"
|
2008-11-16 00:12:21 +00:00
|
|
|
#include "Paragraph.h"
|
|
|
|
#include "ParIterator.h"
|
|
|
|
#include "ParagraphList.h"
|
2003-11-05 12:06:20 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2003-11-05 12:06:20 +00:00
|
|
|
class Buffer;
|
2007-01-09 19:25:40 +00:00
|
|
|
class BufferParams;
|
|
|
|
class Encoding;
|
2010-06-04 21:50:08 +00:00
|
|
|
class Layout;
|
2007-04-26 08:30:11 +00:00
|
|
|
class Paragraph;
|
2003-11-05 12:06:20 +00:00
|
|
|
class OutputParams;
|
|
|
|
class TexRow;
|
2008-01-25 13:27:08 +00:00
|
|
|
class Text;
|
2003-11-05 12:06:20 +00:00
|
|
|
|
2010-06-04 21:50:08 +00:00
|
|
|
/// Export up to \p reqargs required arguments and
|
|
|
|
/// \p optargs optional ones. If not enough required
|
|
|
|
/// ones are given, we'll output: {}. The optional ones
|
|
|
|
/// must all come first.
|
|
|
|
int latexArgInsets(Paragraph const & par,
|
|
|
|
odocstream & os, OutputParams const & runparams,
|
|
|
|
unsigned int reqargs, unsigned int optargs);
|
2007-01-30 13:23:21 +00:00
|
|
|
|
2007-01-09 19:25:40 +00:00
|
|
|
/** Export \p paragraphs of buffer \p buf to LaTeX.
|
|
|
|
Don't use a temporary stringstream for \p os if the final output is
|
|
|
|
supposed to go to a file.
|
|
|
|
\sa Buffer::writeLaTeXSource for the reason.
|
|
|
|
*/
|
2003-11-05 12:06:20 +00:00
|
|
|
void latexParagraphs(Buffer const & buf,
|
2008-01-25 13:27:08 +00:00
|
|
|
Text const & text,
|
2006-10-21 00:16:43 +00:00
|
|
|
odocstream & ofs,
|
2003-11-05 12:06:20 +00:00
|
|
|
TexRow & texrow,
|
|
|
|
OutputParams const &,
|
|
|
|
std::string const & everypar = std::string());
|
|
|
|
|
2008-07-20 17:14:10 +00:00
|
|
|
/** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
|
|
|
|
\p force forces this also within non-default or -auto encodings.
|
|
|
|
\return (did the encoding change?, number of characters written to \p os)
|
|
|
|
*/
|
2007-12-17 10:53:38 +00:00
|
|
|
std::pair<bool, int> switchEncoding(odocstream & os,
|
2007-07-05 19:19:41 +00:00
|
|
|
BufferParams const & bparams,
|
2008-07-20 17:14:10 +00:00
|
|
|
OutputParams const &, Encoding const & newEnc,
|
|
|
|
bool force = false);
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2008-11-16 00:12:21 +00:00
|
|
|
/// FIXME: this should not be visible.
|
|
|
|
ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
|
|
|
|
Text const & text,
|
|
|
|
ParagraphList::const_iterator pit,
|
|
|
|
odocstream & os, TexRow & texrow,
|
|
|
|
OutputParams const & runparams,
|
|
|
|
std::string const & everypar = std::string(),
|
|
|
|
int start_pos = -1, int end_pos = -1);
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2003-11-05 12:06:20 +00:00
|
|
|
#endif
|