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 /** need_maketitle == true means that the last layout was a title layout
106 * this is to track when \maketitle needs to be output.
108 mutable bool need_maketitle;
110 /** have_maketitle == true means that \maketitle already hase been output.
112 mutable bool have_maketitle;
114 /** inbranch == true means that the environment being typeset
115 is inside an active branch inset.
119 /** inulemcmd > 0 means that the environment in which the
120 inset is typeset is part of a ulem command (\uline, \uuline,
121 \uwave, \sout or \xout). Insets that output latex commands relying
122 on local assignments (such as \cite) should enclose such
123 commands in \mbox{} in order to avoid breakage.
125 mutable int inulemcmd;
127 /** the font at the point where the inset is
129 Font const * local_font;
131 /** Document language babel name
133 std::string document_language;
135 /** The master language. Non-null only for child documents.
136 Note that this is not the language of the top level master, but
137 of the direct parent for nested includes.
139 mutable Language const * master_language;
141 /** Current stream encoding. Only used for LaTeX.
142 This must be set to the document encoding (via the constructor)
143 before output starts. Afterwards it must be kept up to date for
144 each single character (\sa Paragraph::latex).
145 This does also mean that you need to set it back if you use a
146 copy (e.g. in insets): \code
147 int InsetFoo::latex(..., OutputParams const & runparams_in) const
149 OutputParams runparams(runparams_in);
150 runparams.inComment = true;
152 InsetBla::latex(..., runparams);
154 runparams_in.encoding = runparams.encoding;
158 mutable Encoding const * encoding;
160 /** free_spacing == true means that the inset is in a free-spacing
165 /** This var is set by the return value from BufferParams::writeLaTeX
169 /** Do we use polyglossia (instead of babel)?
171 bool use_polyglossia;
173 /** Do we use hyperref?
177 /** Are we generating multiple indices?
181 /** Are we using japanese (pLaTeX)?
185 /** Customized bibtex_command
187 std::string bibtex_command;
189 /** Customized index_command
191 std::string index_command;
195 std::string hyperref_driver;
197 /** Line length to use with plaintext or LaTeX export.
201 /** The depth of the current paragraph, set for plaintext
202 * export and used by InsetTabular
206 /** Export data filled in by the latex(), docbook() etc methods.
207 This is a hack: Make it possible to add stuff to constant
208 OutputParams instances.
210 std::shared_ptr<ExportData> exportdata;
212 /** Whether we are entering a display math inset.
213 * Needed to correctly strike out deleted math in change tracking.
215 mutable bool inDisplayMath;
217 /** Whether we are leaving a display math inset.
218 * Needed to correctly track nested ulem commands in change tracking.
220 mutable bool wasDisplayMath;
222 /** Whether we are inside a comment inset. Insets that are including
223 * external files like InsetGraphics, InsetInclude and InsetExternal
224 * may only write the usual output and must not attempt to do
225 * something with the included files (e.g. copying, converting)
226 * if this flag is true, since they may not exist.
230 /** Whether a btUnit (for multiple biblographies) is open.
232 mutable bool openbtUnit;
234 /** Process only the children's aux files with BibTeX.
235 * This is necessary with chapterbib.
239 /** Whether we are in a table cell.
240 * For newline, it matters whether its content is aligned or not.
242 TableCell inTableCell;
244 /** Whether we are inside a float or subfloat.
245 * Needed for subfloat detection on the command line.
249 /** Whether we are inside an index inset.
250 * ERT needs to know this, due to the active chars.
254 /** Whether we are inside an IPA inset.
255 * Needed for proper IPA output.
259 /** Whether we are inside an inset that is logically deleted.
260 * A value > 0 indicates a deleted inset.
264 /** The change information of the outermost logically deleted inset.
265 * changeOfDeletedInset shall only be evaluated if inDeletedInset > 0.
267 Change changeOfDeletedInset;
269 /** allow output of only part of the top-level paragraphs
270 * par_begin: beginning paragraph
272 mutable pit_type par_begin;
274 /** allow output of only part of the top-level paragraphs
275 * par_end: par_end-1 is the ending paragraph
276 * if par_begin=par_end, output all paragraphs
278 mutable pit_type par_end;
280 /// Id of the last paragraph before an inset
283 /// Last position in the last paragraph before an inset
284 mutable pos_type lastpos;
286 /// is this the last paragraph in the current buffer/inset?
290 /** whether or not to do actual file copying and image conversion
291 * This mode will be used to preview the source code
295 /// whether to display output errors or not
298 /// Should we output verbatim or escape LaTeX's special chars?
301 /// Should we output verbatim specific chars?
302 docstring pass_thru_chars;
304 /// Should we output captions?
305 bool html_disable_captions;
307 /// Are we already in a paragraph?
310 /// Does the present context even permit paragraphs?
313 /// Are we generating this material for inclusion in a TOC-like entity?
316 /// Are we generating this material for inclusion in a tooltip?
319 /// Are we generating this material for use by advanced search?
322 /// Are we generating this material for instant preview?
325 /// Include all children notwithstanding the use of \includeonly
328 /// Explicit output folder, if any is desired
329 std::string export_folder;
335 #endif // NOT OUTPUTPARAMS_H