Re: List with line break after the item label
I couldn't find a way to do it using enumitem either, but googling about it I found this: http://texblog.net/latex-beginners-guide/examples/chapter-4 The last image that shows how lists work gave me this silly idea of inserting an horizontal space after the label, and apparently it worked. I knew to Latex and Lyx, so I don't know if using horizontal spaces this way is a bad idea, but I got exactly what I wanted. I wish I could make Lyx display it the same way, but it is good enough for me right now. The shortcut for my list: \bind "C-S-k C-S-l" "layout FieldList" And the file fieldlist.inc: # "FieldList" Format 35 Style FieldList Category List MarginManual LatexType List_Environment LatexName fieldlist NextNoindent 1 LabelSep x ParSkip 0.4 TopSep0.7 BottomSep 0.7 ParSep0.5 Align Block AlignPossible Block, Left LabelType Manual LabelFont Family Typewriter EndFont LabelString "0" #define the environment fieldlist Preamble \newenvironment{fieldlist}[1] {\begin{list}{} {\settowidth{\labelwidth}{#1} \setlength{\leftmargin}{\labelwidth} \addtolength{\leftmargin}{\labelsep} \renewcommand{\makelabel}[1]{\texttt{##1}\hspace{1\columnwidth {\end{list}} EndPreamble End Cheers, Fabio. On Fri, Jun 22, 2012 at 1:23 PM, Guenter Milde wrote: > On 2012-06-22, Fabio Sobral wrote: > > > [-- Type: text/plain, Encoding: --] > > > Hello, > > > I'm made a new list layout based on the lyxlist layout, but I'd like to > > insert a line break after the item label to move the text to the next > line. > > Something like this: > > > ItemLabel > > > Text goes here after indent. > > > I checked several layouts but couldn't figure out how to do it. > > You may try the enumitem module. There is no ready-made layout but the > enumitem LaTeX package offers tools to configure lists and to write new > ones. > Read the enumitem documentation (command `texdoc enumitem` on a modern TeX > installation) for details. > > Günter > >
List with line break after the item label
Hello, I'm made a new list layout based on the lyxlist layout, but I'd like to insert a line break after the item label to move the text to the next line. Something like this: ItemLabel Text goes here after indent. I checked several layouts but couldn't figure out how to do it. Cheers, Fabio.
Help with command sequence
Hello, I want to create a shortcut for a minipage with a drop shadw box and line width. After reading the page about command sequences on the wiki ( http://wiki.lyx.org/Tips/CommandSequences) I down to this: "command-sequence box-insert Shadowbox" I just need to set the box width, from columnwidth to linewidth, is this possible? Cheers, Fabio.
Add buttons to toolbars?
Hi folks. The company I work for has always used OpenOffice/LibreOffice to write the software documentation. Recently I convinced everyone to switch to TeX with LyX, so I've been working on a layout for us. Now I'd like to add new buttons on the toolbar to perform simple operations, like change the font family of the selected text to typewriter, or insert a listing. I know I can use keyboard shortcuts for pretty much everything, but we have some clickers here and they are not comfortable with this solution. Thanks in advance, Fabio.
Re: Problems using lyxlist with itemize
Nevermind that, I just found out that I can change the label width of a lyxlist using the paragaph settings. I still don't know why I couldn't use lyxlist using a block of TeX code, but this is no longer an issue for me. Cheers, Fabio. On Fri, Jun 1, 2012 at 1:25 PM, Fabio Sobral wrote: > Hi, > > I have a nested itemized list that looks like this (I'm using numbers > instead of the actual text): > > \begin{itemize} > > > \item 1 > > \begin{itemize} > > \item 1.1 > > \item 1.2 > > \end{itemize} > > > \item 2 > > \begin{itemize} > > \item 2.1 > > \item 2.2 > > \end{itemize} > > > \end{itemize} > > I decided to replace the first itemized list with lyxlists and it worked > fine when done using the button in the toolbar, but I need to change the > value of the labelwidth, so I used copy/paste to copy the latex source of > the lyxlist generated by LyX into a block of TeX code. > It worked fine the first time, so I moved on and replaced the next nested > itemized list and got these errors: > "Environment lyxlist undefined" > "\begin{itemize} on input line XXX ended by \end{lyxlist}" > > I checked the latex source code, but couldn't spot any errors: > > \begin{itemize} > > > \item 1 > > \begin{lyxlist}{labelwidth} > > \item [{1.1}] > > \item [{1.2}] > > \end{lyxlist} > > > \item 2 > > \begin{itemize} > > \item 2.1 > > \item 2.2 > > \end{itemize} > > > \end{itemize} > > > So I reverted my changes to find out what was wrong and noticed that it > only works when the lyxlist is followed by an empty line, which is > automatically removed when the cursor is moved to another line. > Here's what it looks like with the empty line: > > \begin{itemize} > > > \item 1 > > \begin{lyxlist}{labelwidth} > > \item [{1.1}] > > \item [{1.2}] > > \end{lyxlist} > > \begin{lyxlist}{00.00.} > > \item > > \end{lyxlist} > > > \item 2 > > \begin{itemize} > > \item 2.1 > > \item 2.2 > > \end{itemize} > > > \end{itemize} > > > > Thanks in advance. > > Fabio. >
Re: Unable to change the page style using Memoir
I tried using the command \pagestyle in the preamble and it didn't work. Using the page layout in Document > Settings didn't work either. I even tried removing everything else from the preamble, but it always use the plain style (header is empty and footer contains only the page number, which is shown only on the first page of every part or chapter) Cheers, Fabio. On Thu, May 31, 2012 at 6:47 PM, stefano franchi wrote: > Hi Fabio, > > On Thu, May 31, 2012 at 5:53 PM, Fabio Sobral wrote: > > Hello, > > > > I'm new to LyX and TeX and while searching for resources about document > > styling I came across several tutorials. One of them explained how to use > > fancyhdr, which worked perfectly using the book document class. > > Later I came across these blog posts: > > http://hstuart.dk/2007/05/21/styling-the-chapter/ > > http://hstuart.dk/2007/06/12/styling-the-page-footer-and-header/ > > > > So I started using the document class to "book (Memoir)" to style the > > chapters as described in the fist blog spot, but for some reason I can't > > style the page header. > > Changing the page layout using Document > Settings > Page layout doesn't > > work either, it always end up using the "plain" header style. > > > > I tried using fancyhdr again, but it doesn't work. Apparently the memoir > > document class already includes an implementation of it or something like > > that. > > Exactly, memoir implements its own version of the fancyhdr package, so > you should use memoir facilities (in the preamble, or in a separate > config file you would load in your preamble). You may want to take a > look at section 7.2 of the memoir manual for a detailed discussion of > "pagestyles." > A few pagestyle are predefined, and you can just load them with the > command \pagestyle. For instance, \pagestyle{headings} implements the > "headings" page style which does the following: > > The footer is empty. The header contains the folio at the outer side > of the page; > on verso pages the chapter name, number and title, in slanted > uppercase is set at the > spine margin and on recto pages the section number and uppercase title > is set by the > spine margin. > > If none of the predefined style does what you want, you may define > your own (with the \makepagestyle command) and then load it with the > \pagestyle command. Section 7.3 of the manual provides a detailed > discussion of the \makepagestyle command. > > Cheers, > > Stefano > > > -- > __ > Stefano Franchi > Associate Research Professor > Department of Hispanic StudiesPh: +1 (979) 845-2125 > Texas A&M University Fax: +1 (979) 845-6421 > College Station, Texas, USA > > stef...@tamu.edu > http://stefano.cleinias.org >
Problems using lyxlist with itemize
Hi, I have a nested itemized list that looks like this (I'm using numbers instead of the actual text): \begin{itemize} \item 1 \begin{itemize} \item 1.1 \item 1.2 \end{itemize} \item 2 \begin{itemize} \item 2.1 \item 2.2 \end{itemize} \end{itemize} I decided to replace the first itemized list with lyxlists and it worked fine when done using the button in the toolbar, but I need to change the value of the labelwidth, so I used copy/paste to copy the latex source of the lyxlist generated by LyX into a block of TeX code. It worked fine the first time, so I moved on and replaced the next nested itemized list and got these errors: "Environment lyxlist undefined" "\begin{itemize} on input line XXX ended by \end{lyxlist}" I checked the latex source code, but couldn't spot any errors: \begin{itemize} \item 1 \begin{lyxlist}{labelwidth} \item [{1.1}] \item [{1.2}] \end{lyxlist} \item 2 \begin{itemize} \item 2.1 \item 2.2 \end{itemize} \end{itemize} So I reverted my changes to find out what was wrong and noticed that it only works when the lyxlist is followed by an empty line, which is automatically removed when the cursor is moved to another line. Here's what it looks like with the empty line: \begin{itemize} \item 1 \begin{lyxlist}{labelwidth} \item [{1.1}] \item [{1.2}] \end{lyxlist} \begin{lyxlist}{00.00.} \item \end{lyxlist} \item 2 \begin{itemize} \item 2.1 \item 2.2 \end{itemize} \end{itemize} Thanks in advance. Fabio.
Unable to change the page style using Memoir
Hello, I'm new to LyX and TeX and while searching for resources about document styling I came across several tutorials. One of them explained how to use fancyhdr, which worked perfectly using the book document class. Later I came across these blog posts: http://hstuart.dk/2007/05/21/styling-the-chapter/ http://hstuart.dk/2007/06/12/styling-the-page-footer-and-header/ So I started using the document class to "book (Memoir)" to style the chapters as described in the fist blog spot, but for some reason I can't style the page header. Changing the page layout using Document > Settings > Page layout doesn't work either, it always end up using the "plain" header style. I tried using fancyhdr again, but it doesn't work. Apparently the memoir document class already includes an implementation of it or something like that. I'm using Windows XP SP3 and LyX 2.0.3. This is my local layout: Style Chapterstar Copystyle Chapter LatexName chapterstar LabelType Top_Environment LabelString "Unnumbered chapter" LabelFont Series Bold Size LARGE EndFont End This is my preamble: %used by the cover \usepackage{graphicx} % T1 Helvetica scaled \usepackage[T1]{fontenc} \usepackage[scaled]{helvet} \renewcommand*{\familydefault}{\sfdefault} % Chapter style \usepackage{xcolor,calc} \makechapterstyle{combined}{ \setlength{\beforechapskip}{30pt} \setlength{\midchapskip}{-60pt} \setlength{\afterchapskip}{60pt} \renewcommand*{\printchaptername}{} \renewcommand*{\chapnumfont}{\normalfont\sffamily\bfseries\fontsize{80}{0}\selectfont} \renewcommand*{\printchapternum}{\flushright\chapnumfont\textcolor[rgb]{.64,.79,.87}{\thechapter}} \renewcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries} \renewcommand*{\printchaptertitle}[1]{% \raggedright\chaptitlefont\parbox[t]{\textwidth-3cm}{\raggedright##1}} } \chapterstyle{combined} % Code listing \usepackage{listings,color} \definecolor{dkgreen}{RGB}{63,127,95} \definecolor{gray}{rgb}{0.5,0.5,0.5} \definecolor{light-gray}{rgb}{0.925,0.925,0.925} \definecolor{mauve}{RGB}{127,0,85} \lstset{ language=Java, backgroundcolor=\color{light-gray}, basicstyle=\footnotesize\ttfamily, numbers=left, numberstyle=\tiny, numbersep=5pt, tabsize=2, extendedchars=true, breaklines=true, keywordstyle=\color{mauve}\textbf, frame=b, commentstyle=\color{dkgreen}, stringstyle=\color{blue}, showspaces=false, showtabs=false, xleftmargin=17pt, framexleftmargin=17pt, framexrightmargin=5pt, framexbottommargin=4pt, showstringspaces=false } \lstloadlanguages{ %[Visual]Basic %Pascal %C %C++ %XML %HTML Java } %\DeclareCaptionFont{blue}{\color{blue}} %\captionsetup[lstlisting]{singlelinecheck=false, labelfont={blue}, textfont={blue}} \usepackage{caption} \DeclareCaptionFont{white}{\color{white}} \DeclareCaptionFormat{listing}{\colorbox[cmyk]{0.43, 0.35, 0.35,0.01}{\parbox{\textwidth}{\hspace{15pt}#1#2#3}}} \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white, singlelinecheck=false, margin=0pt, font={bf,footnotesize}} % New style chapter star, so we can have unumbered chapters to show in ToC \newcommand{\tocchap}[1]{\addcontentsline{toc}{chapter}{\protect\numberline {}#1}\markboth{\textsc{#1}}{\textsc{#1}}\thispagestyle{plain}} \newcommand{\chapterstar}[1]{\chapter*{#1}\tocchap{#1}} % Sections are not numbered \setcounter{secnumdepth}{0} % Vertical gap between paragraphs \setlength{\parskip}{\medskipamount} Thanks in advance, Fabio.