Discussion:
hfill with cgloss
Jose Camacho
2011-07-07 12:30:54 UTC
Permalink
Hi,

I am trying to use \hfill with the glossing macro (cgloss or cgloss4e),
but the text after hfill appears attached to the last word of the
sentence, rather than right-justified. Any suggestions on how to work
around this problem?

Thanks,

J.
--
José Camacho
Department of Spanish and Portuguese
Alan Munn
2011-07-07 12:46:33 UTC
Permalink
Hi Jose,

At 8:30 AM -0400 7/7/11, Jose Camacho wrote:
>
>I am trying to use \hfill with the glossing macro (cgloss or
>cgloss4e), but the text after hfill appears attached to the last
>word of the sentence, rather than right-justified. Any suggestions
>on how to work around this problem?

Maybe you're putting the \hfill before the \\ that ends the line
instead of after?

Here's an example:

\documentclass{article}
\usepackage{gb4e,cgloss}
\begin{document}
\begin{exe}
\ex{\gll This is an example.\\
This is a gloss\\\hfill Something right aligned
\trans This is a translation.\hfill Something right aligned}
\end{exe}
\end{document}

Alan

(Needs cgloss, not cgloss4e)

--
Alan Munn amunn-mhe/***@public.gmane.org
Department of Linguistics
and Germanic, Slavic, Asian and African Languages Tel.
517-355-7491
Michigan State University, East Lansing MI 48824 USA Fax 517-432-2736
Jose Camacho
2011-07-07 13:04:26 UTC
Permalink
Hi Alan,

Thanks, I tried this but I get the error "something wrtong, perhaps a
missing item:". Here is the code:

\documentclass[12pt]{article}
\usepackage{linguex}
\usepackage{cgloss4e}

\ex.\label{CLLD}
\ag. {A Pedro, le regalaron un libro.\\\hfill(Spanish)
To Pedro, {\sc cl} gave a book\\
`Pedro, they gave him a book.'}
\bg. A la hermana de Susana, la vi el otro
día.\\\hspace{3.1cm}(Spanish)
to the sister of Susana, {\sc cl} saw the other
day\\
`Susana's sister, I saw her the other day.'

\end{document}


On 7/7/2011 8:46 AM, Alan Munn wrote:
> Hi Jose,
>
> At 8:30 AM -0400 7/7/11, Jose Camacho wrote:
>>
>> I am trying to use \hfill with the glossing macro (cgloss or
>> cgloss4e), but the text after hfill appears attached to the last word
>> of the sentence, rather than right-justified. Any suggestions on how
>> to work around this problem?
>
> Maybe you're putting the \hfill before the \\ that ends the line
> instead of after?
>
> Here's an example:
>
> \documentclass{article}
> \usepackage{gb4e,cgloss}
> \begin{document}
> \begin{exe}
> \ex{\gll This is an example.\\
> This is a gloss\\\hfill Something right aligned
> \trans This is a translation.\hfill Something right aligned}
> \end{exe}
> \end{document}
>
> Alan
>
> (Needs cgloss, not cgloss4e)
>


--
José Camacho
Department of Spanish and Portuguese
Christos Vlachos
2011-07-07 13:15:05 UTC
Permalink
Does the following code work for you?


\documentclass[12pt]{article}
\usepackage{linguex}
\usepackage{cgloss4e}
\begin{document}
\ex.\label{CLLD}
\a. A Pedro, le regalaron un libro.\hfill Spanish\\
To Pedro, {\sc cl} gave a book\\
`Pedro, they gave him a book.'
\b. A la hermana de Susana, la vi el otro día.\hfill Spanish\\
to the sister of Susana, {\sc cl} saw the other day\\
`Susana's sister, I saw her the other day.'
\end{document}

christos


On Jul 7, 2011, at 4:04 PM, Jose Camacho wrote:

> Hi Alan,
>
> Thanks, I tried this but I get the error "something wrtong, perhaps a missing item:". Here is the code:
>
> \documentclass[12pt]{article}
> \usepackage{linguex}
> \usepackage{cgloss4e}
>
> \ex.\label{CLLD}
> \ag. {A Pedro, le regalaron un libro.\\\hfill(Spanish)
> To Pedro, {\sc cl} gave a book\\
> `Pedro, they gave him a book.'}
> \bg. A la hermana de Susana, la vi el otro día.\\\hspace{3.1cm}(Spanish)
> to the sister of Susana, {\sc cl} saw the other day\\
> `Susana's sister, I saw her the other day.'
>
> \end{document}
>
>
> On 7/7/2011 8:46 AM, Alan Munn wrote:
>>
>> Hi Jose,
>>
>> At 8:30 AM -0400 7/7/11, Jose Camacho wrote:
>>>
>>> I am trying to use \hfill with the glossing macro (cgloss or cgloss4e), but the text after hfill appears attached to the last word of the sentence, rather than right-justified. Any suggestions on how to work around this problem?
>>
>> Maybe you're putting the \hfill before the \\ that ends the line instead of after?
>>
>> Here's an example:
>>
>> \documentclass{article}
>> \usepackage{gb4e,cgloss}
>> \begin{document}
>> \begin{exe}
>> \ex{\gll This is an example.\\
>> This is a gloss\\\hfill Something right aligned
>> \trans This is a translation.\hfill Something right aligned}
>> \end{exe}
>> \end{document}
>>
>> Alan
>>
>> (Needs cgloss, not cgloss4e)
>>
>
>
> --
> José Camacho
> Department of Spanish and Portuguese
>
Jose Camacho
2011-07-07 13:33:37 UTC
Permalink
Yes, that works.

J.
On 7/7/2011 9:15 AM, Christos Vlachos wrote:
> Does the following code work for you?
>
>
> \documentclass[12pt]{article}
> \usepackage{linguex}
> \usepackage{cgloss4e}
> \begin{document}
> \ex.\label{CLLD}
> \a. A Pedro, le regalaron un libro.\hfill Spanish\\
> To Pedro, {\sc cl} gave a book\\
> `Pedro, they gave him a book.'
> \b. A la hermana de Susana, la vi el otro día.\hfill Spanish\\
> to the sister of Susana, {\sc cl} saw the
> other day\\
> `Susana's sister, I saw her the other day.'
> \end{document}
>
> christos
>
>
> On Jul 7, 2011, at 4:04 PM, Jose Camacho wrote:
>
>> Hi Alan,
>>
>> Thanks, I tried this but I get the error "something wrtong, perhaps a
>> missing item:". Here is the code:
>>
>> \documentclass[12pt]{article}
>> \usepackage{linguex}
>> \usepackage{cgloss4e}
>>
>> \ex.\label{CLLD}
>> \ag. {A Pedro, le regalaron un libro.\\\hfill(Spanish)
>> To Pedro, {\sc cl} gave a book\\
>> `Pedro, they gave him a book.'}
>> \bg. A la hermana de Susana, la vi el otro
>> día.\\\hspace{3.1cm}(Spanish)
>> to the sister of Susana, {\sc cl} saw the
>> other day\\
>> `Susana's sister, I saw her the other day.'
>>
>> \end{document}
>>
>>
>> On 7/7/2011 8:46 AM, Alan Munn wrote:
>>> Hi Jose,
>>>
>>> At 8:30 AM -0400 7/7/11, Jose Camacho wrote:
>>>>
>>>> I am trying to use \hfill with the glossing macro (cgloss or
>>>> cgloss4e), but the text after hfill appears attached to the last
>>>> word of the sentence, rather than right-justified. Any suggestions
>>>> on how to work around this problem?
>>>
>>> Maybe you're putting the \hfill before the \\ that ends the line
>>> instead of after?
>>>
>>> Here's an example:
>>>
>>> \documentclass{article}
>>> \usepackage{gb4e,cgloss}
>>> \begin{document}
>>> \begin{exe}
>>> \ex{\gll This is an example.\\
>>> This is a gloss\\\hfill Something right aligned
>>> \trans This is a translation.\hfill Something right aligned}
>>> \end{exe}
>>> \end{document}
>>>
>>> Alan
>>>
>>> (Needs cgloss, not cgloss4e)
>>>
>>
>>
>> --
>> José Camacho
>> Department of Spanish and Portuguese
>>
>


--
José Camacho
Department of Spanish and Portuguese
Jose Camacho
2011-07-07 13:57:11 UTC
Permalink
If I place the \hfill command after the last line of gloss, it works.
Thanks to Alan and Christos.

J.
On 7/7/2011 9:15 AM, Christos Vlachos wrote:
> Does the following code work for you?
>
>
> \documentclass[12pt]{article}
> \usepackage{linguex}
> \usepackage{cgloss4e}
> \begin{document}
> \ex.\label{CLLD}
> \a. A Pedro, le regalaron un libro.\hfill Spanish\\
> To Pedro, {\sc cl} gave a book\\
> `Pedro, they gave him a book.'
> \b. A la hermana de Susana, la vi el otro día.\hfill Spanish\\
> to the sister of Susana, {\sc cl} saw the
> other day\\
> `Susana's sister, I saw her the other day.'
> \end{document}
>
> christos
>
>
> On Jul 7, 2011, at 4:04 PM, Jose Camacho wrote:
>
>> Hi Alan,
>>
>> Thanks, I tried this but I get the error "something wrtong, perhaps a
>> missing item:". Here is the code:
>>
>> \documentclass[12pt]{article}
>> \usepackage{linguex}
>> \usepackage{cgloss4e}
>>
>> \ex.\label{CLLD}
>> \ag. {A Pedro, le regalaron un libro.\\\hfill(Spanish)
>> To Pedro, {\sc cl} gave a book\\
>> `Pedro, they gave him a book.'}
>> \bg. A la hermana de Susana, la vi el otro
>> día.\\\hspace{3.1cm}(Spanish)
>> to the sister of Susana, {\sc cl} saw the
>> other day\\
>> `Susana's sister, I saw her the other day.'
>>
>> \end{document}
>>
>>
>> On 7/7/2011 8:46 AM, Alan Munn wrote:
>>> Hi Jose,
>>>
>>> At 8:30 AM -0400 7/7/11, Jose Camacho wrote:
>>>>
>>>> I am trying to use \hfill with the glossing macro (cgloss or
>>>> cgloss4e), but the text after hfill appears attached to the last
>>>> word of the sentence, rather than right-justified. Any suggestions
>>>> on how to work around this problem?
>>>
>>> Maybe you're putting the \hfill before the \\ that ends the line
>>> instead of after?
>>>
>>> Here's an example:
>>>
>>> \documentclass{article}
>>> \usepackage{gb4e,cgloss}
>>> \begin{document}
>>> \begin{exe}
>>> \ex{\gll This is an example.\\
>>> This is a gloss\\\hfill Something right aligned
>>> \trans This is a translation.\hfill Something right aligned}
>>> \end{exe}
>>> \end{document}
>>>
>>> Alan
>>>
>>> (Needs cgloss, not cgloss4e)
>>>
>>
>>
>> --
>> José Camacho
>> Department of Spanish and Portuguese
>>
>


--
José Camacho
Department of Spanish and Portuguese
Daniel Hirst
2011-07-11 06:13:32 UTC
Permalink
I'm trying to produce a LaTeX style sheet for a new Journal (Journal of Speech Sciences).

They want a bibliography with name and date references and Vancouver style formatting. But the two seem to be incompatible with natbib.

Any idea how I can do that?


--------------------------------------------------------------------------------------------------
CNRS Laboratoire Parole et Langage (UMR 6057) - salle B012
Université de Provence, 5 avenue Pasteur
BP 80975
13604 Aix-en-Provence, Cedex 1, France
tel: +33-4-4295-3628 secr: +33-4-4295-3634
---------------------------------------------------------------------------------------------------
Speech Prosody SIG http://aune.lpl.univ-aix.fr/projects/sprosig/
Speech Prosody list: http://uk.groups.yahoo.com/group/speech_prosody
Praat-users list: http://groups.yahoo.com/group/praat-users
List of my publications: http://www.lpl-aix.fr/publi/57
---------------------------------------------------------------------------------------------------
Michael Betsch
2011-07-12 06:27:40 UTC
Permalink
Am 11.07.2011 um 08:13 schrieb Daniel Hirst:

> I'm trying to produce a LaTeX style sheet for a new Journal (Journal
> of Speech Sciences).
>
> They want a bibliography with name and date references and Vancouver
> style formatting. But the two seem to be incompatible with natbib.
>
> Any idea how I can do that?


For the start, try out the makebst package. It produces pretty
arbitrary bst's that are compatible with natbib. You need to be
thoroughly aware of what you want in advance; but you may also start
by playing a bit around with the options in order to learn. You may
then tweak the bst by directly editing the bibtex code; I have found
it more effective to generate some bst with makebst and then only
adding a final tweak manually (writing a bst from scratch would be a
chore).

Michael
David J Weber
2011-07-15 14:10:06 UTC
Permalink
Friends,

I used Scribe before I used LaTeX. (Remember Scribe? Ah
how quickly we forget those who paved the way...) I was writing
a large, data-rich grammar so I defined an environment for
linguistic examples, ones with aligned glosses and a free
translation.

When I switched to LaTeX, I wrote something similar (as a
command rather than environment). Each example starts with a
number in parens, e.g., (283). Then the example is indented
appropriately, starting one column beyond the right paren.

(283) This is an example...

Here's how a simple example is given in the source. "obl10" is
the reference tag. The first line is in the "practical" orthography;
the second, the Quechua example; the third, the morpheme-by-
morpheme gloss; the last, the free translation:

\xmpl{obl10}{
\free{\sf Wara pucllanan caran.}\\
Wara & puk=A3a\bf-na-n &\bf ka-ra-n. \\
ma=F1ana & jugar\sc-sub-3p & ser\sc-pas-3\\
\free{`Ellos iban a jugar ma=F1ana (pero el partido se ha
postergado).'}
}

I'm on the verge of sending another grammar to the printer and
have a problem: between the number and example there is
sometimes a bit of slippage: the number is slightly higher than
the example, i.e., the baselines do not match up. Whether or
not there is slippage depends on the context so I'm guessing
that somewhere there's glue that should be eliminated or
tightened up. Here are the definitions. ex is the body, common
to numbered (\xmpl) and unnumbered (\uxmpl) examples.

% EXAMPLE DEFINITIONS
\newcounter{example}% EXAMPLE COUNTER
\newlength{\ExamNumWid}% WIDTH OF EX NUM W/ PAREN
\newlength{\FreeWid}% WIDTH OF FREE TRANSLAT
\newlength{\NumExSep}% SPACE NUMBER-EXAMPLE
\setlength{\NumExSep}{.6mm}% used to be .5mm 2mm

\newenvironment{ex}{% ENVIR FOR COMMON EXAMPLES
\begin{list}{}%
{\settowidth{\labelwidth}{(\theexample)}
\setlength{\labelsep}{\NumExSep}
\setlength{\leftmargin}{\labelwidth}
\addtolength{\leftmargin}{\labelsep}
\setlength{\itemindent}{0em}
\setlength{\topsep}{0pt}
\setlength{\listparindent}{0em}
\setlength{\FreeWid}{\textwidth}
\addtolength{\FreeWid}{-\LineLenRed}
\addtolength{\FreeWid}{-\leftmargin}}}{\end{list}}

\newcommand{\xmpl}[2]{% SIMPLE NUMBERED EXMPLE
\vskip-\lastskip
\refstepcounter{example}
\label{#1}
\begin{ex}
\item[(\theexample)]
\vskip-\lastskip
\begin{tabular}[t]{@{}*{20}{l@{\ }}l@{}}
#2
\end{tabular}
\end{ex}
}

\newcommand{\uxmpl}[1]{% UNNUMBERED EX
\vskip-\lastskip
\begin{ex}
\item
\begin{tabular}[t]{@{}*{20}{l@{\ }}l@{}}
#1
\end{tabular}
\end{ex}
}

\newcommand{\free}[1]{% FREE TRANSLATION
\multicolumn{20}{@{}l@{}}{\parbox[t]{\FreeWid}{%
\vspace{-8pt}% UGLY UGLY UGLY UGLY UGLY
\begin{freex}
\item#1
\end{freex}}}}
\newenvironment{freex}{\begin{list}{}
{\setlength{\labelwidth}{0pt}
\setlength{\labelsep}{0pt}
\setlength{\leftmargin}{0pt}
\setlength{\itemindent}{0em}
\setlength{\topsep}{0pt}
\setlength{\listparindent}{0em}}}{\end{list}}

ANY IDEAS?

Best, --David
Alan Munn
2011-07-15 15:24:18 UTC
Permalink
David, can you put this code into a working
document? Have you managed to construct a
minimal example that shows the problem?

Alan

At 9:10 AM -0500 7/15/11, David J Weber wrote:
>Friends,
>
>I used Scribe before I used LaTeX. (Remember Scribe? Ah
>how quickly we forget those who paved the way...) I was writing
>a large, data-rich grammar so I defined an environment for
>linguistic examples, ones with aligned glosses and a free
>translation.
>
>When I switched to LaTeX, I wrote something similar (as a
>command rather than environment). Each example starts with a
>number in parens, e.g., (283). Then the example is indented
>appropriately, starting one column beyond the right paren.
>
>(283) This is an example...
>
>Here's how a simple example is given in the source. "obl10" is
>the reference tag. The first line is in the "practical" orthography;
>the second, the Quechua example; the third, the morpheme-by-
>morpheme gloss; the last, the free translation:
>
>\xmpl{obl10}{
>\free{\sf Wara pucllanan caran.}\\
>Wara & puk£a\bf-na-n &\bf ka-ra-n. \\
>mañana & jugar\sc-sub-3p & ser\sc-pas-3\\
>\free{`Ellos iban a jugar mañana (pero el partido se ha
>postergado).'}
>}
>
>I'm on the verge of sending another grammar to the printer and
>have a problem: between the number and example there is
>sometimes a bit of slippage: the number is slightly higher than
>the example, i.e., the baselines do not match up. Whether or
>not there is slippage depends on the context so I'm guessing
>that somewhere there's glue that should be eliminated or
>tightened up. Here are the definitions. ex is the body, common
>to numbered (\xmpl) and unnumbered (\uxmpl) examples.
>
>% EXAMPLE DEFINITIONS
>\newcounter{example}% EXAMPLE COUNTER
>\newlength{\ExamNumWid}% WIDTH OF EX NUM W/ PAREN
>\newlength{\FreeWid}% WIDTH OF FREE TRANSLAT
>\newlength{\NumExSep}% SPACE NUMBER-EXAMPLE
>\setlength{\NumExSep}{.6mm}% used to be .5mm 2mm
>
>\newenvironment{ex}{% ENVIR FOR COMMON EXAMPLES
>\begin{list}{}%
>{\settowidth{\labelwidth}{(\theexample)}
>\setlength{\labelsep}{\NumExSep}
>\setlength{\leftmargin}{\labelwidth}
>\addtolength{\leftmargin}{\labelsep}
>\setlength{\itemindent}{0em}
>\setlength{\topsep}{0pt}
>\setlength{\listparindent}{0em}
>\setlength{\FreeWid}{\textwidth}
>\addtolength{\FreeWid}{-\LineLenRed}
>\addtolength{\FreeWid}{-\leftmargin}}}{\end{list}}
>
>\newcommand{\xmpl}[2]{% SIMPLE NUMBERED EXMPLE
> \vskip-\lastskip
> \refstepcounter{example}
> \label{#1}
> \begin{ex}
> \item[(\theexample)]
> \vskip-\lastskip
> \begin{tabular}[t]{@{}*{20}{l@{\ }}l@{}}
> #2
> \end{tabular}
> \end{ex}
>}
>
>\newcommand{\uxmpl}[1]{% UNNUMBERED EX
> \vskip-\lastskip
> \begin{ex}
> \item
> \begin{tabular}[t]{@{}*{20}{l@{\ }}l@{}}
> #1
> \end{tabular}
> \end{ex}
>}
>
>\newcommand{\free}[1]{% FREE TRANSLATION
> \multicolumn{20}{@{}l@{}}{\parbox[t]{\FreeWid}{%
> \vspace{-8pt}% UGLY UGLY UGLY UGLY UGLY
> \begin{freex}
> \item#1
> \end{freex}}}}
>\newenvironment{freex}{\begin{list}{}
>{\setlength{\labelwidth}{0pt}
>\setlength{\labelsep}{0pt}
>\setlength{\leftmargin}{0pt}
>\setlength{\itemindent}{0em}
>\setlength{\topsep}{0pt}
>\setlength{\listparindent}{0em}}}{\end{list}}
>
>ANY IDEAS?
>
>Best, --David


--
Alan Munn amunn-mhe/***@public.gmane.org
Department of Linguistics
and Germanic, Slavic, Asian and African Languages
Tel. 517-355-7491
Michigan State University, East Lansing MI 48824 USA Fax 517-432-2736
David J Weber
2011-07-16 01:41:24 UTC
Permalink
Alan,

I tried. See the first attachment: sliptest.tex. I put in an example
followed by two boxes. The second box fills a page, so goes to
the second page. Then I reduced the size of the second box to
"pull" on the example. I think I was able to increase the interline
spacing a bit, but I didn't get the splippage effec.

I've included a pdf with two pages of the grammar itself. See
particularly examples 681 and 683, where the effect is very
visible.

--David

> David, can you put this code into a working
> document? Have you managed to construct a
> minimal example that shows the problem?
>
> Alan
>
> At 9:10 AM -0500 7/15/11, David J Weber wrote:
> >Friends,
> >
> >I used Scribe before I used LaTeX. (Remember Scribe? Ah
> >how quickly we forget those who paved the way...) I was writing
> >a large, data-rich grammar so I defined an environment for
> >linguistic examples, ones with aligned glosses and a free
> >translation.
> >
> >When I switched to LaTeX, I wrote something similar (as a
> >command rather than environment). Each example starts with a
> >number in parens, e.g., (283). Then the example is indented
> >appropriately, starting one column beyond the right paren.
> >
> >(283) This is an example...
> >
> >Here's how a simple example is given in the source. "obl10" is
> >the reference tag. The first line is in the "practical" orthography;
> >the second, the Quechua example; the third, the morpheme-by-
> >morpheme gloss; the last, the free translation:
> >
> >\xmpl{obl10}{
> >\free{\sf Wara pucllanan caran.}\\
> >Wara & puk£a\bf-na-n &\bf ka-ra-n. \\
> >mañana & jugar\sc-sub-3p & ser\sc-pas-3\\
> >\free{`Ellos iban a jugar mañana (pero el partido se ha
> >postergado).'}
> >}
> >
> >I'm on the verge of sending another grammar to the printer and
> >have a problem: between the number and example there is
> >sometimes a bit of slippage: the number is slightly higher than
> >the example, i.e., the baselines do not match up. Whether or
> >not there is slippage depends on the context so I'm guessing
> >that somewhere there's glue that should be eliminated or
> >tightened up. Here are the definitions. ex is the body, common
> >to numbered (\xmpl) and unnumbered (\uxmpl) examples.
> >
> >% EXAMPLE DEFINITIONS
> >\newcounter{example}% EXAMPLE COUNTER
> >\newlength{\ExamNumWid}% WIDTH OF EX NUM W/ PAREN
> >\newlength{\FreeWid}% WIDTH OF FREE TRANSLAT
> >\newlength{\NumExSep}% SPACE NUMBER-EXAMPLE
> >\setlength{\NumExSep}{.6mm}% used to be .5mm 2mm
> >
> >\newenvironment{ex}{% ENVIR FOR COMMON EXAMPLES
> >\begin{list}{}%
> >{\settowidth{\labelwidth}{(\theexample)}
> >\setlength{\labelsep}{\NumExSep}
> >\setlength{\leftmargin}{\labelwidth}
> >\addtolength{\leftmargin}{\labelsep}
> >\setlength{\itemindent}{0em}
> >\setlength{\topsep}{0pt}
> >\setlength{\listparindent}{0em}
> >\setlength{\FreeWid}{\textwidth}
> >\addtolength{\FreeWid}{-\LineLenRed}
> >\addtolength{\FreeWid}{-\leftmargin}}}{\end{list}}
> >
> >\newcommand{\xmpl}[2]{% SIMPLE NUMBERED EXMPLE
> > \vskip-\lastskip
> > \refstepcounter{example}
> > \label{#1}
> > \begin{ex}
> > \item[(\theexample)]
> > \vskip-\lastskip
> > \begin{tabular}[t]{@{}*{20}{l@{\ }}l@{}}
> > #2
> > \end{tabular}
> > \end{ex}
> >}
> >
> >\newcommand{\uxmpl}[1]{% UNNUMBERED EX
> > \vskip-\lastskip
> > \begin{ex}
> > \item
> > \begin{tabular}[t]{@{}*{20}{l@{\ }}l@{}}
> > #1
> > \end{tabular}
> > \end{ex}
> >}
> >
> >\newcommand{\free}[1]{% FREE TRANSLATION
> > \multicolumn{20}{@{}l@{}}{\parbox[t]{\FreeWid}{%
> > \vspace{-8pt}% UGLY UGLY UGLY UGLY UGLY
> > \begin{freex}
> > \item#1
> > \end{freex}}}}
> >\newenvironment{freex}{\begin{list}{}
> >{\setlength{\labelwidth}{0pt}
> >\setlength{\labelsep}{0pt}
> >\setlength{\leftmargin}{0pt}
> >\setlength{\itemindent}{0em}
> >\setlength{\topsep}{0pt}
> >\setlength{\listparindent}{0em}}}{\end{list}}
> >
> >ANY IDEAS?
> >
> >Best, --David
>
>
> --
> Alan Munn amunn-mhe/***@public.gmane.org
> Department of Linguistics
> and Germanic, Slavic, Asian and African Languages
> Tel. 517-355-7491
> Michigan State University, East Lansing MI 48824 USA Fax 517-432-2736
>
David J Weber
2011-07-18 14:17:00 UTC
Permalink
Alan, Alexis, and All,

Thanks for the suggestions. I've made a bit of progress but still
have questions.

I'm glad Alan pushed for a test case because that made me
implement a way to run quick experiments, one that I've put to
good use.

Alexis suggestion about a strut made me I noticed something I'd
never realized before: that all the cases of slippage were
examples in which \free was used on the first line.

That pointed to \free, which years ago I marked as "UGLY
UGLY..."; it is such a blatant patch.

> \newcommand{\free}[1]{% FREE TRANSLATION
> \multicolumn{20}{@{}l@{}}{\parbox[t]{\FreeWid}{%
> \vspace{-8pt}% UGLY UGLY UGLY UGLY UGLY
> \begin{freex}
> \item#1
> \end{freex}}}}

I tried various things (like using \vskip-\lastskip instead of
\vspace{-8pt}) and finally realized that the problem might be the
[t] (alignment to top) as an option of \parbox. So I deleted [t] so
as to get the default: center, and I also deleted \vspace{-8pt}.

The RESULT: I still get some slippage, but considerably less
than before.

Next I started looking for phantom rubber space. Mind you, I
don't understand much of the internals. Years ago a TeX-wise
wizzard gave me an incantation: \vskip-\lastskip. Under the right
conditions it dispells rubber demon. I'm not sure how, nor what
it means.

I tried the incantation in various places.
There are plenty because:
(1) The command \xmpl is defined in terms of the environment
ex, and ex is a defined type of list.
(2) The command \free is defined in terms of the environment
freex, and freex is a defined type of list.
(3) \free is called within \xmpl.

The condition I was most optimistic about was the
{decl} position of the definitions of lists. In the definitions
of both ex and freex, this is left empty: {}. I notices
TLC2e says (p. 144, in the second paragraph of 3.3.4),
"Those being vertically oriented are rubber lengths,..."

So I tried my incantation there and, as best I can tell,
somehow introduced some rubber space. Bummers!
So I'm still searching.

And I'm wondering if the solution lies in defining \xmpl and \free
more directly, without using the list environment. (I think my first
definitions, based on my Scribe definitions, were like this.)

Well, whatever advice you can give me would be most
appreciated.

--David
Alexis Dimitriadis
2011-07-15 20:08:13 UTC
Permalink
> ANY IDEAS?
I'd check to see if your problem is related to having letters with
descenders in the first line. If "pucllanan" is aligned differently from
"Pucllanan", make your macros insert \strut on each line.

Or maybe the problem is glue-related, since you have a lot of forward
and backward skips that must somehow cancel out. Check it it disappears
when you add \raggedbottom to your document.

If this doesn't help, you'll need to provide a minimal working example
as Alan suggested...

Best,

Alexis


On 15/07/2011 16:10, David J Weber wrote:
> Friends,
>
> I used Scribe before I used LaTeX. (Remember Scribe? Ah
> how quickly we forget those who paved the way...) I was writing
> a large, data-rich grammar so I defined an environment for
> linguistic examples, ones with aligned glosses and a free
> translation.
>
> When I switched to LaTeX, I wrote something similar (as a
> command rather than environment). Each example starts with a
> number in parens, e.g., (283). Then the example is indented
> appropriately, starting one column beyond the right paren.
>
> (283) This is an example...
>
> Here's how a simple example is given in the source. "obl10" is
> the reference tag. The first line is in the "practical" orthography;
> the second, the Quechua example; the third, the morpheme-by-
> morpheme gloss; the last, the free translation:
>
> \xmpl{obl10}{
> \free{\sf Wara pucllanan caran.}\\
> Wara& puk£a\bf-na-n&\bf ka-ra-n. \\
> mañana& jugar\sc-sub-3p& ser\sc-pas-3\\
> \free{`Ellos iban a jugar mañana (pero el partido se ha
> postergado).'}
> }
>
> I'm on the verge of sending another grammar to the printer and
> have a problem: between the number and example there is
> sometimes a bit of slippage: the number is slightly higher than
> the example, i.e., the baselines do not match up. Whether or
> not there is slippage depends on the context so I'm guessing
> that somewhere there's glue that should be eliminated or
> tightened up. Here are the definitions. ex is the body, common
> to numbered (\xmpl) and unnumbered (\uxmpl) examples.
>
> % EXAMPLE DEFINITIONS
> \newcounter{example}% EXAMPLE COUNTER
> \newlength{\ExamNumWid}% WIDTH OF EX NUM W/ PAREN
> \newlength{\FreeWid}% WIDTH OF FREE TRANSLAT
> \newlength{\NumExSep}% SPACE NUMBER-EXAMPLE
> \setlength{\NumExSep}{.6mm}% used to be .5mm 2mm
>
> \newenvironment{ex}{% ENVIR FOR COMMON EXAMPLES
> \begin{list}{}%
> {\settowidth{\labelwidth}{(\theexample)}
> \setlength{\labelsep}{\NumExSep}
> \setlength{\leftmargin}{\labelwidth}
> \addtolength{\leftmargin}{\labelsep}
> \setlength{\itemindent}{0em}
> \setlength{\topsep}{0pt}
> \setlength{\listparindent}{0em}
> \setlength{\FreeWid}{\textwidth}
> \addtolength{\FreeWid}{-\LineLenRed}
> \addtolength{\FreeWid}{-\leftmargin}}}{\end{list}}
>
> \newcommand{\xmpl}[2]{% SIMPLE NUMBERED EXMPLE
> \vskip-\lastskip
> \refstepcounter{example}
> \label{#1}
> \begin{ex}
> \item[(\theexample)]
> \vskip-\lastskip
> \begin{tabular}[t]{@{}*{20}{l@{\ }}l@{}}
> #2
> \end{tabular}
> \end{ex}
> }
>
> \newcommand{\uxmpl}[1]{% UNNUMBERED EX
> \vskip-\lastskip
> \begin{ex}
> \item
> \begin{tabular}[t]{@{}*{20}{l@{\ }}l@{}}
> #1
> \end{tabular}
> \end{ex}
> }
>
> \newcommand{\free}[1]{% FREE TRANSLATION
> \multicolumn{20}{@{}l@{}}{\parbox[t]{\FreeWid}{%
> \vspace{-8pt}% UGLY UGLY UGLY UGLY UGLY
> \begin{freex}
> \item#1
> \end{freex}}}}
> \newenvironment{freex}{\begin{list}{}
> {\setlength{\labelwidth}{0pt}
> \setlength{\labelsep}{0pt}
> \setlength{\leftmargin}{0pt}
> \setlength{\itemindent}{0em}
> \setlength{\topsep}{0pt}
> \setlength{\listparindent}{0em}}}{\end{list}}
>
> ANY IDEAS?
>
> Best, --David
>

--
_____________________________________________

Alexis Dimitriadis
A.Dimitriadis-***@public.gmane.org
+31-30-253-6568

Utrecht Institute of Linguistics OTS
Trans 10
3512 JK Utrecht
The Netherlands


--
_____________________________________________

Alexis Dimitriadis
A.Dimitriadis-***@public.gmane.org
+31-30-253-6568

Utrecht Institute of Linguistics OTS
Trans 10
3512 JK Utrecht
The Netherlands
Loading...