4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
12 #ifndef OUTPUTPARAMS_H
13 #define OUTPUTPARAMS_H
63 OutputParams(Encoding const *);
66 /** The file that we export depends occasionally on what is to
70 /// is it some flavor of LaTeX?
72 /// does this flavour support full unicode?
73 bool isFullUnicode() const;
75 /// Same, but for math output, which only matter is XHTML output.
76 MathFlavor math_flavor;
78 /** Are we to write a 'nice' LaTeX file or not.
79 This esentially seems to mean whether InsetInclude, InsetGraphics
80 and InsetExternal should add the absolute path to any external
82 Non-nice LaTeX also includes additional safe line breaks in order to
83 increase the precision of forward/reverse search and error reporting.
87 /** Is this a real child (i.e., compiled as a child)?
88 This depends on wherefrom we export the buffer. Even children
89 that have a master can be compiled standalone.
91 mutable bool is_child;
93 /** moving_arg == true means that the environment in which the inset
94 is typeset is a moving argument. The inset should take care about
95 fragile commands by preceding the latex with \\protect.
99 /** intitle == true means that the environment in which the
100 inset is typeset is part of a title (before a \\maketitle).
101 Footnotes in such environments have moving arguments.
105 /** inbranch == true means that the environment being typeset
106 is inside an active branch inset.
110 /** inulemcmd > 0 means that the environment in which the
111 inset is typeset is part of a ulem or soul command (e.g., \uline,
112 \uuline, \uwave, \sout or \xout). Insets that output latex commands
113 relying on local assignments (such as \cite) should enclose such
114 commands in \mbox{} in order to avoid breakage.
116 mutable int inulemcmd;
118 /** the font at the point where the inset is
120 Font const * local_font;
122 /** Document language babel name
124 std::string document_language;
126 /// main font encoding of the document
127 std::string main_fontenc;
129 /** The master language. Non-null only for child documents.
130 Note that this is not the language of the top level master, but
131 of the direct parent for nested includes.
133 mutable Language const * master_language;
135 /** Current stream encoding. Only used for LaTeX.
136 This must be set to the document encoding (via the constructor)
137 before output starts. Afterwards it must be kept up to date for
138 each single character (\sa Paragraph::latex).
139 This does also mean that you need to set it back if you use a
140 copy (e.g. in insets): \code
141 int InsetFoo::latex(..., OutputParams const & runparams_in) const
143 OutputParams runparams(runparams_in);
144 runparams.inComment = true;
146 InsetBla::latex(..., runparams);
148 runparams_in.encoding = runparams.encoding;
152 mutable Encoding const * encoding;
154 /** free_spacing == true means that the inset is in a free-spacing
159 /** This var is set by the return value from BufferParams::writeLaTeX
163 /** Do we use polyglossia (instead of babel)?
165 bool use_polyglossia;
167 /// Do we use the CJK package?
170 /** Are we generating multiple indices?
174 /** Are we using japanese (pLaTeX)?
178 /** Customized bibtex_command
180 std::string bibtex_command;
182 /** Customized index_command
184 std::string index_command;
188 std::string hyperref_driver;
190 /** Line length to use with plaintext or LaTeX export.
194 /** The depth of the current paragraph, set for plaintext
195 * export and used by InsetTabular
199 /** Export data filled in by the latex(), docbook() etc methods.
200 This is a hack: Make it possible to add stuff to constant
201 OutputParams instances.
203 std::shared_ptr<ExportData> exportdata;
205 /** Store labels, index entries (etc.) (in \ref post_macro)
206 * and output them later. This is used in particular to get
207 * labels and index entries (and potentially other fragile commands)
208 * outside of moving arguments (bug 2154)
210 bool postpone_fragile_stuff;
212 /** Stuff to be postponed and output after the current macro
213 * (if \ref postpone_fragile_stuff is true). Used for labels and index
214 * entries in commands with moving arguments (\\section, \\caption etc.)
216 mutable docstring post_macro;
218 /** Whether we are entering a display math inset.
219 * Needed to correctly strike out deleted math in change tracking.
221 mutable bool inDisplayMath;
223 /** Whether we are leaving a display math inset.
224 * Needed to correctly track nested ulem commands in change tracking.
226 mutable bool wasDisplayMath;
228 /** Whether we are inside a comment inset. Insets that are including
229 * external files like InsetGraphics, InsetInclude and InsetExternal
230 * may only write the usual output and must not attempt to do
231 * something with the included files (e.g. copying, converting)
232 * if this flag is true, since they may not exist.
236 /** Whether a btUnit (for multiple biblographies) is open.
238 mutable bool openbtUnit;
240 /** Process only the children's aux files with BibTeX.
241 * This is necessary with chapterbib.
245 /** Whether we are in a table cell.
246 * For newline, it matters whether its content is aligned or not.
248 TableCell inTableCell;
250 /** Whether we are inside a float or subfloat.
251 * Needed for subfloat detection on the command line.
255 /** Whether we are inside an index inset.
256 * ERT needs to know this, due to the active chars.
260 /** Whether we are inside an IPA inset.
261 * Needed for proper IPA output.
265 /** Whether we are inside an inset that is logically deleted.
266 * A value > 0 indicates a deleted inset.
270 /** The change information of the outermost logically deleted inset.
271 * changeOfDeletedInset shall only be evaluated if inDeletedInset > 0.
273 Change changeOfDeletedInset;
275 /** allow output of only part of the top-level paragraphs
276 * par_begin: beginning paragraph
278 mutable pit_type par_begin;
280 /** allow output of only part of the top-level paragraphs
281 * par_end: par_end-1 is the ending paragraph
282 * if par_begin=par_end, output all paragraphs
284 mutable pit_type par_end;
286 /// Id of the last paragraph before an inset
289 /// Last position in the last paragraph before an inset
290 mutable pos_type lastpos;
292 /// is this the last paragraph in the current buffer/inset?
296 /** whether or not to do actual file copying and image conversion
297 * This mode will be used to preview the source code
301 /// whether to display output errors or not
304 /// Should we output verbatim or escape LaTeX's special chars?
307 /// Should we output verbatim specific chars?
308 docstring pass_thru_chars;
310 /// A specific newline macro
311 std::string newlinecmd;
313 /// Should we output captions?
314 bool html_disable_captions;
316 /// Are we already in a paragraph?
319 /// Does the present context even permit paragraphs?
322 /// Are we generating this material for inclusion in a TOC-like entity?
325 /// Are we generating this material for inclusion in a tooltip?
328 /// Are we generating this material for use by advanced search?
331 /// Are we generating this material for instant preview?
334 /// Include all children notwithstanding the use of \includeonly
337 /// Explicit output folder, if any is desired
338 std::string export_folder;
344 #endif // NOT OUTPUTPARAMS_H