Line breaks in publication standard captions
- To: mathgroup at smc.vnet.net
- Subject: [mg44217] Line breaks in publication standard captions
- From: Goyder Dr HGD <H.Goyder at rmcs.cranfield.ac.uk>
- Date: Tue, 28 Oct 2003 05:53:28 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
In most publications the caption under a graph, made up from several curves, describes the various curves giving examples of the line style. This method is more common and simpler than putting a legend in or beside the graph. Thus a caption under a graph might read:- Figure 5. Experimental data (dot dot dot dot ) from Jones [1]. Theoretical model using elliptic cylinder polynomials (line) Smith [2]. Theoretical model using Bessel functions of the third kind (dash dash dash dash) Newton [3]. Theoretical model using incomplete beta functions with a confocal twist (dot dash dot dash dot dash) Brunel [6]. In the above example the items in brackets are graphics of lines made up from dots or dot-dash etc. The code below is an extension of a method by Omega Consulting. That method put the text-with-graphics in an array. The difference here is that I wish to keep it all in a line which is wrapped according to the page width. The problem is that having graphics-in-text spoils the line breaks (not the page breaks). The lines tend to break after the graphics within the text. How can I get good line breaks in my captions? Thanks Hugh Goyder An example ClearAll[GraphicsCell]; GraphicsCell::"usage"="GraphicsCell[Graphics,Options] puts a graphics image \ into a cell so that it can be combinded with other text. "; GraphicsCell[gr_,Opts___]:=Cell[GraphicsData["PostScript",DisplayString[Show [\ gr,DisplayFunction\[Rule] Identity,Opts]]]] data= Table[{x,ArcTan[x-5] + Random[]/5},{x,0,10,0.5}]; p0 =ListPlot[data, DisplayFunction \[Rule] Identity]; p1=Plot[ArcTan[x-3],{x,0,10},DisplayFunction \[Rule] Identity]; p2=Plot[ ArcTan[x-4],{ x,0,10},PlotStyle\[Rule]{Dashing[{0.01,0.01}]}, DisplayFunction \ \[Rule] Identity]; p3=Plot[ArcTan[x-6],{ x,0,10},PlotStyle\[Rule]{Dashing[{0.01,0.01,0.001}]}, DisplayFunction \[Rule] Identity]; p4 =Show[p0,p1,p2,p3,Frame-> True,Axes-> False,TextStyle\ \[Rule]{FontFamily->"Times",FontSize\[Rule]12},FrameLabel\[Rule]{"Time / sec","Difficulty / m"},DisplayFunction \[Rule] $DisplayFunction, ImageSize -> 6 72,Prolog->{PointSize[0.01],Thickness[0.004]}]; (* Here I make the graphics that will go into the text. Big so that it is clear *) g1=Show[Graphics[{ Point/@{{0,0},{ 1,0},{2,0},{3,0},{ 4,0},{5,0}}}], PlotRange\[Rule]All,AspectRatio\[Rule]1/5,ImageSize -> 6 72,Prolog\[Rule]{PointSize[0.04],Thickness[0.004]}]; g2=Show[Graphics[{Line[{{0,0},{1, 0}}]},PlotRange\[Rule]All, AspectRatio\[Rule]1/5,Prolog\[Rule]{PointSize[ 0.01],Thickness[0.004]},ImageSize -> 6 72]]; g3=Show[Graphics[{ Dashing[{0.1,0.1}],Line[{{0, 0},{1,0}}]},PlotRange\[Rule]All,AspectRatio\[Rule]1/10,ImageSize -> \ 6 72,{Prolog\[Rule]{PointSize[0.01],Thickness[0.004]},ImageSize->0.5*72}]]; g4=Show[Graphics[{Dashing[{0.1,0.1,0.01,0.1}],Line[{{0,0},{1, 0}}]},PlotRange\[Rule]All,AspectRatio\[Rule]1/10,ImageSize -> 6 72,Prolog\[Rule]{PointSize[0.01],Thickness[0.004]}]]; (* Now make the graphics the correct size for the publication *) p4a=Show[p4,Prolog\[Rule] \ {PointSize[0.01],Thickness[0.004]},ImageSize\[Rule]5 72]; g1a=Show[g1,Prolog\[Rule] {PointSize[0.1],Thickness[ 0.04]},ImageSize\[Rule]0.5 72]; g2a=Show[g2,Prolog\[Rule] {PointSize[0.1],Thickness[0.04]}, ImageSize\[Rule]0.5 72]; g3a=Show[g3,Prolog\[Rule] {PointSize[0.1],Thickness[ 0.04]},ImageSize\[Rule]0.5 72]; g4a=Show[g4,Prolog\[Rule] {PointSize[0.1],Thickness[0.04]}, ImageSize\[Rule]0.5 72]; (* Print one cell containing the graphic and the captions-with-graphics *) CellPrint[ Cell[ BoxData[ RowBox[{GraphicsCell[p4a], "\n Figure 5. Experimental data ",GraphicsCell[g1a]," from Jones [1]. Theoretical model using elliptic cylinder polynomials \ ",GraphicsCell[g2a]," Smith [2]. Theoretical model using Bessel functions of the third kind ",GraphicsCell[g3a], " Newton \ [3]. Theoretical model using incomplete beta functions with a confocal twist \ ",GraphicsCell[g4a]," Brunel [6]."}] ],"Text",FontFamily->"Times",FontSize\[Rule]12] ] -- This message has been scanned for viruses and dangerous content by the Cranfield MailScanner, and is believed to be clean.