Graphics, Figures & TablesNumber position in the ‘example’ envmnt. using ‘covington'

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
JPinta
Posts: 2
Joined: Thu Mar 27, 2014 6:03 pm

Number position in the ‘example’ envmnt. using ‘covington'

Post by JPinta »

Long time lurker, first post!

I use the package Covington for examples, which when used with the tabular environment by default places the example number (e.g. (1)) to the left of the example horizontally but centered vertically with the example. I was wondering how to go about placing the number in the upper left-hand corner of the example (i.e. top justified vertically speaking) while still using tabular. Or do I have to abandon tabular?

Here is my MWE in addition to the result I get from using it. I just want the (1) in this example to be on the same line as “V” and the rest of the first row.

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{covington}
\begin{document}
\begin{example}
\begin{tabular}{lll}
V & xxx & `water' \\
CV & xxx & `brother' \\
CVG & xxx & `two' \\
CGVG & xxx & `tail' \\
\end{tabular}
\end{example}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Any suggestions at all are much appreciated! :D
Attachments
ex.jpg
ex.jpg (12.85 KiB) Viewed 4195 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Number position in the ‘example’ envmnt. using ‘covington'

Post by hugovdberg »

The alignment of the tabular environment is controlled by the optional [pos] argument, setting this to [t]op alignment moves the tabular environment downwards so its top aligns with the surrounding text instead of its center:

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{covington}
\begin{document}
\begin{example}
\begin{tabular}[t]{lll}
V & xxx & `water' \\
CV & xxx & `brother' \\
CVG & xxx & `two' \\
CGVG & xxx & `tail' \\
\end{tabular}
\end{example}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
JPinta
Posts: 2
Joined: Thu Mar 27, 2014 6:03 pm

Re: Number position in the ‘example’ envmnt. using ‘covingto

Post by JPinta »

Such a simple response that I'm embarrassed to have needed to ask for it! I had myself convinced the fix would come with the example environment and not tabular.

I greatly appreciate your help, this worked perfectly! :mrgreen:
hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Re: Number position in the ‘example’ envmnt. using ‘covingto

Post by hugovdberg »

Hmm, that's what I wanted to add to my previous post :P with alignment it is often the innermost element that needs to be aligned to the surrounding code, and since the example number is part of the outer environment is definitely worth looking for an alignment option to the tabular environment. This does make sense if you think about it like putting a picture in a photo frame, if you want it to be aligned differently it makes more sense to move the photo than moving the frame while holding the photo above it ;)
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
Post Reply