LyXLyx questions: Abstract and Table using Book (AMS)

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Good Mountain
Posts: 9
Joined: Mon Nov 29, 2010 6:00 pm

Lyx questions: Abstract and Table using Book (AMS)

Post by Good Mountain »

Hi there,

I am a newbie in lyx, so be gentle!

I have a few questions I would like to share with you.

I'm using the Book(AMS) this is my preamble:

Code: Select all

\AtBeginDocument{% 
        \addto\captionsspanish{% 
        \renewcommand{\tablename}{Tabla}% 
}} 

\AtBeginDocument{% 
        \addto\captionsspanish{% 
        \renewcommand{\chaptername}{}% 
}} 

\AtBeginDocument{% 
        \addto\captionsenglish{% 
        \renewcommand{\figurename}{Figura}% 
}} 

\usepackage[small]{caption2}
\vrefwarning 

\AtBeginDocument{% 
        \addto\captionsenglish{% 
        \renewcommand{\abstractname}{Resumen}% 
}} 

\usepackage[spanish]{babel}
In my book, its actually a PhD thesis, I need to have a 2 page abstract. When i set the text to Abstract in lyx it only seems to allow a one page abstract. Is there any way to do this? I tried with a \clearpage but didnt work. Ofcourse i could just put a title named abstract and a normal text, but I kind of like the format given by lyx.


----

my second question is concerning table numbering. In my document lyx restarts table numbering in every new section. Can I override this? Otherwise, when I quote a table in my text looks like this
"Refer to table 1 in page 20, and table 1 in page 200".

Thank you for your help!

GG
Last edited by Good Mountain on Thu Dec 02, 2010 11:32 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Lyx questions: Abstract and Table using Book (AMS)

Post by meho_r »

Can you provide an example .lyx file which shows these issues? Fill the file with some dummy text, put it in a .zip archive and attach it to your next post.
Good Mountain
Posts: 9
Joined: Mon Nov 29, 2010 6:00 pm

Lyx questions: Abstract and Table using Book (AMS)

Post by Good Mountain »

meho_r wrote:Can you provide an example .lyx file which shows these issues? Fill the file with some dummy text, put it in a .zip archive and attach it to your next post.
Sure, if it helps.

In the "dummy" lyx file you will see 2 things... 1) The abstact is restrained to one page (no page brake). 2) Though the tables in the lyx document appeared numbered 1 and 2, when you export the pdf they are both table 1, cause they are the 1st table of each chapter.
Attachments
dummy.zip
(1.29 KiB) Downloaded 233 times
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Lyx questions: Abstract and Table using Book (AMS)

Post by meho_r »

Regarding tables, probably the easiest way is to use chngcntr, e.g.:

Code: Select all

\usepackage{chngcntr}
\counterwithin{table}{chapter}
When you put this code into the preamble, you'll get: Table 1.1, Table 1.2, Table 2.1, Table 2.2 etc. If you want tables to be numbered independently of sectioning units (i.e., Table 1, Table 2, Table 3 etc., no matter where they appear), use \counterwithout command instead of \counterwithin.

