2003-04-17 15:05:17 +00:00
|
|
|
#ifndef TEX2LYX_H
|
|
|
|
#define TEX2LYX_H
|
|
|
|
|
|
|
|
#include "texparser.h"
|
2003-07-28 21:58:09 +00:00
|
|
|
#include "lyxtextclass.h"
|
2003-04-17 15:05:17 +00:00
|
|
|
|
|
|
|
#include <iosfwd>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2003-07-26 00:15:38 +00:00
|
|
|
class LyXTextClass;
|
2003-04-17 15:05:17 +00:00
|
|
|
|
2003-07-26 00:15:38 +00:00
|
|
|
LyXTextClass const parse_preamble(Parser & p, std::ostream & os);
|
2003-04-17 15:05:17 +00:00
|
|
|
|
2003-07-28 21:58:09 +00:00
|
|
|
void parse_text(Parser & p, std::ostream & os, unsigned flags, bool outer,
|
|
|
|
LyXTextClass const & textclass,
|
|
|
|
LyXLayout_ptr layout_ptr = LyXLayout_ptr());
|
|
|
|
|
2003-07-28 23:50:24 +00:00
|
|
|
void parse_text_in_inset(Parser & p, std::ostream & os, unsigned flags,
|
|
|
|
bool outer, LyXTextClass const & textclass,
|
|
|
|
LyXLayout_ptr layout = LyXLayout_ptr());
|
2003-04-17 15:05:17 +00:00
|
|
|
|
|
|
|
void parse_table(Parser & p, std::ostream & os, unsigned flags);
|
|
|
|
|
|
|
|
void parse_math(Parser & p, std::ostream & os, unsigned flags, mode_type mode);
|
|
|
|
|
2003-07-26 00:15:38 +00:00
|
|
|
void handle_tabular(Parser & p, std::ostream & os,
|
|
|
|
LyXTextClass const & textclass);
|
2003-04-17 15:05:17 +00:00
|
|
|
|
|
|
|
// Helper
|
2003-07-26 00:15:38 +00:00
|
|
|
std::string parse_text(Parser & p, unsigned flags, const bool outer,
|
2003-07-28 21:58:09 +00:00
|
|
|
LyXTextClass const & textclass,
|
|
|
|
LyXLayout_ptr layout_ptr = LyXLayout_ptr());
|
2003-04-17 15:05:17 +00:00
|
|
|
|
2003-07-28 23:50:24 +00:00
|
|
|
void check_end_layout(std::ostream & os);
|
2003-04-17 15:05:17 +00:00
|
|
|
void handle_comment(Parser & p);
|
|
|
|
std::string const trim(std::string const & a, char const * p = " \t\n\r");
|
|
|
|
|
2003-06-30 11:36:08 +00:00
|
|
|
void split(std::string const & s, std::vector<std::string> & result,
|
|
|
|
char delim = ',');
|
|
|
|
std::string join(std::vector<std::string> const & input,
|
|
|
|
char const * delim);
|
2003-04-17 15:05:17 +00:00
|
|
|
|
|
|
|
bool is_math_env(std::string const & name);
|
2003-06-30 11:36:08 +00:00
|
|
|
char const ** is_known(std::string const & str, char const ** what);
|
2003-04-17 15:05:17 +00:00
|
|
|
|
|
|
|
// Access to environment stack
|
2003-04-23 15:14:43 +00:00
|
|
|
extern std::vector<std::string> active_environments;
|
|
|
|
std::string active_environment();
|
2003-04-17 15:05:17 +00:00
|
|
|
|
|
|
|
#endif
|