1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
6 \use_default_options false
17 \font_typewriter default
18 \font_default_family default
26 \default_output_format default
27 \bibtex_command default
28 \index_command default
29 \paperfontsize default
40 \paperorientation portrait
48 \paragraph_separation indent
49 \paragraph_indentation default
50 \quotes_language english
53 \paperpagestyle default
54 \tracking_changes false
67 \begin_layout Plain Layout
68 This document is currently maintained by Tommaso Cucinotta, the main developer
69 of this feature at the moment.
70 For suggestions, comments or clarification requests regarding this document,
71 as well as for notifying possible issues or bugs arising from the use of
72 this feature, please use the standard support channels of LyX (i.e., bug
73 tracking and mailing lists).
89 \begin_layout Standard
90 The Advanced Find&Replace feature of LyX allows for searching of complex,
91 format-sensitive text segments and mathematics contents within LyX documents.
92 This constitutes an enhancement of the standard (quick) Find&Replace feature.
95 \begin_layout Standard
96 The set of capabilities of the
97 \begin_inset Quotes eld
101 \begin_inset Quotes erd
104 part of the enhanced Find&Replace feature may be summarised as follows:
107 \begin_layout Itemize
108 the text to search for is entered by means of a full-featured LyX mini-editor;
111 \begin_layout Itemize
112 searching of the entered text occurs both within text and within mathematical
113 formulas possibly present in the document;
116 \begin_layout Itemize
117 both searching of text and of mathematical formulas is allowed, where the
118 latter is done by entering mathematics in the usual way the LyX user is
119 accustomed to do; not only entire mathematical formulas are found, but
120 also parts occurring within more complex formulas;
123 \begin_layout Itemize
124 both case-sensitive and case-insensitive search is possible;
127 \begin_layout Itemize
128 search may be restricted so as to match only at word-boundaries;
131 \begin_layout Itemize
132 search may be format-insensitive, so that the searched text is found in
133 any context/style (standard text, section headings, notes, and even mathematics
134 ), or it may be format-sensitive, so that, for example, a word entered with
135 a section heading will only be found within section headings.
138 \begin_layout Standard
139 The set of capabilities related to the
140 \begin_inset Quotes eld
144 \begin_inset Quotes erd
147 part of the Find&Replace feature may be summarised as follows:
150 \begin_layout Itemize
151 the replaced text may be entered by means of a full-featured LyX mini-editor;
154 \begin_layout Itemize
155 replace may optionally preserve capitalisation, so that the replaced text
156 capitalisation is adapted so as to mimic the one of the matching text (i.e.,
157 all lowercase, all uppercase, first uppercase followed by lowercase).
160 \begin_layout Standard
161 The Advanced Find&Replace feature is activated with a set of default options
162 which is suitable for the most common needs.
163 A detailed discussion of the available options follows in Sections
168 \begin_inset CommandInset ref
170 reference "sec:Basic-usage"
179 \begin_inset CommandInset ref
181 reference "sec:Advanced-usage"
188 \begin_layout Section
189 \begin_inset CommandInset label
191 name "sec:Basic-usage"
198 \begin_layout Standard
199 The advanced Find&Replace feature of LyX is activated through the [C-S-f]
200 sequence (Ctrl+Shift+f), or through the
202 Edit->Find&Replace (Advanced)
207 \begin_layout Subsection
211 \begin_layout Standard
217 LyX mini-editor a simple word, and search for occurrences of it by pushing
222 button below it (or just pressing
231 The entered word is found both in text mode and in math mode, and both
232 in emphasized, bold or normal face, and both in section titles and in standard
238 keeps searching forward.
243 searches for the entered text backwards.
246 \begin_layout Subsection
247 Searching for mathematics
250 \begin_layout Standard
251 Mathematical formulas may be searched for by typing in the
256 mini-editor a mathematical formula, such as
257 \begin_inset Formula $x^{2}$
260 or also something more complex like
261 \begin_inset Formula $\frac{x^{2}}{1+x^{2}}$
265 When searching for such formula, it is found both when it is alone and
266 when it occurs in subformulas and nested parts of subformulas, for example
267 the mentioned segments would be found in something like
268 \begin_inset Formula $\frac{x^{2}}{\sqrt{\frac{x^{2}}{1+x^{2}}}}.$
274 \begin_layout Subsection
278 \begin_layout Standard
279 It is also possible to search for text with specific styles.
280 This is done by switching to the
284 pane and unchecking the
292 \begin_layout Enumerate
298 LyX mini-editor a plain word and searching for it would not find instances
299 of the word occurring in emphasized or boldface.
302 \begin_layout Enumerate
308 LyX mini-editor an emphasized or boldface word and searching for it would
309 find the respective instances with same face only, and within the same
311 Note that, for example, an emphasized text is found not only when occurring
312 alone, but also when it is contained in a longer emphasized sentence.
315 \begin_layout Enumerate
321 LyX mini-editor a plain word and giving it a Section style from the style
322 selection dropdown menu, and searching for it, finds occurrences of if
323 only within Section titles.
324 Also, if the text to search is given an emphasized or bold face, in addition
329 style, then it is found only when occurring with the same style.
332 \begin_layout Enumerate
338 LyX mini-editor some mathematics in centered line math (C-S-m) mode, like
340 \begin_inset Formula \[
345 finds only instances of the text within the same kind of mathematical environmen
349 \begin_layout Section
350 \begin_inset CommandInset label
352 name "sec:Advanced-usage"
359 \begin_layout Subsection
360 About using regular expressions in the Find...
364 \begin_layout Standard
365 There is a regular expression based searching facility.
366 Users may arbitrarily insert, within text or math material to search for,
367 regexp-mode insets that allow to enter regular subexpressions.
368 This is done either through the
372 dropdown button or by typing [C-S-r].
373 Characters entered in the
378 LyX mini-editor within regexp insets are matched according to the regular
379 expression matching rules
383 \begin_layout Plain Layout
384 but under the constraint that any subexpression must match a well-formed
385 LyX text segment, i.e., when matching LaTeX code, no segments with unbalanced
386 {} braces are allowed to match subexpressions entered by the user.
391 , while text entered outside regexp insets is matched exactly against the
392 same text in the document.
393 Note that it is allowed to cut and paste regexp-mode insets as usual.
394 Examples of using such a feature may be:
397 \begin_layout Enumerate
398 Searching for all fractions with a given denominator: for example, entering
404 LyX mini-editor the fraction
405 \begin_inset Formula $\frac{.*}{1+x^{2}}$
409 \begin_inset Formula $.*$
412 on the numerator is the match-everything regular expression that may be
413 added by pressing the
415 [Match...]->[Anything]
417 button, or entering the regexp-mode through C-S-r and by typing
418 \begin_inset Formula $.*$
421 , finds all fractions with the given denominator.
424 \begin_layout Enumerate
425 Searching for all text with a given style: for example, after unchecking
437 \begin_inset Formula $.*$
442 regular expression and adding it an emphasized or bold face, finds all
443 emphasized and bold face text, respectively.
445 \begin_inset Formula $.*$
448 regular expression a bullet-list, enumerated or Section style, you can
449 find all bullet or enumerated lists, or section titles.
452 \begin_layout Standard
453 Finally, references to subexpressions in regular expressions may be used
454 as usual, enclosing parts of the expression within round braces
455 \begin_inset Formula $()$
458 , and referring back to them through
459 \begin_inset Formula $\backslash1$
463 \begin_inset Formula $\backslash2$
467 \begin_inset Formula $\backslash$
470 symbol is entered in regular-expression mode by pressing twice the backslash
472 For example, try searching for the
473 \begin_inset Formula $([a-z]+)[[:blank:]]\backslash1$
476 regular expression in order to find word repetitions, if any.
479 \begin_layout Standard
480 Note that back references work both when occurring within the same regular
481 expression, and when occurring in multiple different regular expressions,
482 where numbering of back-referenced sub-expressions is absolute, i.e.,
483 \begin_inset Formula $\backslash1$
486 always refers to the first occurrence of
487 \begin_inset Formula $()$
490 in all entered regular expressions.