3

I tried for couple hours changing Chapter, Paragraph...etc styles (especially font and it's color) in LyX, I managed to do that by modifying layout files (for example db_stdsections.inc) by simply adding:

Font
Color Green
End Font

Inside Style Paragraph did the job, and LyX displayed the green paragraphs, but for my surprise, converting it to PDF left it unchanged! It it still Black as usual, what I'm doing wrong?

P.S

I don't what to use local Style, I think it silly to mark text as paragraph environment and then also styling text to give him green color manually, I want both to be applied simultaneously, like in MS Word.

  • I guess (I don't use LyX) that what you did only affects the color in the editor; if you want to change the color of sectional units in the resulting document, you can use one of the packages sectsty or titlesec. – Gonzalo Medina Aug 26 '12 at 0:34
  • Thx, I tried sectsty package, but it has very limited abilities (font & color change only), so I found that using \renewcommand\paragraph much better. – TMS Aug 26 '12 at 8:52
1

I think also that is more useful redefine the paragraph in the preamble or even in the body. Moreover it works with or without Lyx. I left anyway a MWE that I have made before of before seeing your comment.

\documentclass{article}
\usepackage{xcolor}
\setcounter{secnumdepth}{5}
\usepackage{lipsum}

\makeatletter
\renewcommand\paragraph{
\@startsection{paragraph}{4}{0em}%
{-1.3\baselineskip}%
{0.3\baselineskip}%
{\normalfont\bfseries\color{red}}%
}%
\makeatother 

\setcounter{secnumdepth}{4}% numbered
\setcounter{tocdepth}{4}% in toc

\newcommand\PARA[1]{\paragraph{\textcolor{blue}{#1}}}


\begin{document}
\tableofcontents
\section{Section}
\subsection{Subection}
\subsubsection{Sub-subsection}

\paragraph{Lore ipsum} \lipsum[4]

\renewcommand\theparagraph{\hspace{-3em}
\rlap{\textcolor{green}{\Roman{paragraph}.}}\hspace{2em}}

\paragraph{Sed commodo} \lipsum[2]
\PARA{Nulla malesuada} \lipsum[6]

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.