ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Extend figure to margin, or extend figure from margin to text
@ 2019-05-29  8:28 Zhichu
  2019-05-29  9:55 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Zhichu @ 2019-05-29  8:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


Hi everyone,

I am writing a book, in which all figures are placed in the margin. But some graphics are too big to fit in the margin. I was wondering whether there's an elegant way to use some room of the text body?

The output is close to the following, but the caption should be as wide as the figure and the part in the margin should not affect other marginal notes:

====================================
\showframe

\starttext

Hello\inright{Very very very long test notes.}, world!

\startplacefigure
 [reference=fig:whatever,
 title={Test figure.},
 location=outer]
\hbox{%
\framed
 [frame=on%
 ,offset=0pt%
 ,width=\dimexpr\rightmarginwidth+\rightmargindistance\relax
 ,height=\rightmarginwidth
 ]{Extended Part}%
\framed
 [frame=on%
 ,offset=0pt%
 ,width=\rightmarginwidth
 ,height=\rightmarginwidth
 ]{My Figure Here}%
\kern-\rightmargindistance
\kern-\rightmarginwidth
}
\stopplacefigure

\input knuth

\stoptext
====================================

Lua codes are also welcomed.

Best Regards,
Zhichu Chen

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

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

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Extend figure to margin, or extend figure from margin to text
  2019-05-29  8:28 Extend figure to margin, or extend figure from margin to text Zhichu
@ 2019-05-29  9:55 ` Wolfgang Schuster
  2019-05-29 12:27   ` Zhichu
  2019-05-31  5:15   ` Zhichu
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2019-05-29  9:55 UTC (permalink / raw)
  To: Zhichu, mailing users


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

Zhichu <chenzhichu@zjlab.org.cn> schrieb am Mi., 29. Mai 2019, 10:30:

>
> Hi everyone,
>
> I am writing a book, in which all figures are placed in the margin. But
> some graphics are too big to fit in the margin. I was wondering whether
> there's an elegant way to use some room of the text body?
>

Take a look into the Details manual:
http://www.pragma-ade.nl/show-man-15.htm

Wolfgang

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

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

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re:  Extend figure to margin, or extend figure from margin to text
  2019-05-29  9:55 ` Wolfgang Schuster
@ 2019-05-29 12:27   ` Zhichu
  2019-05-31  5:15   ` Zhichu
  1 sibling, 0 replies; 4+ messages in thread
From: Zhichu @ 2019-05-29 12:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Dear Wolfgang,

That's quick. Thank you so much.

Best regards,
Zhichu


------------------------------------------------------------------
From:Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Sent At:2019 May 29 (Wed.) 17:55
To:陈之初 <chenzhichu@zjlab.org.cn>; mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject:Re: [NTG-context] Extend figure to margin, or extend figure from margin to text


Zhichu <chenzhichu@zjlab.org.cn> schrieb am Mi., 29. Mai 2019, 10:30:


Hi everyone,

I am writing a book, in which all figures are placed in the margin. But some graphics are too big to fit in the margin. I was wondering whether there's an elegant way to use some room of the text body?

Take a look into the Details manual: http://www.pragma-ade.nl/show-man-15.htm

Wolfgang




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

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

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re:  Extend figure to margin, or extend figure from margin to text
  2019-05-29  9:55 ` Wolfgang Schuster
  2019-05-29 12:27   ` Zhichu
@ 2019-05-31  5:15   ` Zhichu
  1 sibling, 0 replies; 4+ messages in thread
From: Zhichu @ 2019-05-31  5:15 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users


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

Dear Wolfgang,

I've made an MWE. It seems that once I changed the layout, the output would be a little strange:
* The edgefigure (default=outer) on the odd pages can't be moved to the margin. Those on the even pages are fine as long as I use "leftmargindistance=-\innercombitotal"
* the marginfigure (default={outermargin, hanging}) on the odd pages are fine, but those on the even pages have a weird offset.
* by the way, the offset of the marginfigure on the even pages are the same as the edgefigure on the even pages if I set "leftmargindistance=-\outercombitotal"

I managed to make the marginfigure work by adding (just in this case)
  leftmargindistance=\dimexpr\outercombitotal-\innercombitotal\relax,
 rightmargindistance=0pt

But I could never make edgefigure work. Its different behavior on odd and even pages really bothers me.

Although the output is acceptable now, I'm still concerned that the settings are not logical (to a human being). I'm afraid that one day it won't work out like that.


Here's the MWE:
===========================================
\showframe

\setuppagenumbering
 [alternative=doublesided]
\definepapersize
 [911]
 [width=9in,
 height=11in]
\setuppapersize
 [911]
\setuplayout
 [backspace=1in%
 ,leftmargin=.5in%
 ,leftmargindistance=0.25in%
 ,width=5.5in%
 ,rightmargindistance=0.25in%
 ,rightmargin=2in%
 ]

\definefloat
 [edgefigure]
 [figure]
\setupfloat
 [edgefigure]
 [rightmargindistance=-\outercombitotal
 ,leftmargindistance=-\innercombitotal
 ,default={outer,low,high,none}]

\definefloat
 [marginfigure]
 [figure]
\setupfloat
 [marginfigure]
 [default={outermargin,hanging,none}]

\startbuffer[fitframe]
\framed[width=\rightmarginwidth,height=.6\rightmarginwidth,framecolor=darkgreen]{\tt width=rightmarginwidth}
\stopbuffer

\startbuffer[wideframe]
\framed[width=2\rightmarginwidth,height=.6\rightmarginwidth,framecolor=darkred]{\tt width=2*rightmarginwidth}
\stopbuffer

\starttext

\chapter{edge}

\dorecurse{10}{
\startplaceedgefigure
\getbuffer[fitframe]
\stopplaceedgefigure

\input knuth
}

\chapter{margin}

\dorecurse{10}{
\startplacemarginfigure
\getbuffer[fitframe]
\stopplacemarginfigure
\input knuth
}

\dorecurse{10}{
\startplacemarginfigure
\getbuffer[wideframe]
\stopplacemarginfigure
\input knuth
}

\stoptext
===========================================
------------------------------------------------------------------
From:Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Sent At:2019 May 29 (Wed.) 17:55
To:陈之初 <chenzhichu@zjlab.org.cn>; mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject:Re: [NTG-context] Extend figure to margin, or extend figure from margin to text


Zhichu <chenzhichu@zjlab.org.cn> schrieb am Mi., 29. Mai 2019, 10:30:


Hi everyone,

I am writing a book, in which all figures are placed in the margin. But some graphics are too big to fit in the margin. I was wondering whether there's an elegant way to use some room of the text body?

Take a look into the Details manual: http://www.pragma-ade.nl/show-man-15.htm

Wolfgang




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

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

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2019-05-31  5:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29  8:28 Extend figure to margin, or extend figure from margin to text Zhichu
2019-05-29  9:55 ` Wolfgang Schuster
2019-05-29 12:27   ` Zhichu
2019-05-31  5:15   ` Zhichu

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