On 1/12/2022 1:09 AM, jbf via ntg-context wrote:
For poetry that has non-regular indentations, I simply
\definelines[poem] and set that up the way I want, obviously, with
\setuplines[poem] e.g. [before={\blank
\setupinterlinespace[line=2.5ex]},after={\blank},indenting=first
For poetry that has non-regular indentations, I simply
\definelines[poem] and set that up the way I want, obviously, with
\setuplines[poem] e.g. [before={\blank
\setupinterlinespace[line=2.5ex]},after={\blank},indenting=first].
And then, but I guess it is still a hack, I use \hskip
iant]
\setupnotation[variant][number=no]
\setupnote[variant][way=bypage,paragraph=yes,rule=off]
\definelines[slokaed][][indenting={yes, small, even},
before={\startnarrower\startlinenumbering},
after={\stoplinenumbering\stopnarrower}]
\definelines[slokaedplain][][inde
:
\definemeasure[Indentation][1cm]
\definenarrower
[LinesIndentation]
[ before=\blank,
after=\blank,
default=left,
left=\measure{Indentation}]
\definelines
[Poem]
[ before=\startLinesIndentation,
after=\stopLinesIndentation,
indenting={yes,-\measure{Indentation
e=off]
>
> % Two "environments" for Sanskrit verses, one with, one without
> linenumbers.
>
> % SANSKRIT EDITION linenumbers
> \definelines[slokaed][][indenting={yes, small, even},
>
> before=\startnarrower\startlinenumbering,after=\stoplinenumbering\st
[variant] [footnote]
\setupnotation[variant][number=no]
\setupnote[variant][way=bypage,paragraph=yes,rule=off]
% Two "environments" for Sanskrit verses, one with, one without
linenumbers.
% SANSKRIT EDITION linenumbers
\definelines[slokaed][][indenting={yes, small, ev
Tommaso Gordini schrieb am 02.07.2020 um 17:33:
I have found this, that works, buy I don't know if there's a possibility
of using less code:
[...]
The following example needs version 2020.07.02 or newer.
begin example
\definelines [poem]
\setuplines
[poem]
[
before
,
align=flushleft,
before=,
after=,
frame=off]
\definenarrower[poemnarrower]
\definelines
[poemlines]
[before={\startpoemnarrower[left]},
after=\stoppoemnarrower]
\definebuffer[poem]
\def\stoppoem{\setups{poems:buffer}}
\startsetups poems:buffer
\setupnarrower
\switchtobodyfont[11pt]},
framecolor=darkblue,
corner=round]
\definelines
[algorithm]
[space=on,
before=\startalgorithmframe,
after=\stopalgorithmframe]
\starttext
\startlinecorrection[blank]
\startmidaligned
\startalgorithm
{\blue def nom} (argument1
very well because the withdrawal of the text no
longer exists.
Thank you
Fabrice
\defineframedtext
[algorithmframe]
[width=fit,
background=color,
backgroundcolor=lightgray,
framecolor=darkred,
corner=round]
\definelines
[algorithm]
[space=on,
before=\startalgorithmframe
,
framecolor=darkred,
corner=round]
\definelines
[algorithm]
[space=on,
before=\startalgorithmframe,
after=\stopalgorithmframe]
\starttext
\startalgorithm
Variables \math{I} et \math{J} entiers
T tableau d'entiers
Début
Pour \math{I} allant de \math{1} à \math{3}
Pour \math{J
,
framecolor=darkblue,
corner=round]
\definelines
[algorithm]
[space=on,
before=\startalgorithmframe,
after=\stopalgorithmframe]
\starttext
\startlinecorrection[blank]
\startmidaligned
\startalgorithm
Variables : \math{V} est un réel
\math{N} est un entier naturel
Début
={\switchtobodyfont[7pt]},
background=color,
location=middle,
backgroundcolor=MyBlue,
framecolor=darkblue,
corner=round]
\definelines
[algorithm]
[space=on,
before={\startframed[algorithmframe]},
after=\stopframed]
\starttext
\startalgorithm
\startitemize[1,joinedup,nowhite]
\item
>
> Not with linenumbering, what you need is counter which is inserted at the
> begin of each line.
>
> \definelabel[algorithmicline][text=,alternative=inleft]
>
> \definelines[algorithmic][command=\algorithmicline]
>
> \setuplayout[width=4cm]
>
> \showframe[text][te
efinelabel[algorithmicline][text=,alternative=inleft]
\definelines[algorithmic][command=\algorithmicline]
\setuplayout[width=4cm]
\showframe[text][text]
\starttext
\startalgorithmic
text
text text text text text text text text text text text text
text
\stopalgori
helps.
>
> \defineframed
> [algorithmframe]
> [width=fit,
>align=normal,
>strut=no,
>offset=1ex,
>foregroundstyle={\switchtobodyfont[8pt]},
>background=color,
>location=middle,
> backgroundcolor=lightgray,
>framecolor=darkre
ecolor=darkred,
corner=round]
\definelines
[algorithm]
[space=on,
before={\startframed[algorithmframe]},
after=\stopframed]
Wolfgang
___
If your question is of interest to others as well, please add an
]
\definelines
[algorithm]
[space=on,
before=\startalgorithmframe,
after=\stopalgorithmframe]
\starttext
\startmidaligned
\startcombination[3*1]
{\hbox{\startalgorithm
Variables :
\math{U} est un nombre réel
\math{i} et \math{N} sont des nombres entiers
Début :
Saisir une valeur pour
> fact, I want to place the algorithm as the image.
>
> You need also "location=middle" for the framedtext.
>
> \defineframedtext
> [algorithmframe]
> [width=fit,
>location=middle,
>background=color,
>backgroundcolor=lightgray,
>fra
defineframedtext
[algorithmframe]
[width=fit,
location=middle,
background=color,
backgroundcolor=lightgray,
framecolor=darkred,
corner=round]
\definelines
[algorithm]
[space=on,
before=\startalgorithmframe,
after=\stopalgorithmframe]
\starttext
\startmakeup[standard]
=round]
\definelines
[algorithm]
[space=on,
before=\startalgorithmframe,
after=\stopalgorithmframe]
\starttext
\startmakeup[standard][align=middle]
\startalgorithm
Initialisation :
\math{u} prend la valeur 2\,000
\math{S} prend la valeur 2\,000
Traitement :
Pour \math{i} allant de 2 à \
ecolor=darkred,
corner=round]
\definelines
[algorithm]
[space=on,
before=\startalgorithmframe,
after=\stopalgorithmframe]
\starttext
\startlinecorrection[blank]
\startmidaligned
Replace these two lines with \startmakeup[standard][align=middle]
\startalgorithm
Initialisation :
\math{u}
Hello,
How to make the algorithm is centered vertically and horizontally ?
thank you,
Fabrice
\defineframedtext
[algorithmframe]
[width=fit,
background=color,
backgroundcolor=lightgray,
framecolor=darkred,
corner=round]
\definelines
[algorithm]
[space=on,
before
lor=lightgray,
>framecolor=darkred,
>corner=round]
>
> \definelines
> [algorithm]
> [space=on,
>before=\startalgorithmframe,
>after=\stopalgorithmframe]
>
> \starttext
>
> \startalgorithm
> Variables \math{I} et \math{J} entiers
> T tableau
(space=on).
\defineframedtext
[algorithmframe]
[width=fit,
background=color,
backgroundcolor=lightgray,
framecolor=darkred,
corner=round]
\definelines
[algorithm]
[space=on,
before=\startalgorithmframe,
after=\stopalgorithmframe]
\starttext
\startalgorithm
Variables \math{I} et \math{J} e
environment doesn’t wllow this.
Anayway I would prefer a solution which avoids the lines environment. This
means I would like to define two commands: \startVerse and \stopVerse. But I
find no solution.
You can create your own lines environment with the \definelines command. The
indentation
]
\definemargindata[Person][inmargin][style=normal]
\definelines[lyrics][align=middle]
%\showframe
\starttext
\Person{Person 1:}
\startlyrics
song asdf line 1
song line 2
song a line 3
\stoplyrics
\stoptext
Wolfgang
___
If your
Dne 11.6.2013 12:15, Wolfgang Schuster napsal(a):
You can place the name in the margin.
\setuplayout[backspace=4cm]
\definemargindata[Person][inmargin][style=normal]
\definelines[lyrics][align=middle]
%\showframe
\starttext
\Person{Person 1:}
\startlyrics
song asdf line 1
song line 2
song
Am 11.06.2013 um 12:24 schrieb Jan Pohanka xhpoha...@gmail.com:
Dne 11.6.2013 12:15, Wolfgang Schuster napsal(a):
You can place the name in the margin.
\setuplayout[backspace=4cm]
\definemargindata[Person][inmargin][style=normal]
\definelines[lyrics][align=middle]
%\showframe
}
\define\SecondLine{\let\myLine\OtherLine\bf}
\define\OtherLine{\tf}
\definelines[doMyLines][command=\myLine]
\def\startMyLines{\let\myLine\FirstLine\startdoMyLines}
\def\stopMyLines{\stopdoMyLines}
As I said that works, but while trying to understand this, I found that the
documentation
}
\definelines[doMyLines][command=\myLine]
\def\startMyLines{\let\myLine\FirstLine\startdoMyLines}
\def\stopMyLines{\stopdoMyLines}
As I said that works, but while trying to understand this, I found
that the documentation for \definelines doesn't mention the
command= option. On the other hand
\FirstLine{\let\myLine\SecondLine\sc}
\define\SecondLine{\let\myLine\OtherLine\bf}
\define\OtherLine{\tf}
\definelines[doMyLines][command=\myLine]
\def\startMyLines{\let\myLine\FirstLine\startdoMyLines}
\def\stopMyLines{\stopdoMyLines}
As I said that works, but while trying to understand this, I
. If there's a counter that counts the
line number, there would be another way; but I couldn't find out that there was
a counter. There may be better ways anyway.
\define\FirstLine{\let\myLine\SecondLine\sc}
\define\SecondLine{\let\myLine\OtherLine\bf}
\define\OtherLine{\tf}
\definelines[doMyLines
. If there's a counter that counts the
line number, there would be another way; but I couldn't find out that there was
a counter. There may be better ways anyway.
\define\FirstLine{\let\myLine\SecondLine\sc}
\define\SecondLine{\let\myLine\OtherLine\bf}
\define\OtherLine{\tf}
\definelines[doMyLines
, there would be another way; but I couldn't find out that there was
a counter. There may be better ways anyway.
\define\FirstLine{\let\myLine\SecondLine\sc}
\define\SecondLine{\let\myLine\OtherLine\bf}
\define\OtherLine{\tf}
\definelines[doMyLines][command=\myLine]
\def\startMyLines{\let\myLine
\definenarrower[narrowlines][left=4em, setups=setups:narrow]
\definelines[narrow][before={\blank\startnarrowlines[left]},after=\stopnarrowlines\blank]
\stopsetups
\starttext
\input ward\par
\startnarrow
\input knuth\par
\stopnarrow
\input ward\par
\stoptext
Does anyone know how can I achieve a smaller font
Hi Hans,
I have the following sample:
\definelines[narrow][before=\blank,after=\blank]
\stopsetups
\starttext
This is a paragraph.\par
\startnarrow
this is a verse
this is a verse
\stopnarrow
This is paragraph.\par
\stoptext
If I replace \definelines with \setuplines, before and after aren't
Am 09.12.2012 um 20:08 schrieb Pablo Rodríguez oi...@web.de:
Hi Hans,
I have the following sample:
\definelines[narrow][before=\blank,after=\blank]
\stopsetups
\starttext
This is a paragraph.\par
\startnarrow
this is a verse
this is a verse
\stopnarrow
This is paragraph.\par
[setups:narrow]
\setupinterlinespace[line=2.8ex]
\tfx
\stopsetups
\definenarrower[narrowlines][left=4em, setups=setups:narrow]
\definelines[narrow][before={\blank\startnarrowlines[left]},after=\stopnarrowlines\blank]
\stopsetups
\starttext
\input ward\par
\startnarrow
\input knuth\par
\xmlregisterdocumentsetup{Lorem}{xml:Lorem:base}
\startxmlsetups xml:Lorem:feed
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:Lorem:lipsum
\xmlflush{#1}
\stopxmlsetups
\definelines[LoremLines]
\def\Lorem#1{% #1 = number of paragraphs to request
\startLoremLines
\xmlprocessfile{Lorem}{http://www.lipsum.com
xml:Lorem:feed
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:Lorem:lipsum
\xmlflush{#1}
\stopxmlsetups
\definelines[LoremLines]
\def\Lorem#1{% #1 = number of paragraphs to request
\startLoremLines
\xmlprocessfile{Lorem}{http://www.lipsum.com/feed/xml?amount=#1what=parasstart=yes
environment when you don’t need syntax highlighting:
\setupbodyfont[xits,10pt]
\definelines
[code]
[space=yes,
style=mono,
before=\startnarrower,
after=\stopnarrower]
\starttext \showframe
\startcode
for $∀$i, j $∈$ I
do a(i, j) $≔$ b(i, j)
\stopcode
\stoptext
Wolfgang
symbol produced by amsmath?
Use the \startlines environment.
MkII:
\startlines\tt
If int(N/2) $\ne$ N/2
Then
Disp N MUST BE EVEN
Stop
End
\stoplines
MkIV:
\definelines[XXX][style=mono]
\startXXX
If int(N/2) $\ne$ N/2
Then
Disp N MUST BE EVEN
Stop
End
\stopXXX
or
\startlines[style=mono]
If int
lines environment.
\definelines[code][style=mono,space=on]
\startcode
\bold{def} ra()
...
\stopcode
the sign | (vertical bar) seems to be a special char (context/mkiv)
it is only compiled if present in pairs |text |
the message: File ended while use of \next
\type{|} works
To keep
how to do that?
\definelines
[verse]
[indenting={yes,-2em,first},
before={\startnarrower[2em]},
after=\stopnarrower,
% style={\setupalign[flushleft,nothyphenated]},
style={\raggedright\nohyphens},
]
@Hans, can you change \setupalign to
\unexpanded\def\setupalign
be broken
into hanging indentations.
Any idea how to do that?
\definelines
[verse]
[indenting={yes,-2em,first},
before={\startnarrower[2em]},
after=\stopnarrower,
% style={\setupalign[flushleft,nothyphenated]},
style={\raggedright\nohyphens},
]
@Hans, can you change \setupalign to
\unexpanded\def
]
\def\definelines
{\dodoubleempty\dodefinelines}
\def\dodefinelines[#1][#2]%
{\getparameters[\??rg#1][\s!parent=\??rg,#2]%
\setvalue{\e!start#1}{\dostartlines[#1]}%
\setvalue{\e!stop #1}{\dostoplines}}
\def\setuplines
{\dodoubleempty\dosetuplines}
\def\dosetuplines[#1][#2
,
but it doesn't seem to be suffisant (but I didn't expect to!).
no, just the same command, but with an option:
\setuplines[space=on]
if there is real demand for it i can always make a
\definelines[lines]
\definelines[Lines][space=on]
Hans
48 matches
Mail list logo