I want to color some paragraphs that contain formulas, but I get an error when filling out the PDF.

For example in the following example:

#LyX 2.4 created this file. For more info see https://www.lyx.org/ \lyxformat 620 \begin_document \begin_header \save_transient_properties true \origin unavailable \textclass amsbook \begin_preamble \usepackage{xcolor} \colorlet{BLACK}{black} \colorlet{BLUE}{blue} \usepackage{pstricks} \usepackage{hyperref} \usepackage{listings} \lstset{ basicstyle=\small\ttfamily, keywordstyle=\color{blue}\bfseries, commentstyle=\color{purple}, identifierstyle=\color{green!40!black}, stringstyle=\color{orange}} \end_preamble \use_default_options false \begin_modules theorems-ams eqs-within-sections figs-within-sections \end_modules \maintain_unincluded_children no \language english \language_package default \inputencoding utf8 \fontencoding auto \font_roman "times" "default" \font_sans "helvet" "default" \font_typewriter "courier" "default" \font_math "auto" "auto" \font_default_family default \use_non_tex_fonts false \font_sc false \font_roman_osf false \font_sans_osf false \font_typewriter_osf false \font_sf_scale 100 100 \font_tt_scale 100 100 \use_microtype false \use_dash_ligatures true \graphics default \default_output_format default \output_sync 0 \bibtex_command default \index_command default \paperfontsize 12 \spacing single \use_hyperref false \papersize default \use_geometry false \use_package amsmath 2 \use_package amssymb 2 \use_package cancel 1 \use_package esint 0 \use_package mathdots 0 \use_package mathtools 1 \use_package mhchem 0 \use_package stackrel 1 \use_package stmaryrd 1 \use_package undertilde 1 \cite_engine basic \cite_engine_type default \biblio_style plain \use_bibtopic false \use_indices false \paperorientation portrait \suppress_date false \justification true \use_refstyle 0 \use_formatted_ref 0 \use_minted 0 \use_lineno 0 \index Index \shortcut idx \color #008000 \end_index \secnumdepth 1 \tocdepth 1 \paragraph_separation indent \paragraph_indentation default \is_math_indent 0 \math_numbering_side default \quotes_style english \dynamic_quotes 0 \papercolumns 1 \papersides 1 \paperpagestyle default \tablestyle default \tracking_changes false \output_changes false \change_bars false \postpone_fragile_content false \html_math_output 0 \html_css_as_file 0 \html_be_strict false \docbook_table_output 0 \docbook_mathml_prefix 1 \end_header \begin_body \begin_layout Standard \color red Colored formulas. \end_layout \begin_layout Standard \color red \begin_inset Formula \[ I=\int_{-\infty}^{\infty}\frac{1}{1+x^{2}}dx \] \end_inset \begin_inset Formula \[ I=\pi \] \end_inset \end_layout \end_body \end_document

I get the following error message:

Runaway argument? { \[ I=\int _{-\infty }^{\infty }\frac {1}{1+x^{2}}dx \] ! Paragraph ended before \@textcolor was complete. <to be read again> \par l.49 I suspect you've forgotten a `}', causing me to apply this control sequence to too much text. How can we recover? My plan is to forget the whole thing and hope for the best.

Suggestions?

Thank you

Stefano
-- 
lyx-users mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-users

Reply via email to