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
71 OutputParams(Encoding const *);
74 /** The file that we export depends occasionally on what is to
78 /// is it some flavor of LaTeX?
80 /// does this flavour support full unicode?
81 bool isFullUnicode() const;
82 /// Do we use the bidi package (which does some reordering and stuff)?
83 bool useBidiPackage() const;
85 /// Same, but for math output, which only matter is XHTML output.
86 MathFlavor math_flavor;
88 /** Are we to write a 'nice' LaTeX file or not.
89 This esentially seems to mean whether InsetInclude, InsetGraphics
90 and InsetExternal should add the absolute path to any external
92 Non-nice LaTeX also includes additional safe line breaks in order to
93 increase the precision of forward/reverse search and error reporting.
97 /** Is this a real child (i.e., compiled as a child)?
98 This depends on wherefrom we export the buffer. Even children
99 that have a master can be compiled standalone.
101 mutable bool is_child;
103 /** moving_arg == true means that the environment in which the inset
104 is typeset is a moving argument. The inset should take care about
105 fragile commands by preceding the latex with \\protect.
109 /** intitle == true means that the environment in which the
110 inset is typeset is part of a title (before a \\maketitle).
111 Footnotes in such environments have moving arguments.
115 /** inbranch == true means that the environment being typeset
116 is inside an active branch inset.
120 /** inulemcmd > 0 means that the environment in which the
121 inset is typeset is part of a ulem or soul command (e.g., \uline,
122 \uuline, \uwave, \sout or \xout). Insets that output latex commands
123 relying on local assignments (such as \cite) should enclose such
124 commands in \mbox{} in order to avoid breakage.
126 mutable int inulemcmd;
128 /** the font at the point where the inset is
130 Font const * local_font;
132 /** Document language babel name
134 std::string document_language;
136 /// main font encoding of the document
137 std::string main_fontenc;
139 /** The master language. Non-null only for child documents.
140 Note that this is not the language of the top level master, but
141 of the direct parent for nested includes.
143 mutable Language const * master_language;
145 /// Active characters
146 std::string active_chars;
148 /** Current stream encoding. Only used for LaTeX.
149 This must be set to the document encoding (via the constructor)
150 before output starts. Afterwards it must be kept up to date for
151 each single character (\sa Paragraph::latex).
152 This does also mean that you need to set it back if you use a
153 copy (e.g. in insets): \code
154 int InsetFoo::latex(..., OutputParams const & runparams_in) const
156 OutputParams runparams(runparams_in);
157 runparams.inComment = true;
159 InsetBla::latex(..., runparams);
161 runparams_in.encoding = runparams.encoding;
165 mutable Encoding const * encoding;
167 /** free_spacing == true means that the inset is in a free-spacing
172 /** This var is set by the return value from BufferParams::writeLaTeX
176 /** Do we use polyglossia (instead of babel)?
178 bool use_polyglossia;
180 /** Do we use hyperref?
184 /// Do we use the CJK package?
187 /** Are we generating multiple indices?
191 /** Are we using japanese (pLaTeX)?
195 /** Customized bibtex_command
197 std::string bibtex_command;
199 /** Customized index_command
201 std::string index_command;
203 /// The Xindy language module
204 std::string xindy_language;
208 std::string hyperref_driver;
210 /** Line length to use with plaintext or LaTeX export.
214 /** The depth of the current paragraph, set for plaintext
215 * export and used by InsetTabular
219 /** Export data filled in by the latex(), docbook() etc methods.
220 This is a hack: Make it possible to add stuff to constant
221 OutputParams instances.
223 std::shared_ptr<ExportData> exportdata;
225 /** Store labels, index entries (etc.) (in \ref post_macro)
226 * and output them later. This is used in particular to get
227 * labels and index entries (and potentially other fragile commands)
228 * outside of moving arguments (bug 2154)
230 bool postpone_fragile_stuff;
232 /** Stuff to be postponed and output after the current macro
233 * (if \ref postpone_fragile_stuff is true). Used for labels and index
234 * entries in commands with moving arguments (\\section, \\caption etc.)
236 mutable docstring post_macro;
238 /** Whether we are entering a display math inset.
239 * Needed to correctly strike out deleted math in change tracking.
241 mutable bool inDisplayMath;
243 /** Whether we are leaving a display math inset.
244 * Needed to correctly track nested ulem commands in change tracking.
246 mutable bool wasDisplayMath;
248 /** Whether we are inside a comment inset. Insets that are including
249 * external files like InsetGraphics, InsetInclude and InsetExternal
250 * may only write the usual output and must not attempt to do
251 * something with the included files (e.g. copying, converting)
252 * if this flag is true, since they may not exist.
256 /** Whether a btUnit (for multiple biblographies) is open.
258 mutable bool openbtUnit;
260 /** Process only the children's aux files with BibTeX.
261 * This is necessary with chapterbib.
265 /** Whether we are in a table cell.
266 * For newline, it matters whether its content is aligned or not.
268 TableCell inTableCell;
270 /** Whether we are inside a float or subfloat.
271 * Needed for subfloat detection on the command line.
275 /** Whether we are inside an index inset.
276 * ERT needs to know this, due to the active chars.
280 /** Whether we are inside an IPA inset.
281 * Needed for proper IPA output.
285 /** Whether we are inside an inset that is logically deleted.
286 * A value > 0 indicates a deleted inset.
290 /** The change information of the outermost logically deleted inset.
291 * changeOfDeletedInset shall only be evaluated if inDeletedInset > 0.
293 Change changeOfDeletedInset;
295 /** What kind of change tracking object is this?
296 * Relevant for strikeout method in output
298 mutable CtObject ctObject;
300 /** allow output of only part of the top-level paragraphs
301 * par_begin: beginning paragraph
303 mutable pit_type par_begin;
305 /** allow output of only part of the top-level paragraphs
306 * par_end: par_end-1 is the ending paragraph
307 * if par_begin=par_end, output all paragraphs
309 mutable pit_type par_end;
311 /// Id of the last paragraph before an inset
314 /// Last position in the last paragraph before an inset
315 mutable pos_type lastpos;
317 /// is this the last paragraph in the current buffer/inset?
321 /** whether or not to do actual file copying and image conversion
322 * This mode will be used to preview the source code
326 /// whether to display output errors or not
329 /// Should we output verbatim or escape LaTeX's special chars?
332 /// Should we output verbatim specific chars?
333 docstring pass_thru_chars;
335 /// A specific newline macro
336 std::string newlinecmd;
338 /// Should we output captions?
339 bool html_disable_captions;
341 /// Are we already in a paragraph?
344 /// Does the present context even permit paragraphs?
347 /// Are we generating this material for inclusion in a TOC-like entity?
350 /// Are we generating this material for inclusion in a tooltip?
353 /// Are we generating this material for use by advanced search?
356 /// Are we generating this material for instant preview?
359 /// Include all children notwithstanding the use of \includeonly
362 /// Explicit output folder, if any is desired
363 std::string export_folder;
369 #endif // NOT OUTPUTPARAMS_H