ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Alignment with inline headings
@ 2011-08-10 11:03 Jean-Philippe Rey
  2011-08-10 12:54 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Philippe Rey @ 2011-08-10 11:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I am looking for a way to vertically align the start of paragraphs after an inline header, i.e. in the following example, I would like each first word (Lorem, Lorem, Suspendisse, Cras, Proin, ...) to start on the same column. I tried different parameters of \setuphead (width, numberwidth, textwidth, distance, etc.) to no avail.

Thanks for your help.



\setuphead[section][alternative=text,before=,after=]

\starttext
\chapter{Chapter}

\section{} Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\section{} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non
risus. Suspendisse lectus tortor.

\section{} Suspendisse lectus tortor, dignissim sit amet, adipiscing nec,
ultricies sed, dolor.

\section{} Cras elementum ultrices diam. Maecenas ligula massa, varius a,
semper congue, euismod non, mi.

\section{} Proin porttitor, orci nec nonummy molestie, enim est eleifend mi,
non fermentum diam nisl sit amet erat.

\section{} Duis semper. Duis arcu massa, scelerisque vitae, consequat in,
pretium a, enim.

\section{} Pellentesque congue. Ut in risus volutpat libero pharetra tempor.
Cras vestibulum bibendum augue.

\section{} Praesent egestas leo in pede. Praesent blandit odio eu enim.
Pellentesque sed dui ut augue blandit sodales.

\section{} Vestibulum ante ipsum primis in faucibus orci luctus et ultrices
posuere cubilia Curae; Aliquam nibh.

\section{} Mauris ac mauris sed pede pellentesque fermentum. Maecenas
adipiscing ante non diam sodales hendrerit.

\section{} Ut velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut
orci vel massa suscipit pulvinar.

\section{} Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc
turpis ullamcorper nibh, in tempus sapien eros vitae ligula.

\section{} Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur
aliquet pellentesque diam.
\stoptext

-- 
Jean-Philippe Rey                 Professeur - École Centrale Paris
jean-philippe.rey@ecp.fr          92295 Châtenay-Malabry Cedex - France



___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Alignment with inline headings
  2011-08-10 11:03 Alignment with inline headings Jean-Philippe Rey
@ 2011-08-10 12:54 ` Wolfgang Schuster
  2011-08-10 13:33   ` Jean-Philippe Rey
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2011-08-10 12:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 10.08.2011 um 13:03 schrieb Jean-Philippe Rey:

> Hi,
> 
> I am looking for a way to vertically align the start of paragraphs after an inline header, i.e. in the following example, I would like each first word (Lorem, Lorem, Suspendisse, Cras, Proin, ...) to start on the same column. I tried different parameters of \setuphead (width, numberwidth, textwidth, distance, etc.) to no avail.

What do you want to achieve, you use \section but you don’t specify a title.

When you want a counter for each paragraph there are other solution dependent on your requirements.

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Alignment with inline headings
  2011-08-10 12:54 ` Wolfgang Schuster
@ 2011-08-10 13:33   ` Jean-Philippe Rey
  2011-08-10 18:41     ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Philippe Rey @ 2011-08-10 13:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Le 10 août 2011 à 14:54, Wolfgang Schuster a écrit :

> 
> Am 10.08.2011 um 13:03 schrieb Jean-Philippe Rey:
> 
>> Hi,
>> 
>> I am looking for a way to vertically align the start of paragraphs after an inline header, i.e. in the following example, I would like each first word (Lorem, Lorem, Suspendisse, Cras, Proin, ...) to start on the same column. I tried different parameters of \setuphead (width, numberwidth, textwidth, distance, etc.) to no avail.
> 
> What do you want to achieve, you use \section but you don’t specify a title.
> 
> When you want a counter for each paragraph there are other solution dependent on your requirements.

I understand that my example seems quite strange. It is because it is a minimal example extracted from a more complicated design. In the complete documents, some sections have title, some not. When there is no title, I don't want to have a number on a line by itself, so I put the headings inline. To achieve this I wrote a macro that calls the appropriate heading style depending on the presence of a title.

Examples of such document

- http://www.concours-centrale-supelec.fr/CentraleSupelec/2011/PC/sujets/math2.pdf
II.A has a title but II.B has not

- http://www.concours-centrale-supelec.fr/CentraleSupelec/2011/PC/sujets/phys1.pdf
I.A.1) has a title but I.B.1) has not

And here is a simplified version of the environment I am using (check the \T macro)

http://jury.concours-centrale-supelec.fr/sujets/sujetCCS.tex

Using sections seemed the best way to achieve consistent numbering, but I am interested by any other ideas.

-- 
Jean-Philippe Rey                 Professeur - École Centrale Paris
jean-philippe.rey@ecp.fr          92295 Châtenay-Malabry Cedex - France



___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Alignment with inline headings
  2011-08-10 13:33   ` Jean-Philippe Rey
@ 2011-08-10 18:41     ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2011-08-10 18:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 10.08.2011 um 15:33 schrieb Jean-Philippe Rey:

> 
> Le 10 août 2011 à 14:54, Wolfgang Schuster a écrit :
> 
>> 
>> Am 10.08.2011 um 13:03 schrieb Jean-Philippe Rey:
>> 
>>> Hi,
>>> 
>>> I am looking for a way to vertically align the start of paragraphs after an inline header, i.e. in the following example, I would like each first word (Lorem, Lorem, Suspendisse, Cras, Proin, ...) to start on the same column. I tried different parameters of \setuphead (width, numberwidth, textwidth, distance, etc.) to no avail.
>> 
>> What do you want to achieve, you use \section but you don’t specify a title.
>> 
>> When you want a counter for each paragraph there are other solution dependent on your requirements.
> 
> I understand that my example seems quite strange. It is because it is a minimal example extracted from a more complicated design. In the complete documents, some sections have title, some not. When there is no title, I don't want to have a number on a line by itself, so I put the headings inline. To achieve this I wrote a macro that calls the appropriate heading style depending on the presence of a title.
> 
> Examples of such document
> 
> - http://www.concours-centrale-supelec.fr/CentraleSupelec/2011/PC/sujets/math2.pdf
> II.A has a title but II.B has not
> 
> - http://www.concours-centrale-supelec.fr/CentraleSupelec/2011/PC/sujets/phys1.pdf
> I.A.1) has a title but I.B.1) has not
> 
> And here is a simplified version of the environment I am using (check the \T macro)
> 
> http://jury.concours-centrale-supelec.fr/sujets/sujetCCS.tex
> 
> Using sections seemed the best way to achieve consistent numbering, but I am interested by any other ideas.

\definelabel[test]

\setupdescriptions
  [test]
  [text=,
   prefixsegments=chapter:section,
   prefix=yes,
   numberstopper=),
   prefixconnector=+,
   after=\space]

\starttext

\chapter{Chapter}

\section{Section}

\test One

\test Two

\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-10 18:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-10 11:03 Alignment with inline headings Jean-Philippe Rey
2011-08-10 12:54 ` Wolfgang Schuster
2011-08-10 13:33   ` Jean-Philippe Rey
2011-08-10 18:41     ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).