As for abstract, I suppose it is unusual to have abstract larger than a page. However, to overcome this issue, you may either use another document class (e.g. memoir) or use normal/custom text instead of abstract environment. Probably someone else can explain why is it that "book (AMS)" document class is so restrictive in this regard (sorry, I'm not acquainted with it).
Good Mountain
Posts: 9
Joined: Mon Nov 29, 2010 6:00 pm

Lyx questions: Abstract and Table using Book (AMS)

Post by Good Mountain »

meho_r wrote:Regarding tables, probably the easiest way is to use chngcntr, e.g.:

Code: Select all

\usepackage{chngcntr}
\counterwithin{table}{chapter}
When you put this code into the preamble, you'll get: Table 1.1, Table 1.2, Table 2.1, Table 2.2 etc. If you want tables to be numbered independently of sectioning units (i.e., Table 1, Table 2, Table 3 etc., no matter where they appear), use \counterwithout command instead of \counterwithin.

As for abstract, I suppose it is unusual to have abstract larger than a page. However, to overcome this issue, you may either use another document class (e.g. memoir) or use normal/custom text instead of abstract environment. Probably someone else can explain why is it that "book (AMS)" document class is so restrictive in this regard (sorry, I'm not acquainted with it).
Hey thank you for the code. It worked great! Just the solution I was looking for.

I know abstracts tend to be short, but this is a 300 page thesis so, its quite hard to do such a short brief.
I think I will do it manually, unless someone can suggest a solution. Is there a way to apply different margins to text (Sorry, this is probably confusing. What I mean is that in order to immitate the abstract layout of the Book(AMS) that uses a smaller font and a small column, I would need to widen margins but only to that text).

Thank you once more for the column solution.

GG
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Lyx questions: Abstract and Table using Book (AMS)

Post by meho_r »

Here's one solution: redefinition of abstract environment which enables you to use LyX's built-in facilities instead of creating a new environment. I took the code from "book (AMS)" document class and disabled the part of it which places abstract in a box (i.e. %\global\setbox\abstractbox=\vtop), so it can be larger than a page now. Put into the preamble the following code:

Code: Select all

\makeatletter
\renewenvironment{abstract}{%
  \ifx\maketitle\relax
    \ClassWarning{\@classname}{Abstract should precede
      \protect\maketitle\space in AMS document classes; reported}%
  \fi
  %\global\setbox\abstractbox=\vtop 
   \bgroup
    \normalfont\Small
     \list{}{\labelwidth\z@
      \leftmargin3pc \rightmargin\leftmargin
      \listparindent\normalparindent \itemindent\z@
      \parsep\z@ \@plus\p@
      \let\fullwidthdisplay\relax
    }%
    \item[\hskip\labelsep\scshape\abstractname.]%
}{%
  \endlist\egroup
  \ifx\@setabstract\relax \@setabstracta \fi
}
\makeatother
However, notice that you'll have to put a standard paragraph between the title and the abstract and put a protected vertical or horizontal space (probably of 0pt) in it to make sure the title comes before the abstract, not after it.
Attachments
dummy.lyx.zip
(1.64 KiB) Downloaded 229 times
Good Mountain
Posts: 9
Joined: Mon Nov 29, 2010 6:00 pm

Lyx questions: Abstract and Table using Book (AMS)

Post by Good Mountain »

meho_r wrote:Here's one solution: redefinition of abstract environment which enables you to use LyX's built-in facilities instead of creating a new environment. I took the code from "book (AMS)" document class and disabled the part of it which places abstract in a box (i.e. %\global\setbox\abstractbox=\vtop), so it can be larger than a page now. Put into the preamble the following code:

Code: Select all

\makeatletter
\renewenvironment{abstract}{%
  \ifx\maketitle\relax
    \ClassWarning{\@classname}{Abstract should precede
      \protect\maketitle\space in AMS document classes; reported}%
  \fi
  %\global\setbox\abstractbox=\vtop 
   \bgroup
    \normalfont\Small
     \list{}{\labelwidth\z@
      \leftmargin3pc \rightmargin\leftmargin
      \listparindent\normalparindent \itemindent\z@
      \parsep\z@ \@plus\p@
      \let\fullwidthdisplay\relax
    }%
    \item[\hskip\labelsep\scshape\abstractname.]%
}{%
  \endlist\egroup
  \ifx\@setabstract\relax \@setabstracta \fi
}
\makeatother
However, notice that you'll have to put a standard paragraph between the title and the abstract and put a protected vertical or horizontal space (probably of 0pt) in it to make sure the title comes before the abstract, not after it.
Hey thanx!! Did the trick!

I owe you big time!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Lyx questions: Abstract and Table using Book (AMS)

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.


Thorsten
Post Reply