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;
74 /// Do we use the bidi package (which does some reordering and stuff)?
75 bool useBidiPackage() const;
77 /// Same, but for math output, which only matter is XHTML output.
78 MathFlavor math_flavor;
80 /** Are we to write a 'nice' LaTeX file or not.
81 This esentially seems to mean whether InsetInclude, InsetGraphics
82 and InsetExternal should add the absolute path to any external
84 Non-nice LaTeX also includes additional safe line breaks in order to
85 increase the precision of forward/reverse search and error reporting.
89 /** Is this a real child (i.e., compiled as a child)?
90 This depends on wherefrom we export the buffer. Even children
91 that have a master can be compiled standalone.
93 mutable bool is_child;
95 /** moving_arg == true means that the environment in which the inset
96 is typeset is a moving argument. The inset should take care about
97 fragile commands by preceding the latex with \\protect.
101 /** intitle == true means that the environment in which the
102 inset is typeset is part of a title (before a \\maketitle).
103 Footnotes in such environments have moving arguments.
107 /** inbranch == true means that the environment being typeset
108 is inside an active branch inset.
112 /** inulemcmd > 0 means that the environment in which the
113 inset is typeset is part of a ulem or soul command (e.g., \uline,
114 \uuline, \uwave, \sout or \xout). Insets that output latex commands
115 relying on local assignments (such as \cite) should enclose such
116 commands in \mbox{} in order to avoid breakage.
118 mutable int inulemcmd;
120 /** the font at the point where the inset is
122 Font const * local_font;
124 /** Document language babel name
126 std::string document_language;
128 /// main font encoding of the document
129 std::string main_fontenc;
131 /** The master language. Non-null only for child documents.
132 Note that this is not the language of the top level master, but
133 of the direct parent for nested includes.
135 mutable Language const * master_language;
137 /// Active characters
138 std::string active_chars;
140 /** Current stream encoding. Only used for LaTeX.
141 This must be set to the document encoding (via the constructor)
142 before output starts. Afterwards it must be kept up to date for
143 each single character (\sa Paragraph::latex).
144 This does also mean that you need to set it back if you use a
145 copy (e.g. in insets): \code
146 int InsetFoo::latex(..., OutputParams const & runparams_in) const
148 OutputParams runparams(runparams_in);
149 runparams.inComment = true;
151 InsetBla::latex(..., runparams);
153 runparams_in.encoding = runparams.encoding;
157 mutable Encoding const * encoding;
159 /** free_spacing == true means that the inset is in a free-spacing
164 /** This var is set by the return value from BufferParams::writeLaTeX
168 /** Do we use polyglossia (instead of babel)?
170 bool use_polyglossia;
172 /// Do we use the CJK package?
175 /** Are we generating multiple indices?
179 /** Are we using japanese (pLaTeX)?
183 /** Customized bibtex_command
185 std::string bibtex_command;
187 /** Customized index_command
189 std::string index_command;
193 std::string hyperref_driver;
195 /** Line length to use with plaintext or LaTeX export.
199 /** The depth of the current paragraph, set for plaintext
200 * export and used by InsetTabular
204 /** Export data filled in by the latex(), docbook() etc methods.
205 This is a hack: Make it possible to add stuff to constant
206 OutputParams instances.
208 std::shared_ptr<ExportData> exportdata;
210 /** Store labels, index entries (etc.) (in \ref post_macro)
211 * and output them later. This is used in particular to get
212 * labels and index entries (and potentially other fragile commands)
213 * outside of moving arguments (bug 2154)
215 bool postpone_fragile_stuff;
217 /** Stuff to be postponed and output after the current macro
218 * (if \ref postpone_fragile_stuff is true). Used for labels and index
219 * entries in commands with moving arguments (\\section, \\caption etc.)
221 mutable docstring post_macro;
223 /** Whether we are entering a display math inset.
224 * Needed to correctly strike out deleted math in change tracking.
226 mutable bool inDisplayMath;
228 /** Whether we are leaving a display math inset.
229 * Needed to correctly track nested ulem commands in change tracking.
231 mutable bool wasDisplayMath;
233 /** Whether we are inside a comment inset. Insets that are including
234 * external files like InsetGraphics, InsetInclude and InsetExternal
235 * may only write the usual output and must not attempt to do
236 * something with the included files (e.g. copying, converting)
237 * if this flag is true, since they may not exist.
241 /** Whether a btUnit (for multiple biblographies) is open.
243 mutable bool openbtUnit;
245 /** Process only the children's aux files with BibTeX.
246 * This is necessary with chapterbib.
250 /** Whether we are in a table cell.
251 * For newline, it matters whether its content is aligned or not.
253 TableCell inTableCell;
255 /** Whether we are inside a float or subfloat.
256 * Needed for subfloat detection on the command line.
260 /** Whether we are inside an index inset.
261 * ERT needs to know this, due to the active chars.
265 /** Whether we are inside an IPA inset.
266 * Needed for proper IPA output.
270 /** Whether we are inside an inset that is logically deleted.
271 * A value > 0 indicates a deleted inset.
275 /** The change information of the outermost logically deleted inset.
276 * changeOfDeletedInset shall only be evaluated if inDeletedInset > 0.
278 Change changeOfDeletedInset;
280 /** allow output of only part of the top-level paragraphs
281 * par_begin: beginning paragraph
283 mutable pit_type par_begin;
285 /** allow output of only part of the top-level paragraphs
286 * par_end: par_end-1 is the ending paragraph
287 * if par_begin=par_end, output all paragraphs
289 mutable pit_type par_end;
291 /// Id of the last paragraph before an inset
294 /// Last position in the last paragraph before an inset
295 mutable pos_type lastpos;
297 /// is this the last paragraph in the current buffer/inset?
301 /** whether or not to do actual file copying and image conversion
302 * This mode will be used to preview the source code
306 /// whether to display output errors or not
309 /// Should we output verbatim or escape LaTeX's special chars?
312 /// Should we output verbatim specific chars?
313 docstring pass_thru_chars;
315 /// A specific newline macro
316 std::string newlinecmd;
318 /// Should we output captions?
319 bool html_disable_captions;
321 /// Are we already in a paragraph?
324 /// Does the present context even permit paragraphs?
327 /// Are we generating this material for inclusion in a TOC-like entity?
330 /// Are we generating this material for inclusion in a tooltip?
333 /// Are we generating this material for use by advanced search?
336 /// Are we generating this material for instant preview?
339 /// Include all children notwithstanding the use of \includeonly
342 /// Explicit output folder, if any is desired
343 std::string export_folder;
349 #endif // NOT OUTPUTPARAMS_H