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
72 OutputParams(Encoding const *);
75 /** The file that we export depends occasionally on what is to
79 /// is it some flavor of LaTeX?
81 /// does this flavour support full unicode?
82 bool isFullUnicode() const;
83 /// Do we use the bidi package (which does some reordering and stuff)?
84 bool useBidiPackage() const;
86 /// Same, but for math output, which only matter is XHTML output.
87 MathFlavor math_flavor;
89 /** Are we to write a 'nice' LaTeX file or not.
90 This essentially seems to mean whether InsetInclude, InsetGraphics
91 and InsetExternal should add the absolute path to any external
93 Non-nice LaTeX also includes additional safe line breaks in order to
94 increase the precision of forward/reverse search and error reporting.
98 /** Is this a real child (i.e., compiled as a child)?
99 This depends on wherefrom we export the buffer. Even children
100 that have a master can be compiled standalone.
102 mutable bool is_child;
104 /** moving_arg == true means that the environment in which the inset
105 is typeset is a moving argument. The inset should take care about
106 fragile commands by preceding the latex with \\protect.
110 /** intitle == true means that the environment in which the
111 inset is typeset is part of a title (before a \\maketitle).
112 Footnotes in such environments have moving arguments.
116 /** need_maketitle == true means that the last layout was a title layout
117 * this is to track when \maketitle needs to be output.
119 mutable bool need_maketitle;
121 /** have_maketitle == true means that \maketitle already hase been output.
123 mutable bool have_maketitle;
125 /** inbranch == true means that the environment being typeset
126 is inside an active branch inset.
130 /** inulemcmd > 0 means that the environment in which the
131 inset is typeset is part of a ulem or soul command (e.g., \uline,
132 \uuline, \uwave, \sout or \xout). Insets that output latex commands
133 relying on local assignments (such as \cite) should enclose such
134 commands in \mbox{} in order to avoid breakage.
136 mutable int inulemcmd;
138 /** the font at the point where the inset is
140 Font const * local_font;
142 /** Document language lyx name
144 std::string document_language;
146 /// main font encoding of the document
147 std::string main_fontenc;
149 /** The master language. Non-null only for child documents.
150 Note that this is not the language of the top level master, but
151 of the direct parent for nested includes.
153 mutable Language const * master_language;
155 /// Active characters
156 std::string active_chars;
158 /** Current stream encoding. Only used for LaTeX.
159 This must be set to the document encoding (via the constructor)
160 before output starts. Afterwards it must be kept up to date for
161 each single character (\sa Paragraph::latex).
162 This does also mean that you need to set it back if you use a
163 copy (e.g. in insets): \code
164 int InsetFoo::latex(..., OutputParams const & runparams_in) const
166 OutputParams runparams(runparams_in);
167 runparams.inComment = true;
169 InsetBla::latex(..., runparams);
171 runparams_in.encoding = runparams.encoding;
175 mutable Encoding const * encoding;
177 /** free_spacing == true means that the inset is in a free-spacing
182 /** This var is set by the return value from BufferParams::writeLaTeX
186 /** Do we use polyglossia (instead of babel)?
188 bool use_polyglossia;
190 /** Do we use hyperref?
194 /// Do we use the CJK package?
197 /** Are we generating multiple indices?
201 /** Are we using japanese (pLaTeX)?
205 /** Customized bibtex_command
207 std::string bibtex_command;
209 /** Customized index_command
211 std::string index_command;
215 std::string hyperref_driver;
217 /** Line length to use with plaintext or LaTeX export.
221 /** The depth of the current paragraph, set for plaintext
222 * export and used by InsetTabular
226 /** Export data filled in by the latex(), docbook(), etc. methods.
227 This is a hack: Make it possible to add stuff to constant
228 OutputParams instances.
230 std::shared_ptr<ExportData> exportdata;
232 /** Store labels, index entries, etc. (in \ref post_macro)
233 * and output them later. This is used in particular to get
234 * labels and index entries (and potentially other fragile commands)
235 * outside of moving arguments (bug 2154)
237 bool postpone_fragile_stuff;
239 /** Stuff to be postponed and output after the current macro
240 * (if \ref postpone_fragile_stuff is true). Used for labels and index
241 * entries in commands with moving arguments (\\section, \\caption etc.)
243 mutable docstring post_macro;
245 /** Whether we are entering a display math inset.
246 * Needed to correctly strike out deleted math in change tracking.
248 mutable bool inDisplayMath;
250 /** Whether we are leaving a display math inset.
251 * Needed to correctly track nested ulem commands in change tracking.
253 mutable bool wasDisplayMath;
255 /** Whether we are inside a comment inset. Insets that are including
256 * external files like InsetGraphics, InsetInclude and InsetExternal
257 * may only write the usual output and must not attempt to do
258 * something with the included files (e.g. copying, converting)
259 * if this flag is true, since they may not exist.
263 /** Whether a btUnit (for multiple biblographies) is open.
265 mutable bool openbtUnit;
267 /** Process only the children's aux files with BibTeX.
268 * This is necessary with chapterbib.
272 /** Whether we are in a table cell.
273 * For newline, it matters whether its content is aligned or not.
275 TableCell inTableCell;
277 /** Whether we are inside a float or subfloat.
278 * Needed for subfloat detection on the command line.
282 /** Whether we are inside an index inset.
283 * ERT needs to know this, due to the active chars.
287 /** Whether we are inside an IPA inset.
288 * Needed for proper IPA output.
292 /** Whether we are inside an inset that is logically deleted.
293 * A value > 0 indicates a deleted inset.
297 /** The change information of the outermost logically deleted inset.
298 * changeOfDeletedInset shall only be evaluated if inDeletedInset > 0.
300 Change changeOfDeletedInset;
302 /** What kind of change tracking object is this?
303 * Relevant for strikeout method in output
305 mutable CtObject ctObject;
307 /** allow output of only part of the top-level paragraphs
308 * par_begin: beginning paragraph
310 mutable pit_type par_begin;
312 /** allow output of only part of the top-level paragraphs
313 * par_end: par_end-1 is the ending paragraph
314 * if par_begin=par_end, output all paragraphs
316 mutable pit_type par_end;
318 /// Id of the last paragraph before an inset
321 /// Last position in the last paragraph before an inset
322 mutable pos_type lastpos;
324 /// is this the last paragraph in the current buffer/inset?
328 /** whether or not to do actual file copying and image conversion
329 * This mode will be used to preview the source code
333 /// whether to display output errors or not
336 /// Should we output verbatim or escape LaTeX's special chars?
339 /// Should we output verbatim specific chars?
340 docstring pass_thru_chars;
342 /// A specific newline macro
343 std::string newlinecmd;
345 /// Should we output captions?
346 bool html_disable_captions;
348 /// Are we already in a paragraph?
351 /// Does the present context even permit paragraphs?
354 /// Are we already in a paragraph?
357 /// Does the present context even permit paragraphs?
358 bool docbook_make_pars;
360 /// Are paragraphs mandatory in this context?
361 bool docbook_force_pars;
363 /// Anchors that should not be output (LyX-side identifier, not DocBook-side).
364 std::set<docstring> docbook_anchors_to_ignore;
366 /// Is the current context a float (such as a table or a figure)?
367 bool docbook_in_float;
369 /// Is the current context a listing?
370 bool docbook_in_listing;
372 /// Is the current context a table?
373 bool docbook_in_table;
375 /// Are we generating this material for inclusion in a TOC-like entity?
378 /// Are we generating this material for inclusion in a tooltip?
381 /// Are we generating this material for use by advanced search?
384 /// Are we generating this material for instant preview?
387 /// Include all children notwithstanding the use of \includeonly
390 /// Explicit output folder, if any is desired
391 std::string export_folder;
397 #endif // NOT OUTPUTPARAMS_H