On 08/13/2018 10:31 PM, list_em...@icloud.com wrote:
On Aug 7, 2018, at 11:57 AM, Paul A. Rubin wrote:
On 08/01/2018 07:27 PM, list_em...@icloud.com wrote:
Has anyone successfully used the “abstract” package with LyX?
http://mirror.las.iastate.edu/tex-archive/macros/latex/contrib/abstract/abstract.pdf
I am trying to use it with "Article (Standard Class)” in two-column mode to get
a single-column abstract to appear above the two-column body but am having trouble
because the title page command “\maketitle” is called twice which is very bad. You
can see more details of my experience here but for now I want to keep this message
simple:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg205850.html
Jerry
First, you're using the package wrong. In theory, you should just add the
\usepackage command in the preamble, give it any package options you want
related to the formatting of the abstract title etc., and then add the abstract
in the usual way (using the Abstract environment, no raw LaTeX required). In
particular, your typing the \maketitle command in ERT creates the duplication
you observed.
I first tried adding the package to the preamble and got to messing around with
the LaTeX and ERT trying to fix problems.
That said, it's a PITA to get the abstract package to work with LyX. I'm
attaching two small examples. abstract2.lyx uses the abstract package. I did
not specify any options to it. The keys were (1) to define the title in the
preamble and not use the Title environment, which lets you get away with
specifying the \maketitle command manually, and (2) to stick a forced end of
line at the end of the abstract, to prevent it from butting up against the
first section.
The other attached file, abstract.lyx, accomplishes the same thing without using the
abstract package. IMO it's easier, but may be less desirable if you need to customize
placement of the title "Abstract" or futz with fonts or margins in just the
abstract.
Thanks again for those files. I believe they work as “advertised.” However,
when I tried to add an author, possibly with a footnote attached to the
author’s name, I ran into problems again. I’ve attached modified versions of
your two MWEs. Maybe you have further comments. I didn’t try adding the \author
field to the preamble but I suppose that could work—don’t know about fixing the
footnote problem though.
Jerry
Paul
I'm not sure there is a way to fix the second of your modified files.
Even without an author footnote, the abstract is on a separate page from
the author. For your first version, I think I was able to hack it to do
what you want. The key was to load the abstract package, even though you
won't be using it for the abstract, because it supplies a command named
"\saythanks". Sticking that command in ERT after the \twocolumn[]
command seems to work. I suppose you could look in the abstract package
source code, find the definition of \saythanks, and put that directly in
the preamble (or in a little module). That would free you from loading
the abstract package, just in case it introduces any side effects
somewhere else.
Paul
abstract copy.lyx
Description: application/lyx