I am new to LyX, and am using v2.1.2 with the book class. In addition to help with my specific questions, I would appreciate any feedback if there is a better way to achieve my desired results. Sorry if this is overly long, I was not sure how to break it into smaller posts given the background information necessary to understanding the problems.
I have made several new environments based on 'quotation' to set notice, caution, and warning messages apart from normal paragraphs, to emphasize them in a user manual. These special paragraphs have wider margins, may have bold text, may have different color text, and will begin with a label of the type of message: 'Note:', 'Warning:', 'Caution:'. I would like to use a hanging indent so the label stands alone to the left of the paragraph:
Note: Efdfd gdgfdf dgdfd dfere dfere geef geeds etjlj gelj ekjld glegee
ljkjlj ekek eskie ekeke.
I have moved stdlayouts.inc from the programs area (Windows) to the user area, duplicated the 'Quotation' style, and modified it into a new style 'Note' as shown below (similar styles for 'Caution' and 'Warning' have also been added but are not shown here):
Style Note
Category MainText
Margin Static
LatexType Environment
LatexName note
LabelString "NOTE: "
NextNoIndent 1
LeftMargin MMM
RightMargin MMM
ParIndent 0
ParSkip 0
ItemSep 0
TopSep 0.5
BottomSep 0.5
ParSep 0.2
Align Block
AlignPossible Block, Left, Right, Center
Font
Series Bold
Color Black
EndFont
HTMLTag blockquote
HTMLItem div
Preamble
\newenvironment{note}
{\quotation\hangindent=2cm\color[rgb]{1,0.2,0.3}{NOTE: }}
{\endquotation}
EndPreamble
End
The pdf output is very close to what I want. The wider margins, bold font, and color are all working, but the hanging indent is not. Also, the second 'note' paragraph is the same color as the following 'caution' paragraph rather than the color of the first 'note' paragraph.
'Note' and 'Caution' PDF Output:
LyX code using 'Note' and 'Caution':
These safety-related terms appear in this manual:
\begin{note}
Statements identify information that you should consider before moving
to the next instruction or choice. Statements identify information
that you should consider before moving to the next instruction or
choice. Statements identify information that you should consider before
moving to the next instruction or choice.
Statements identify information that you should consider before moving
to the next instruction or choice. Statements identify information
that you should consider before moving to the next instruction or
choice. Statements identify information that you should consider before
moving to the next instruction or choice.\end{note}
\begin{caution}
Statements identify conditions or practices that could result in damage
to the equipment, the software, or other property.\end{caution}
Question 0: The second 'note' paragraph is definitely in the 'note' environment, see LyX code immediately above, so why is the color in the second paragraph different in the pdf output (it is OK in the LyX display)? How do I fix it?
Question 1: How do I get the hanging indent to work, and how to code the length of the label to get the indentation right for different length labels? I would like to use this on the pdf output and for LyX's on screen display.
Question 2: If I decide not to use the hanging indent, how do I change the 'note' environment so each paragraph in the pdf output does not start with an indentation? The LyX display is OK here.
Question 3: In the 'note' style I tried to add a LabelString to use "Note: " as a prefix to the paragraph in the LyX display, so that it would not need to be typed in each time. This is not working (I am just guessing on how to do this). Is this possible, and if so, how? The environment code does do this correctly in the pdf output.
Question 4: Is there any way to add a graphic to the beginning of the 'note' or 'caution' paragraph so that it will show up in both the LyX display and the pdf output?
Question 5: Is there any document that describes the various parameters used in the .inc file's style sections? I have not been able to find any reference.
Thank you!
Aucun commentaire:
Enregistrer un commentaire