ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Text in Margin
@ 2024-02-19 13:14 Jeroen
  2024-02-19 21:00 ` [NTG-context] " Wolfgang Schuster
  2024-02-20  7:39 ` Henning Hraban Ramm
  0 siblings, 2 replies; 4+ messages in thread
From: Jeroen @ 2024-02-19 13:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 533 bytes --]

In a textbook I am looking to place a large left margin at every page of
each chapter. At left printed pages a left margin and at right printed
pages a right margin, so like a double sided construction. In this margin I
would like to place:

1. Keywords and small descriptions to emphasize some text from the textflow
2. Figures
3. An expansion of a table that is placed in the main textflow but that
needs to cover a wider range then the text area so it expands into the
margin

What is the the easiest way to achieve this?

Jeroen

[-- Attachment #1.2: Type: text/html, Size: 648 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Text in Margin
  2024-02-19 13:14 [NTG-context] Text in Margin Jeroen
@ 2024-02-19 21:00 ` Wolfgang Schuster
  2024-02-20  7:39 ` Henning Hraban Ramm
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2024-02-19 21:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jeroen

Jeroen schrieb am 19.02.2024 um 14:14:
> In a textbook I am looking to place a large left margin at every page of 
> each chapter. At left printed pages a left margin and at right printed 
> pages a right margin, so like a double sided construction. In this 
> margin I would like to place:

You can use a custom layout with a narrow text block and a wide 
rightmargin area.

> 1. Keywords and small descriptions to emphasize some text from the textflow

Use the \inright etc. commands or create your own commands based on 
\inright, look at the margindata mechanism for more information.

> 2. Figures

You can change the default location of figures from the text block to 
the margin area.

> 3. An expansion of a table that is placed in the main textflow but that 
> needs to cover a wider range then the text area so it expands into the 
> margin

In the example below I added a check to the table float to either center 
the small tables or align wide tables on the inner margin which extend 
into the margin area. While this method works in a simple example for a 
real document I suggest to create a clone of the table float (e.g. 
widetable) because the method in the example can lead to 
problems/limitations.

> What is the the easiest way to achieve this?

%%%% begin example
\setuppagenumbering
   [alternative=doublesided]

\setuplayout
   [width=10cm,
    rightmargin=6cm]

\showframe

\def\FloatTableALignment
   {\dowithnextbox
      {\ifdim\nextboxwd>\textwidth
         \doalignedline{inner}{\flushnextbox}%
       \else
         \flushnextbox
       \fi}
      \hbox}

\setupfloat[table][command=\FloatTableALignment]

\setupfloat[figure][default=rightmargin]

\starttext

\inright{Lorem ipsum \unknown}\samplefile{lorem}

\startplacefigure
   \externalfigure[dummy][width=\rightmarginwidth]
\stopplacefigure

\samplefile{lorem}

\startplacetable
   \bTABLE
     \bTR
       \bTD one \eTD
       \bTD two \eTD
       \bTD three \eTD
     \eTR
   \eTABLE
\stopplacetable

\samplefile{lorem}

\startplacetable
 
\bTABLE[textwidth=\dimexpr\textwidth+\rightmarginwidth+\rightmargindistance\relax,option=stretch]
     \bTR
       \bTD one \eTD
       \bTD two \eTD
       \bTD three \eTD
     \eTR
   \eTABLE
\stopplacetable

\samplefile{lorem}

\stoptext
%%% end example

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Text in Margin
  2024-02-19 13:14 [NTG-context] Text in Margin Jeroen
  2024-02-19 21:00 ` [NTG-context] " Wolfgang Schuster
@ 2024-02-20  7:39 ` Henning Hraban Ramm
  1 sibling, 0 replies; 4+ messages in thread
From: Henning Hraban Ramm @ 2024-02-20  7:39 UTC (permalink / raw)
  To: ntg-context

Am 19.02.24 um 14:14 schrieb Jeroen:
> In a textbook I am looking to place a large left margin at every page of 
> each chapter. At left printed pages a left margin and at right printed 
> pages a right margin, so like a double sided construction. In this 
> margin I would like to place:
> 
> 1. Keywords and small descriptions to emphasize some text from the textflow
> 2. Figures
> 3. An expansion of a table that is placed in the main textflow but that 
> needs to cover a wider range then the text area so it expands into the 
> margin
> 
> What is the the easiest way to achieve this?

Generally, you use \inmargin, \inouter etc.

Additional to Wolfgang’s suggestions:

If you need sidefloats that cover not only the margin but should 
decrease the text width, you can move sidefloats into the margin like:

\startplacefigure[title={},location=outer]
\offset[rightoffset=-\marginwidth]{\externalfigure[cow][width=0.5\textwidth]}
\stopplacefigure

Beware: it doesn’t work well with captions (I’ve still no solution that 
always works), and \offset understands only rightoffset and leftoffset, 
not outeroffset.
The example is on a right page; you must “pull” the image into the 
margin (rightmargin with negative value), if you try „pushing“ with 
leftoffset=\marginwidth, the text flow is wrong.

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Text in Margin
@ 2024-02-20  2:22 Andres Conrado Montoya
  0 siblings, 0 replies; 4+ messages in thread
From: Andres Conrado Montoya @ 2024-02-20  2:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1322 bytes --]

There is a package on github https://github.com/andythomas/TeX-sidenotes
that can help you with that. Check the "context" folder on that repo. Also,
you can find an example of its use at
https://github.com/zvonkok/perf-panacea

Caveat emptor: It has not been updated in 12 years. It should work for the
most part, I tried to do something with it a while ago but that project was
cancelled. I have not tested it myself but maybe later in  the week I can
take a look at it.

-- 
Andrés Conrado Montoya
Andi Kú
andresconrado@gmail.com
http://sesentaycuatro.com
http://messier87.com
http://chiquitico.org
----------------------------------------
Los fines no justifican los medios, porque la medida verdadera de nuestro
carácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.
----------------------------------------

“You develop an instant global consciousness, a people orientation, an
intense dissatisfaction with the state of the world, and a compulsion to do
something about it. From out there on the moon, international politics look
so petty. You want to grab a politician by the scruff of the neck and drag
him a quarter of a million miles out and say, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell

[-- Attachment #1.2: Type: text/html, Size: 1968 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-02-20  7:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-19 13:14 [NTG-context] Text in Margin Jeroen
2024-02-19 21:00 ` [NTG-context] " Wolfgang Schuster
2024-02-20  7:39 ` Henning Hraban Ramm
2024-02-20  2:22 Andres Conrado Montoya

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).