attachment
attachment

Please create a colorful handbook pdf and explain this grammar topic in very easy and interesting way,also add some more effective examples other than given in photo for my ESL student.

analyse_media
Reading File
Browsing Directory

~/

Searching the Web

British Council cleft sentences grammar ESL explanation

Running Command

mkdir -p "/tmp/workspace/cleft-sentences-handbook/src" "/tmp/workspace/cleft-sentences-handbook/output" && python - <<'PY' from reportlab.lib.pagesizes import A4 from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, KeepTogether from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib import colors from reportlab.lib.enums import TA_CENTER, TA_LEFT from reportlab.lib.units import cm from reportlab.pdfbase.ttfonts import TTFont from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.pdfmetrics import stringWidth from reportlab.lib.colors import HexColor from reportlab.pdfgen.canvas import Canvas from reportlab.lib.utils import ImageReader out='/tmp/workspace/cleft-sentences-handbook/output/Cleft_Sentences_ESL_Handbook.pdf' # Palette NAVY=HexColor('#153A5B'); BLUE=HexColor('#2274A5'); TEAL=HexColor('#1AA6A6'); MINT=HexColor('#DDF5F1') YELLOW=HexColor('#FFF1A8'); CORAL=HexColor('#F47C6C'); PINK=HexColor('#FCE3ED'); INK=HexColor('#263238'); PALE=HexColor('#F6FAFC'); PURPLE=HexColor('#6C63A8') styles=getSampleStyleSheet() styles.add(ParagraphStyle(name='CoverTitle', parent=styles['Title'], fontName='Helvetica-Bold', fontSize=31, leading=37, textColor=colors.white, alignment=TA_CENTER, spaceAfter=12)) styles.add(ParagraphStyle(name='CoverSub', parent=styles['BodyText'], fontName='Helvetica', fontSize=14, leading=20, textColor=colors.white, alignment=TA_CENTER)) styles.add(ParagraphStyle(name='H1x', parent=styles['Heading1'], fontName='Helvetica-Bold', fontSize=22, leading=27, textColor=NAVY, spaceBefore=4, spaceAfter=10)) styles.add(ParagraphStyle(name='H2x', parent=styles['Heading2'], fontName='Helvetica-Bold', fontSize=14, leading=18, textColor=BLUE, spaceBefore=8, spaceAfter=6)) styles.add(ParagraphStyle(name='Bodyx', parent=styles['BodyText'], fontName='Helvetica', fontSize=10.7, leading=15.2, textColor=INK, spaceAfter=6)) styles.add(ParagraphStyle(name='Small', parent=styles['BodyText'], fontName='Helvetica', fontSize=9.1, leading=12.1, textColor=INK)) styles.add(ParagraphStyle(name='BoxTitle', parent=styles['BodyText'], fontName='Helvetica-Bold', fontSize=11.5, leading=14, textColor=NAVY, spaceAfter=4)) styles.add(ParagraphStyle(name='Example', parent=styles['BodyText'], fontName='Helvetica', fontSize=10.5, leading=15, textColor=INK)) styles.add(ParagraphStyle(name='Center', parent=styles['BodyText'], fontName='Helvetica-Bold', fontSize=12, leading=16, textColor=NAVY, alignment=TA_CENTER)) def P(text, sty='Bodyx'): return Paragraph(text, styles[sty]) def box(title, text, bg=MINT, accent=TEAL): t=Table([[P(title,'BoxTitle')],[P(text,'Bodyx')]], colWidths=[17.2*cm]) t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),bg),('BOX',(0,0),(-1,-1),1.2,accent),('LINEBEFORE',(0,0),(0,-1),6,accent),('LEFTPADDING',(0,0),(-1,-1),12),('RIGHTPADDING',(0,0),(-1,-1),12),('TOPPADDING',(0,0),(-1,-1),8),('BOTTOMPADDING',(0,0),(-1,-1),8)])) return t def example(before, after, note=''): notehtml = ('<br/><font color="#2274A5"><b>Focus:</b> '+note+'</font>') if note else '' t=Table([[P('<b>Ordinary:</b> '+before,'Example'), P('<b>Cleft:</b> '+after+notehtml,'Example')]],colWidths=[8.4*cm,8.8*cm]) t.setStyle(TableStyle([('BACKGROUND',(0,0),(0,0),PALE),('BACKGROUND',(1,0),(1,0),YELLOW),('BOX',(0,0),(-1,-1),0.6,HexColor('#B7CEDA')),('INNERGRID',(0,0),(-1,-1),0.5,HexColor('#B7CEDA')),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)])) return t class HandbookCanvas(Canvas): def __init__(self,*args,**kwargs): Canvas.__init__(self,*args,**kwargs); self.pages=[] def showPage(self): self.pages.append(dict(self.__dict__)); self._startPage() def save(self): count=len(self.pages) for state in self.pages: self.__dict__.update(state) page=self._pageNumber if page>1: self.setFillColor(NAVY); self.rect(0,0,21*cm,0.45*cm,fill=1,stroke=0) self.setFillColor(colors.white); self.setFont('Helvetica',8.5) self.drawString(1.45*cm,0.15*cm,'CLEFT SENTENCES | ESL HANDBOOK') self.drawRightString(19.55*cm,0.15*cm,f'{page-1} / {count-1}') Canvas.showPage(self) Canvas.save(self) doc=SimpleDocTemplate(out,pagesize=A4,rightMargin=1.4*cm,leftMargin=1.4*cm,topMargin=1.25*cm,bottomMargin=1.15*cm) story=[] # cover story += [Spacer(1,2.3*cm)] cover=Table([[P('CLEFT<br/>SENTENCES','CoverTitle')],[P('Make the important idea stand out!', 'CoverSub')],[Spacer(1,0.4*cm)],[P('A colourful, easy-to-use grammar handbook for ESL learners', 'CoverSub')]],colWidths=[16.5*cm],rowHeights=[3.1*cm,0.8*cm,0.4*cm,1.2*cm]) cover.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),NAVY),('BOX',(0,0),(-1,-1),2,NAVY),('VALIGN',(0,0),(-1,-1),'MIDDLE'),('TOPPADDING',(0,0),(-1,-1),14),('BOTTOMPADDING',(0,0),(-1,-1),14)])) story += [cover, Spacer(1,0.7*cm), box('THE BIG IDEA', 'A <b>cleft sentence</b> divides one simple message into two parts. We do this to put a spotlight on the information we want people to notice.',YELLOW,CORAL), Spacer(1,0.45*cm), P('<b>Think of it like a highlighter:</b> the grammar stays correct, but one part becomes more noticeable.','Center'), Spacer(1,1*cm), P('Inside this handbook', 'H2x'), P('1. What cleft sentences do &nbsp; • &nbsp; 2. <b>It</b>-clefts &nbsp; • &nbsp; 3. <b>What</b>-clefts &nbsp; • &nbsp; 4. Other useful patterns &nbsp; • &nbsp; 5. Practice and answers','Bodyx'), PageBreak()] # page 2 story += [P('1. Why use a cleft sentence?','H1x'), P('Usually, English presents information in a neutral order. A cleft sentence changes the spotlight. Use one when you want to correct someone, show a contrast, answer a question clearly, or add drama to a story.','Bodyx'), box('NEUTRAL MESSAGE', 'Maya sent the email on Monday.', PALE, BLUE), Spacer(1,0.18*cm), box('WITH A SPOTLIGHT', '<b>It was Maya who sent the email on Monday.</b><br/>Now the listener understands: <i>Maya</i>, not someone else, is important.', MINT, TEAL), Spacer(1,0.3*cm), P('Compare the focus','H2x'), example('Leo found the keys in the kitchen.','<b>It was Leo who</b> found the keys in the kitchen.','Who found them? Leo.'), Spacer(1,0.18*cm), example('Leo found the keys in the kitchen.','<b>It was in the kitchen that</b> Leo found the keys.','Where did he find them?'), Spacer(1,0.18*cm), example('Leo found the keys in the kitchen.','<b>What Leo found was</b> the keys.','What did he find?'), Spacer(1,0.35*cm), box('EASY CHECK', 'Ask yourself: <b>“Which information do I want to make strongest?”</b> Put that information after <b>it was / it is</b>, or at the beginning of a <b>what</b>-cleft.', PINK, CORAL), PageBreak()] # page3 IT cleft story += [P('2. The “It” cleft','H1x'), P('This is the most common pattern. It is especially useful for highlighting a <b>person, thing, place, time,</b> or <b>reason</b>.','Bodyx'), box('PATTERN', '<b>It + be + focus + who / that + the rest of the message.</b><br/><br/><b>It was my neighbour who</b> helped me.<br/><b>It is after lunch that</b> I study best.', YELLOW, CORAL), P('Choose <i>who</i> or <i>that</i>','H2x'), P('For people, use <b>who</b> or <b>that</b>. For things, places, times, and reasons, use <b>that</b>. In everyday English, <b>that</b> is common in many it-clefts.','Bodyx'), example('My sister baked the cake.','It was <b>my sister</b> who baked the cake.','person'), Spacer(1,0.16*cm), example('We met at the library.','It was <b>at the library</b> that we met.','place'), Spacer(1,0.16*cm), example('The train leaves at 6:30.','It is <b>at 6:30</b> that the train leaves.','time'), Spacer(1,0.16*cm), example('I called because I needed advice.','It was <b>because I needed advice</b> that I called.','reason'), Spacer(1,0.3*cm), box('TENSE TIP', 'The verb <b>be</b> normally matches the time: <b>It is</b> for now or a general fact. <b>It was</b> for the past.<br/><br/><b>It is</b> my aunt who teaches French. &nbsp; <b>It was</b> my aunt who taught me French.', MINT, TEAL), PageBreak()] # page 4 What story += [P('3. The “What” cleft','H1x'), P('A <b>what</b>-cleft is useful when the important information is an action, an object, or an idea. The <b>what-clause</b> comes first and acts like one big noun phrase.','Bodyx'), box('PATTERN', '<b>What + subject + verb + be + focus.</b><br/><br/><b>What I need is</b> a quiet room.<br/><b>What surprised us was</b> the ending.', YELLOW, CORAL), P('How to build one','H2x'), P('Start with a normal sentence: <b>I need a quiet room.</b><br/>Ask: “What do I need?”<br/>Answer with the cleft: <b>What I need is a quiet room.</b>','Bodyx'), example('I enjoy the friendly atmosphere most.','<b>What I enjoy most is</b> the friendly atmosphere.','thing / idea'), Spacer(1,0.16*cm), example('The team needs more practice.','<b>What the team needs is</b> more practice.','thing'), Spacer(1,0.16*cm), example('She did not listen carefully.','<b>What she did not do was</b> listen carefully.','action'), Spacer(1,0.16*cm), example('They forgot their passports.','<b>What they forgot was</b> their passports.','object'), Spacer(1,0.3*cm), box('SINGULAR OR PLURAL?', 'Both forms can be heard: <b>What I need is more time.</b> / <b>What I need are two pens.</b><br/>For ESL writing, using <b>is</b> after the what-clause is a safe and very common choice.', PINK, PURPLE), PageBreak()] # p5 other story += [P('4. More useful spotlight patterns','H1x'), P('These patterns work in a similar way. Use them when the question word itself is the best guide to the focus.','Bodyx')] data=[[P('<b>Pattern</b>','Small'),P('<b>Use it for</b>','Small'),P('<b>Example</b>','Small')], [P('<b>The person who...</b>','Small'),P('a person','Small'),P('<b>The person who called me was</b> our manager.','Small')], [P('<b>The place where...</b>','Small'),P('a place','Small'),P('<b>The place where we first met was</b> a small café.','Small')], [P('<b>The reason why...</b>','Small'),P('a reason','Small'),P('<b>The reason why I stayed home was</b> the rain.','Small')], [P('<b>All I did was...</b>','Small'),P('one simple action','Small'),P('<b>All I did was</b> ask a question.','Small')], [P('<b>The one thing that...</b>','Small'),P('one important thing','Small'),P('<b>The one thing that worries me is</b> the cost.','Small')]] t=Table(data,colWidths=[4.4*cm,3.1*cm,9.7*cm]) t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,0),NAVY),('TEXTCOLOR',(0,0),(-1,0),colors.white),('BACKGROUND',(0,1),(-1,-1),PALE),('ROWBACKGROUNDS',(0,1),(-1,-1),[PALE, MINT]),('GRID',(0,0),(-1,-1),0.45,HexColor('#AFC7D6')),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),7),('RIGHTPADDING',(0,0),(-1,-1),7),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)])) story += [t, Spacer(1,0.4*cm), P('Common mistakes to avoid','H2x'), box('1. Do not omit <b>that / who</b>: <font color="#B22222">It was Friday I arrived.</font> &nbsp; → &nbsp; <font color="#147A6D"><b>It was Friday that I arrived.</b></font><br/><br/>2. Keep the correct tense: <font color="#B22222">It is yesterday that I met him.</font> &nbsp; → &nbsp; <font color="#147A6D"><b>It was yesterday that I met him.</b></font><br/><br/>3. Do not use <b>what</b> for a person after <i>it was</i>: say <b>It was Sam who...</b>', PINK, CORAL), Spacer(1,0.35*cm), box('SPEAKING TIP', 'Say the focused words a little more strongly: <b>It was MY SISTER who made it.</b> Your voice helps the listener hear the spotlight.', YELLOW, CORAL), PageBreak()] # p6 practice story += [P('5. Try it yourself!','H1x'), P('Rewrite each sentence as a cleft sentence. More than one answer may be possible. Choose the word or phrase in <b>bold</b> as the focus.','Bodyx')] qs=[ '1. <b>Omar</b> solved the puzzle.', '2. We are going to travel <b>in July</b>.', '3. Nina bought <b>a new laptop</b>.', '4. I like <b>the music</b> best about this café.', '5. The children played <b>in the garden</b>.', '6. I am upset because <b>nobody told me</b>.', '7. My teacher gave me <b>useful feedback</b>.', '8. They only <b>waited for the bus</b>.' ] for q in qs: story += [P(q,'Bodyx'), Spacer(1,0.18*cm), Table([['']],colWidths=[17.2*cm],rowHeights=[0.45*cm],style=TableStyle([('LINEBELOW',(0,0),(-1,-1),0.7,HexColor('#95B7C8'))])), Spacer(1,0.18*cm)] story += [Spacer(1,0.15*cm), box('MINI CHALLENGE', 'Write one cleft sentence about your day. Start with: <b>What made me happy today was ...</b>', YELLOW, CORAL), PageBreak()] # answers story += [P('Answers and quick recap','H1x'), P('Possible answers','H2x')] answers=['1. <b>It was Omar who</b> solved the puzzle.','2. <b>It is in July that</b> we are going to travel.','3. <b>What Nina bought was</b> a new laptop.','4. <b>What I like best about this café is</b> the music.','5. <b>It was in the garden that</b> the children played.','6. <b>What upsets me is that</b> nobody told me.','7. <b>What my teacher gave me was</b> useful feedback.','8. <b>All they did was</b> wait for the bus.'] for a in answers: story += [P(a,'Bodyx')] story += [Spacer(1,0.25*cm), box('REMEMBER', '<b>It-cleft:</b> It was / is + focus + who / that + rest.<br/><b>What-cleft:</b> What + subject + verb + is / was + focus.<br/><br/>Use cleft sentences when you want your listener or reader to notice one part of the message.', MINT, TEAL), Spacer(1,0.4*cm), P('Keep practising: say a normal sentence first, then ask “What is important here?” and put that part in the spotlight.','Center'), Spacer(1,0.45*cm), P('Grammar note: Cleft sentences are used to add emphasis. Examples and terminology are consistent with the [British Council LearnEnglish guidance](https://learnenglish.britishcouncil.org/free-resources/grammar/c1/emphasis-cleft-sentences-inversion-auxiliaries).','Small')] doc.build(story, canvasmaker=HandbookCanvas) print(out) PY python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/cleft-sentences-handbook/output/Cleft_Sentences_ESL_Handbook.pdf' r=PdfReader(p) print('pages',len(r.pages),'bytes',__import__('os').path.getsize(p)) print('firstpage',r.pages[0].extract_text()[:120]) PY

Running Command

python - <<'PY' from reportlab.lib.pagesizes import A4 from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib import colors from reportlab.lib.enums import TA_CENTER from reportlab.lib.units import cm from reportlab.lib.colors import HexColor from reportlab.pdfgen.canvas import Canvas import os base='/tmp/workspace/cleft-sentences-handbook' os.makedirs(base+'/output',exist_ok=True) out=base+'/output/Cleft_Sentences_ESL_Handbook.pdf' N=HexColor('#173F5F'); B=HexColor('#20639B'); T=HexColor('#3CAEA3'); Y=HexColor('#F6D55C'); C=HexColor('#ED553B'); M=HexColor('#E8F7F5'); PINK=HexColor('#FCE8ED'); PALE=HexColor('#F4F9FC'); INK=HexColor('#263238') s=getSampleStyleSheet() def sty(n,parent,size,lead,color,**kw): s.add(ParagraphStyle(name=n,parent=s[parent],fontName=kw.pop('font','Helvetica'),fontSize=size,leading=lead,textColor=color,**kw)) sty('Title2','Title',30,35,colors.white,alignment=TA_CENTER,font='Helvetica-Bold'); sty('Sub','BodyText',14,19,colors.white,alignment=TA_CENTER); sty('H1','Heading1',22,27,N,font='Helvetica-Bold',spaceAfter=10); sty('H2','Heading2',14,18,B,font='Helvetica-Bold',spaceBefore=8,spaceAfter=5); sty('Body','BodyText',10.6,15,INK); sty('Small','BodyText',9.2,12,INK); sty('BoxT','BodyText',11.5,14,N,font='Helvetica-Bold'); sty('Center','BodyText',12,16,N,font='Helvetica-Bold',alignment=TA_CENTER) def p(x,st='Body'): return Paragraph(x,s[st]) def callout(title, body, bg=M, line=T): tb=Table([[p(title,'BoxT')],[p(body)]],colWidths=[17.2*cm]) tb.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),bg),('BOX',(0,0),(-1,-1),1,line),('LINEBEFORE',(0,0),(0,-1),5,line),('LEFTPADDING',(0,0),(-1,-1),11),('RIGHTPADDING',(0,0),(-1,-1),11),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)])) return tb def ex(normal, cleft, focus): tb=Table([[p('<b>Normal:</b> '+normal),p('<b>Cleft:</b> '+cleft+'<br/><font color="#20639B"><b>Focus:</b> '+focus+'</font>')]],colWidths=[8.5*cm,8.7*cm]) tb.setStyle(TableStyle([('BACKGROUND',(0,0),(0,0),PALE),('BACKGROUND',(1,0),(1,0),HexColor('#FFF5C8')),('BOX',(0,0),(-1,-1),.5,HexColor('#A7C4D3')),('INNERGRID',(0,0),(-1,-1),.4,HexColor('#A7C4D3')),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)])) return tb class C(Canvas): def __init__(self,*a,**k): super().__init__(*a,**k);self.states=[] def showPage(self): self.states.append(dict(self.__dict__));self._startPage() def save(self): total=len(self.states) for st in self.states: self.__dict__.update(st) if self._pageNumber>1: self.setFillColor(N);self.rect(0,0,21*cm,.45*cm,fill=1,stroke=0);self.setFillColor(colors.white);self.setFont('Helvetica',8);self.drawString(1.4*cm,.15*cm,'CLEFT SENTENCES | ESL HANDBOOK');self.drawRightString(19.6*cm,.15*cm,f'{self._pageNumber-1} / {total-1}') super().showPage() super().save() doc=SimpleDocTemplate(out,pagesize=A4,leftMargin=1.4*cm,rightMargin=1.4*cm,topMargin=1.25*cm,bottomMargin=1.15*cm) st=[] # cover st += [Spacer(1,2.1*cm)] tb=Table([[p('CLEFT<br/>SENTENCES','Title2')],[p('Make the important idea stand out!', 'Sub')],[Spacer(1,.25*cm)],[p('A colourful, easy-to-use grammar handbook for ESL learners','Sub')]],colWidths=[16.5*cm]) tb.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),N),('BOX',(0,0),(-1,-1),2,N),('TOPPADDING',(0,0),(-1,-1),13),('BOTTOMPADDING',(0,0),(-1,-1),13),('VALIGN',(0,0),(-1,-1),'MIDDLE')])) st += [tb,Spacer(1,.7*cm),callout('THE BIG IDEA','A <b>cleft sentence</b> divides one simple message into two parts. We do this to put a spotlight on the information we want people to notice.',bg=HexColor('#FFF5C8'),line=C),Spacer(1,.5*cm),p('Think of it like a highlighter: one part of the message becomes more noticeable.','Center'),Spacer(1,1*cm),p('Inside this handbook','H2'),p('1. Why use cleft sentences? &nbsp; • &nbsp; 2. <b>It</b>-clefts &nbsp; • &nbsp; 3. <b>What</b>-clefts<br/>4. Other useful patterns &nbsp; • &nbsp; 5. Practice and answers'),PageBreak()] # intro st += [p('1. Why use a cleft sentence?','H1'),p('English normally gives information in a neutral order. A cleft sentence changes the spotlight. Use one to correct someone, show contrast, answer a question clearly, or add interest to a story.'),callout('NEUTRAL MESSAGE','Maya sent the email on Monday.',bg=PALE,line=B),Spacer(1,.16*cm),callout('WITH A SPOTLIGHT','<b>It was Maya who sent the email on Monday.</b><br/>Now we understand that <i>Maya</i>, not someone else, is the important information.'),Spacer(1,.18*cm),p('Compare the focus','H2'),ex('Leo found the keys in the kitchen.','<b>It was Leo who</b> found the keys in the kitchen.','Who found them? Leo.'),Spacer(1,.15*cm),ex('Leo found the keys in the kitchen.','<b>It was in the kitchen that</b> Leo found the keys.','Where did he find them?'),Spacer(1,.15*cm),ex('Leo found the keys in the kitchen.','<b>What Leo found was</b> the keys.','What did he find?'),Spacer(1,.3*cm),callout('EASY CHECK','Ask: <b>“Which information do I want to make strongest?”</b> Put that information after <b>it was / it is</b>, or at the end of a <b>what</b>-cleft.',bg=PINK,line=C),PageBreak()] # it cleft st += [p('2. The “It” cleft','H1'),p('This is the most common type. Use it to highlight a <b>person, thing, place, time,</b> or <b>reason</b>.'),callout('PATTERN','<b>It + be + focus + who / that + the rest of the message.</b><br/><br/><b>It was my neighbour who</b> helped me.<br/><b>It is after lunch that</b> I study best.',bg=HexColor('#FFF5C8'),line=C),p('Choose <i>who</i> or <i>that</i>','H2'),p('For people, use <b>who</b> or <b>that</b>. For things, places, times, and reasons, use <b>that</b>.') ,ex('My sister baked the cake.','It was <b>my sister</b> who baked the cake.','person'),Spacer(1,.13*cm),ex('We met at the library.','It was <b>at the library</b> that we met.','place'),Spacer(1,.13*cm),ex('The train leaves at 6:30.','It is <b>at 6:30</b> that the train leaves.','time'),Spacer(1,.13*cm),ex('I called because I needed advice.','It was <b>because I needed advice</b> that I called.','reason'),Spacer(1,.25*cm),callout('TENSE TIP','Use <b>It is</b> for now or a general fact. Use <b>It was</b> for the past.<br/><br/><b>It is</b> my aunt who teaches French. &nbsp; <b>It was</b> my aunt who taught me French.'),PageBreak()] # what st += [p('3. The “What” cleft','H1'),p('A <b>what</b>-cleft is useful when the important information is an action, object, or idea. The <b>what-clause</b> comes first.'),callout('PATTERN','<b>What + subject + verb + be + focus.</b><br/><br/><b>What I need is</b> a quiet room.<br/><b>What surprised us was</b> the ending.',bg=HexColor('#FFF5C8'),line=C),p('How to build one','H2'),p('Normal sentence: <b>I need a quiet room.</b><br/>Ask: “What do I need?”<br/>Cleft sentence: <b>What I need is a quiet room.</b>'),ex('I enjoy the friendly atmosphere most.','<b>What I enjoy most is</b> the friendly atmosphere.','thing / idea'),Spacer(1,.13*cm),ex('The team needs more practice.','<b>What the team needs is</b> more practice.','thing'),Spacer(1,.13*cm),ex('She did not listen carefully.','<b>What she did not do was</b> listen carefully.','action'),Spacer(1,.13*cm),ex('They forgot their passports.','<b>What they forgot was</b> their passports.','object'),Spacer(1,.25*cm),callout('SINGULAR OR PLURAL?','Both can be heard: <b>What I need is more time.</b> / <b>What I need are two pens.</b><br/>For ESL writing, <b>is</b> after the what-clause is a safe and common choice.',bg=PINK,line=C),PageBreak()] # other st += [p('4. More useful spotlight patterns','H1'),p('These patterns use a question word as a guide to the most important information.')] data=[[p('<b>Pattern</b>','Small'),p('<b>Use it for</b>','Small'),p('<b>Example</b>','Small')],[p('<b>The person who...</b>','Small'),p('a person','Small'),p('<b>The person who called me was</b> our manager.','Small')],[p('<b>The place where...</b>','Small'),p('a place','Small'),p('<b>The place where we first met was</b> a small café.','Small')],[p('<b>The reason why...</b>','Small'),p('a reason','Small'),p('<b>The reason why I stayed home was</b> the rain.','Small')],[p('<b>All I did was...</b>','Small'),p('one simple action','Small'),p('<b>All I did was</b> ask a question.','Small')],[p('<b>The one thing that...</b>','Small'),p('one important thing','Small'),p('<b>The one thing that worries me is</b> the cost.','Small')]] tb=Table(data,colWidths=[4.4*cm,3.1*cm,9.7*cm]);tb.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,0),N),('TEXTCOLOR',(0,0),(-1,0),colors.white),('ROWBACKGROUNDS',(0,1),(-1,-1),[PALE,M]),('GRID',(0,0),(-1,-1),.4,HexColor('#A7C4D3')),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),7),('RIGHTPADDING',(0,0),(-1,-1),7),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)])) st += [tb,Spacer(1,.35*cm),p('Common mistakes to avoid','H2'),callout('CHECK THESE','1. <font color="#B22222">It was Friday I arrived.</font> → <font color="#147A6D"><b>It was Friday that I arrived.</b></font><br/><br/>2. <font color="#B22222">It is yesterday that I met him.</font> → <font color="#147A6D"><b>It was yesterday that I met him.</b></font><br/><br/>3. For people, say <b>It was Sam who...</b>',bg=PINK,line=C),Spacer(1,.3*cm),callout('SPEAKING TIP','Say the focus a little more strongly: <b>It was MY SISTER who made it.</b> Your voice helps the listener hear the spotlight.',bg=HexColor('#FFF5C8'),line=C),PageBreak()] # practice st += [p('5. Try it yourself!','H1'),p('Rewrite each sentence as a cleft sentence. Choose the phrase in <b>bold</b> as the focus.')] for q in ['1. <b>Omar</b> solved the puzzle.','2. We are going to travel <b>in July</b>.','3. Nina bought <b>a new laptop</b>.','4. I like <b>the music</b> best about this café.','5. The children played <b>in the garden</b>.','6. I am upset because <b>nobody told me</b>.','7. My teacher gave me <b>useful feedback</b>.','8. They only <b>waited for the bus</b>.']: st += [p(q),Spacer(1,.1*cm),Table([['']],colWidths=[17.2*cm],rowHeights=[.43*cm],style=TableStyle([('LINEBELOW',(0,0),(-1,-1),.6,HexColor('#95B7C8'))])),Spacer(1,.15*cm)] st += [callout('MINI CHALLENGE','Write one cleft sentence about your day. Begin: <b>What made me happy today was ...</b>',bg=HexColor('#FFF5C8'),line=C),PageBreak()] # answer st += [p('Answers and quick recap','H1'),p('Possible answers','H2')] for x in ['1. <b>It was Omar who</b> solved the puzzle.','2. <b>It is in July that</b> we are going to travel.','3. <b>What Nina bought was</b> a new laptop.','4. <b>What I like best about this café is</b> the music.','5. <b>It was in the garden that</b> the children played.','6. <b>What upsets me is that</b> nobody told me.','7. <b>What my teacher gave me was</b> useful feedback.','8. <b>All they did was</b> wait for the bus.']: st += [p(x)] st += [Spacer(1,.25*cm),callout('REMEMBER','<b>It-cleft:</b> It was / is + focus + who / that + rest.<br/><b>What-cleft:</b> What + subject + verb + is / was + focus.<br/><br/>Use cleft sentences when you want your listener or reader to notice one part of the message.'),Spacer(1,.3*cm),p('Keep practising: say a normal sentence first, ask “What is important here?”, then put that part in the spotlight.','Center')] doc.build(st,canvasmaker=C) print(out) PY python - <<'PY' from pypdf import PdfReader import os p='/tmp/workspace/cleft-sentences-handbook/output/Cleft_Sentences_ESL_Handbook.pdf' r=PdfReader(p);print('pages=',len(r.pages),'size=',os.path.getsize(p));print(r.pages[0].extract_text()[:80]) PY

Running Command

python - <<'PY' from reportlab.lib.pagesizes import A4 from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib import colors from reportlab.lib.enums import TA_CENTER from reportlab.lib.units import cm from reportlab.lib.colors import HexColor from reportlab.pdfgen.canvas import Canvas from pypdf import PdfReader import os out='/tmp/workspace/cleft-sentences-handbook/output/Cleft_Sentences_ESL_Handbook.pdf'; os.makedirs(os.path.dirname(out),exist_ok=True) navy=HexColor('#173F5F'); blue=HexColor('#20639B'); teal=HexColor('#3CAEA3'); yellow=HexColor('#F6D55C'); coral=HexColor('#ED553B'); mint=HexColor('#E8F7F5'); pink=HexColor('#FCE8ED'); pale=HexColor('#F4F9FC'); ink=HexColor('#263238') s=getSampleStyleSheet() def add(n,base,size,lead,col,font='Helvetica',**k):s.add(ParagraphStyle(name=n,parent=s[base],fontName=font,fontSize=size,leading=lead,textColor=col,**k)) add('CT','Title',30,35,colors.white,'Helvetica-Bold',alignment=TA_CENTER);add('CS','BodyText',14,19,colors.white,alignment=TA_CENTER);add('H1','Heading1',22,27,navy,'Helvetica-Bold',spaceAfter=10);add('H2','Heading2',14,18,blue,'Helvetica-Bold',spaceBefore=8,spaceAfter=5);add('B','BodyText',10.5,14.6,ink);add('S','BodyText',9.2,12,ink);add('BT','BodyText',11.5,14,navy,'Helvetica-Bold');add('CN','BodyText',12,16,navy,'Helvetica-Bold',alignment=TA_CENTER) def p(x,k='B'):return Paragraph(x,s[k]) def box(title,text,bg=mint,line=teal): t=Table([[p(title,'BT')],[p(text)]],colWidths=[17.2*cm]);t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),bg),('BOX',(0,0),(-1,-1),1,line),('LINEBEFORE',(0,0),(0,-1),5,line),('LEFTPADDING',(0,0),(-1,-1),11),('RIGHTPADDING',(0,0),(-1,-1),11),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)]));return t def ex(a,b,c): t=Table([[p('<b>Normal:</b> '+a),p('<b>Cleft:</b> '+b+'<br/><font color="#20639B"><b>Focus:</b> '+c+'</font>')]],colWidths=[8.5*cm,8.7*cm]);t.setStyle(TableStyle([('BACKGROUND',(0,0),(0,0),pale),('BACKGROUND',(1,0),(1,0),HexColor('#FFF5C8')),('BOX',(0,0),(-1,-1),.5,HexColor('#A7C4D3')),('INNERGRID',(0,0),(-1,-1),.4,HexColor('#A7C4D3')),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)]));return t class FooterCanvas(Canvas): def __init__(self,*a,**k):super().__init__(*a,**k);self.states=[] def showPage(self):self.states.append(dict(self.__dict__));self._startPage() def save(self): total=len(self.states) for st in self.states: self.__dict__.update(st) if self._pageNumber>1: self.setFillColor(navy);self.rect(0,0,21*cm,.45*cm,fill=1,stroke=0);self.setFillColor(colors.white);self.setFont('Helvetica',8);self.drawString(1.4*cm,.15*cm,'CLEFT SENTENCES | ESL HANDBOOK');self.drawRightString(19.6*cm,.15*cm,f'{self._pageNumber-1} / {total-1}') Canvas.showPage(self) Canvas.save(self) d=SimpleDocTemplate(out,pagesize=A4,leftMargin=1.4*cm,rightMargin=1.4*cm,topMargin=1.25*cm,bottomMargin=1.15*cm); z=[] # Cover cover=Table([[p('CLEFT<br/>SENTENCES','CT')],[p('Make the important idea stand out!','CS')],[Spacer(1,.25*cm)],[p('A colourful, easy-to-use grammar handbook for ESL learners','CS')]],colWidths=[16.5*cm]);cover.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),navy),('BOX',(0,0),(-1,-1),2,navy),('TOPPADDING',(0,0),(-1,-1),13),('BOTTOMPADDING',(0,0),(-1,-1),13)]));z += [Spacer(1,2.1*cm),cover,Spacer(1,.7*cm),box('THE BIG IDEA','A <b>cleft sentence</b> divides one simple message into two parts. We do this to put a spotlight on the information we want people to notice.',HexColor('#FFF5C8'),coral),Spacer(1,.5*cm),p('Think of it like a highlighter: one part of the message becomes more noticeable.','CN'),Spacer(1,1*cm),p('Inside this handbook','H2'),p('1. Why use cleft sentences? &nbsp; • &nbsp; 2. <b>It</b>-clefts &nbsp; • &nbsp; 3. <b>What</b>-clefts<br/>4. Other useful patterns &nbsp; • &nbsp; 5. Practice and answers'),PageBreak()] # 1 z += [p('1. Why use a cleft sentence?','H1'),p('English normally gives information in a neutral order. A cleft sentence changes the spotlight. Use one to correct someone, show contrast, answer a question clearly, or add interest to a story.'),box('NEUTRAL MESSAGE','Maya sent the email on Monday.',pale,blue),Spacer(1,.16*cm),box('WITH A SPOTLIGHT','<b>It was Maya who sent the email on Monday.</b><br/>Now we understand that <i>Maya</i>, not someone else, is the important information.'),p('Compare the focus','H2'),ex('Leo found the keys in the kitchen.','<b>It was Leo who</b> found the keys in the kitchen.','Who found them? Leo.'),Spacer(1,.14*cm),ex('Leo found the keys in the kitchen.','<b>It was in the kitchen that</b> Leo found the keys.','Where did he find them?'),Spacer(1,.14*cm),ex('Leo found the keys in the kitchen.','<b>What Leo found was</b> the keys.','What did he find?'),Spacer(1,.28*cm),box('EASY CHECK','Ask: <b>“Which information do I want to make strongest?”</b> Put that information after <b>it was / it is</b>, or at the end of a <b>what</b>-cleft.',pink,coral),PageBreak()] # 2 z += [p('2. The “It” cleft','H1'),p('This is the most common type. Use it to highlight a <b>person, thing, place, time,</b> or <b>reason</b>.'),box('PATTERN','<b>It + be + focus + who / that + the rest of the message.</b><br/><br/><b>It was my neighbour who</b> helped me.<br/><b>It is after lunch that</b> I study best.',HexColor('#FFF5C8'),coral),p('Choose <i>who</i> or <i>that</i>','H2'),p('For people, use <b>who</b> or <b>that</b>. For things, places, times, and reasons, use <b>that</b>.'),ex('My sister baked the cake.','It was <b>my sister</b> who baked the cake.','person'),Spacer(1,.13*cm),ex('We met at the library.','It was <b>at the library</b> that we met.','place'),Spacer(1,.13*cm),ex('The train leaves at 6:30.','It is <b>at 6:30</b> that the train leaves.','time'),Spacer(1,.13*cm),ex('I called because I needed advice.','It was <b>because I needed advice</b> that I called.','reason'),Spacer(1,.25*cm),box('TENSE TIP','Use <b>It is</b> for now or a general fact. Use <b>It was</b> for the past.<br/><br/><b>It is</b> my aunt who teaches French. &nbsp; <b>It was</b> my aunt who taught me French.'),PageBreak()] # 3 z += [p('3. The “What” cleft','H1'),p('A <b>what</b>-cleft is useful when the important information is an action, object, or idea. The <b>what-clause</b> comes first.'),box('PATTERN','<b>What + subject + verb + be + focus.</b><br/><br/><b>What I need is</b> a quiet room.<br/><b>What surprised us was</b> the ending.',HexColor('#FFF5C8'),coral),p('How to build one','H2'),p('Normal sentence: <b>I need a quiet room.</b><br/>Ask: “What do I need?”<br/>Cleft sentence: <b>What I need is a quiet room.</b>'),ex('I enjoy the friendly atmosphere most.','<b>What I enjoy most is</b> the friendly atmosphere.','thing / idea'),Spacer(1,.13*cm),ex('The team needs more practice.','<b>What the team needs is</b> more practice.','thing'),Spacer(1,.13*cm),ex('She did not listen carefully.','<b>What she did not do was</b> listen carefully.','action'),Spacer(1,.13*cm),ex('They forgot their passports.','<b>What they forgot was</b> their passports.','object'),Spacer(1,.25*cm),box('SINGULAR OR PLURAL?','Both can be heard: <b>What I need is more time.</b> / <b>What I need are two pens.</b><br/>For ESL writing, <b>is</b> after the what-clause is a safe and common choice.',pink,coral),PageBreak()] # 4 patterns z += [p('4. More useful spotlight patterns','H1'),p('These patterns use a question word as a guide to the most important information.')] data=[[p('<b>Pattern</b>','S'),p('<b>Use it for</b>','S'),p('<b>Example</b>','S')],[p('<b>The person who...</b>','S'),p('a person','S'),p('<b>The person who called me was</b> our manager.','S')],[p('<b>The place where...</b>','S'),p('a place','S'),p('<b>The place where we first met was</b> a small café.','S')],[p('<b>The reason why...</b>','S'),p('a reason','S'),p('<b>The reason why I stayed home was</b> the rain.','S')],[p('<b>All I did was...</b>','S'),p('one simple action','S'),p('<b>All I did was</b> ask a question.','S')],[p('<b>The one thing that...</b>','S'),p('one important thing','S'),p('<b>The one thing that worries me is</b> the cost.','S')]] t=Table(data,colWidths=[4.4*cm,3.1*cm,9.7*cm]);t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,0),navy),('TEXTCOLOR',(0,0),(-1,0),colors.white),('ROWBACKGROUNDS',(0,1),(-1,-1),[pale,mint]),('GRID',(0,0),(-1,-1),.4,HexColor('#A7C4D3')),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),7),('RIGHTPADDING',(0,0),(-1,-1),7),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)]));z += [t,Spacer(1,.35*cm),p('Common mistakes to avoid','H2'),box('CHECK THESE','1. <font color="#B22222">It was Friday I arrived.</font> → <font color="#147A6D"><b>It was Friday that I arrived.</b></font><br/><br/>2. <font color="#B22222">It is yesterday that I met him.</font> → <font color="#147A6D"><b>It was yesterday that I met him.</b></font><br/><br/>3. For people, say <b>It was Sam who...</b>',pink,coral),Spacer(1,.25*cm),box('SPEAKING TIP','Say the focus a little more strongly: <b>It was MY SISTER who made it.</b> Your voice helps the listener hear the spotlight.',HexColor('#FFF5C8'),coral),PageBreak()] # practice answer z += [p('5. Try it yourself!','H1'),p('Rewrite each sentence as a cleft sentence. Choose the phrase in <b>bold</b> as the focus.')] for q in ['1. <b>Omar</b> solved the puzzle.','2. We are going to travel <b>in July</b>.','3. Nina bought <b>a new laptop</b>.','4. I like <b>the music</b> best about this café.','5. The children played <b>in the garden</b>.','6. I am upset because <b>nobody told me</b>.','7. My teacher gave me <b>useful feedback</b>.','8. They only <b>waited for the bus</b>.']: z += [p(q),Spacer(1,.09*cm),Table([['']],colWidths=[17.2*cm],rowHeights=[.4*cm],style=TableStyle([('LINEBELOW',(0,0),(-1,-1),.6,HexColor('#95B7C8'))])),Spacer(1,.13*cm)] z += [box('MINI CHALLENGE','Write one cleft sentence about your day. Begin: <b>What made me happy today was ...</b>',HexColor('#FFF5C8'),coral),PageBreak(),p('Answers and quick recap','H1'),p('Possible answers','H2')] for a in ['1. <b>It was Omar who</b> solved the puzzle.','2. <b>It is in July that</b> we are going to travel.','3. <b>What Nina bought was</b> a new laptop.','4. <b>What I like best about this café is</b> the music.','5. <b>It was in the garden that</b> the children played.','6. <b>What upsets me is that</b> nobody told me.','7. <b>What my teacher gave me was</b> useful feedback.','8. <b>All they did was</b> wait for the bus.']:z += [p(a)] z += [Spacer(1,.25*cm),box('REMEMBER','<b>It-cleft:</b> It was / is + focus + who / that + rest.<br/><b>What-cleft:</b> What + subject + verb + is / was + focus.<br/><br/>Use cleft sentences when you want your listener or reader to notice one part of the message.'),Spacer(1,.25*cm),p('Keep practising: say a normal sentence first, ask “What is important here?”, then put that part in the spotlight.','CN')] d.build(z,canvasmaker=FooterCanvas) r=PdfReader(out);print('CREATED',len(r.pages),os.path.getsize(out));print(r.pages[0].extract_text()[:100]) PY

Created a colourful 7-page ESL handbook on cleft sentences. It includes:
  • Simple explanations of it-clefts and what-clefts
  • New, student-friendly examples beyond the photo
  • Useful focus patterns, tense tips, and common mistakes
  • Practice exercises with answers
  • A mini speaking and writing challenge

Cleft Sentences ESL Handbook

PDF Document · PDF

Please rewrite the colorful handbook pdf with following changes . Firstly delete that text which shows that it's ba colorful handbook and easy to use handbook because it's not necessary and also delete other similar things which are not important.secondly please delete the headline and information under the headline " inside this handbook", thirdly create 15 questions for practice instead of 8 questions and mention their answers on last page

Reading File
Browsing Directory

~/cleft-sentences-handbook/

Searching the Web

cleft sentences ESL grammar it cleft what cleft examples

Reading File
Running Command

python - <<'PY' from reportlab.lib.pagesizes import A4 from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib import colors from reportlab.lib.enums import TA_CENTER from reportlab.lib.units import cm from reportlab.lib.colors import HexColor from reportlab.pdfgen.canvas import Canvas from pypdf import PdfReader import os out='/tmp/workspace/cleft-sentences-handbook/output/Cleft_Sentences_ESL_Handbook_Revised.pdf' navy=HexColor('#173F5F'); blue=HexColor('#20639B'); teal=HexColor('#3CAEA3'); coral=HexColor('#ED553B'); mint=HexColor('#E8F7F5'); pink=HexColor('#FCE8ED'); pale=HexColor('#F4F9FC'); ink=HexColor('#263238'); cream=HexColor('#FFF5C8') s=getSampleStyleSheet() def add(n,base,size,lead,col,font='Helvetica',**kw): s.add(ParagraphStyle(name=n,parent=s[base],fontName=font,fontSize=size,leading=lead,textColor=col,**kw)) add('CT','Title',32,38,colors.white,'Helvetica-Bold',alignment=TA_CENTER);add('CS','BodyText',15,21,colors.white,alignment=TA_CENTER);add('H1','Heading1',22,27,navy,'Helvetica-Bold',spaceAfter=10);add('H2','Heading2',14,18,blue,'Helvetica-Bold',spaceBefore=7,spaceAfter=5);add('B','BodyText',10.5,14.7,ink);add('S','BodyText',9.1,12,ink);add('BT','BodyText',11.4,14,navy,'Helvetica-Bold');add('CN','BodyText',12,16,navy,'Helvetica-Bold',alignment=TA_CENTER) def p(x,k='B'): return Paragraph(x,s[k]) def box(title,text,bg=mint,line=teal): t=Table([[p(title,'BT')],[p(text)]],colWidths=[17.2*cm]);t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),bg),('BOX',(0,0),(-1,-1),1,line),('LINEBEFORE',(0,0),(0,-1),5,line),('LEFTPADDING',(0,0),(-1,-1),11),('RIGHTPADDING',(0,0),(-1,-1),11),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)]));return t def ex(normal,cleft,focus): t=Table([[p('<b>Normal:</b> '+normal),p('<b>Cleft:</b> '+cleft+'<br/><font color="#20639B"><b>Focus:</b> '+focus+'</font>')]],colWidths=[8.5*cm,8.7*cm]);t.setStyle(TableStyle([('BACKGROUND',(0,0),(0,0),pale),('BACKGROUND',(1,0),(1,0),cream),('BOX',(0,0),(-1,-1),.5,HexColor('#A7C4D3')),('INNERGRID',(0,0),(-1,-1),.4,HexColor('#A7C4D3')),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)]));return t class Foot(Canvas): def __init__(self,*a,**k):super().__init__(*a,**k);self.pages=[] def showPage(self):self.pages.append(dict(self.__dict__));self._startPage() def save(self): n=len(self.pages) for st in self.pages: self.__dict__.update(st) if self._pageNumber>1: self.setFillColor(navy);self.rect(0,0,21*cm,.45*cm,fill=1,stroke=0);self.setFillColor(colors.white);self.setFont('Helvetica',8);self.drawString(1.4*cm,.15*cm,'CLEFT SENTENCES');self.drawRightString(19.6*cm,.15*cm,f'{self._pageNumber-1} / {n-1}') Canvas.showPage(self) Canvas.save(self) doc=SimpleDocTemplate(out,pagesize=A4,leftMargin=1.4*cm,rightMargin=1.4*cm,topMargin=1.25*cm,bottomMargin=1.15*cm);st=[] # cover no unnecessary claims, no contents cover=Table([[p('CLEFT<br/>SENTENCES','CT')],[p('Put the important idea in the spotlight.','CS')]],colWidths=[16.5*cm]);cover.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),navy),('BOX',(0,0),(-1,-1),2,navy),('TOPPADDING',(0,0),(-1,-1),22),('BOTTOMPADDING',(0,0),(-1,-1),22)]));st += [Spacer(1,2.45*cm),cover,Spacer(1,.85*cm),box('THE BIG IDEA','A <b>cleft sentence</b> divides one simple message into two parts. We do this to put a spotlight on the information we want people to notice.',cream,coral),Spacer(1,.55*cm),p('Think of it like a highlighter: one part of the message becomes more noticeable.','CN'),PageBreak()] # explanation1 st += [p('1. Why use a cleft sentence?','H1'),p('English normally gives information in a neutral order. A cleft sentence changes the spotlight. Use one to correct someone, show contrast, answer a question clearly, or add interest to a story.'),box('NEUTRAL MESSAGE','Maya sent the email on Monday.',pale,blue),Spacer(1,.16*cm),box('WITH A SPOTLIGHT','<b>It was Maya who sent the email on Monday.</b><br/>Maya, not someone else, is now the important information.'),p('Compare the focus','H2'),ex('Leo found the keys in the kitchen.','<b>It was Leo who</b> found the keys in the kitchen.','Who found them? Leo.'),Spacer(1,.14*cm),ex('Leo found the keys in the kitchen.','<b>It was in the kitchen that</b> Leo found the keys.','Where did he find them?'),Spacer(1,.14*cm),ex('Leo found the keys in the kitchen.','<b>What Leo found was</b> the keys.','What did he find?'),Spacer(1,.28*cm),box('EASY CHECK','Ask: <b>“Which information do I want to make strongest?”</b> Put that information after <b>it was / it is</b>, or at the end of a <b>what</b>-cleft.',pink,coral),PageBreak()] # it st += [p('2. The “It” cleft','H1'),p('Use this common pattern to highlight a <b>person, thing, place, time,</b> or <b>reason</b>.'),box('PATTERN','<b>It + be + focus + who / that + the rest of the message.</b><br/><br/><b>It was my neighbour who</b> helped me.<br/><b>It is after lunch that</b> I study best.',cream,coral),p('Choose <i>who</i> or <i>that</i>','H2'),p('For people, use <b>who</b> or <b>that</b>. For things, places, times, and reasons, use <b>that</b>.'),ex('My sister baked the cake.','It was <b>my sister</b> who baked the cake.','person'),Spacer(1,.13*cm),ex('We met at the library.','It was <b>at the library</b> that we met.','place'),Spacer(1,.13*cm),ex('The train leaves at 6:30.','It is <b>at 6:30</b> that the train leaves.','time'),Spacer(1,.13*cm),ex('I called because I needed advice.','It was <b>because I needed advice</b> that I called.','reason'),Spacer(1,.25*cm),box('TENSE TIP','Use <b>It is</b> for now or a general fact. Use <b>It was</b> for the past.<br/><br/><b>It is</b> my aunt who teaches French. &nbsp; <b>It was</b> my aunt who taught me French.'),PageBreak()] # what + others st += [p('3. The “What” cleft','H1'),p('A <b>what</b>-cleft is useful when the important information is an action, object, or idea. The <b>what-clause</b> comes first.'),box('PATTERN','<b>What + subject + verb + be + focus.</b><br/><br/><b>What I need is</b> a quiet room.<br/><b>What surprised us was</b> the ending.',cream,coral),p('How to build one','H2'),p('Normal sentence: <b>I need a quiet room.</b><br/>Ask: “What do I need?”<br/>Cleft sentence: <b>What I need is a quiet room.</b>'),ex('I enjoy the friendly atmosphere most.','<b>What I enjoy most is</b> the friendly atmosphere.','thing / idea'),Spacer(1,.13*cm),ex('The team needs more practice.','<b>What the team needs is</b> more practice.','thing'),Spacer(1,.13*cm),ex('She did not listen carefully.','<b>What she did not do was</b> listen carefully.','action'),Spacer(1,.13*cm),ex('They forgot their passports.','<b>What they forgot was</b> their passports.','object'),Spacer(1,.22*cm),box('MORE PATTERNS','<b>The person who called me was</b> our manager.<br/><b>The place where we first met was</b> a small café.<br/><b>The reason why I stayed home was</b> the rain.<br/><b>All I did was</b> ask a question.',pink,coral),PageBreak()] # practice pages 15 qs=['<b>Omar</b> solved the puzzle.','We are going to travel <b>in July</b>.','Nina bought <b>a new laptop</b>.','I like <b>the music</b> best about this café.','The children played <b>in the garden</b>.','I am upset because <b>nobody told me</b>.','My teacher gave me <b>useful feedback</b>.','They only <b>waited for the bus</b>.','<b>My cousin</b> won the chess match.','We had dinner <b>at the new restaurant</b>.','The meeting starts <b>at 9:00</b>.','I need <b>a little more time</b>.','She lost <b>her umbrella</b>.','The reason I called was <b>I needed help</b>.','I enjoy <b>walking by the river</b> most.'] st += [p('4. Practice','H1'),p('Rewrite each sentence as a cleft sentence. Choose the phrase in <b>bold</b> as the focus.')] for i,q in enumerate(qs[:8],1):st += [p(f'{i}. {q}'),Spacer(1,.08*cm),Table([['']],colWidths=[17.2*cm],rowHeights=[.43*cm],style=TableStyle([('LINEBELOW',(0,0),(-1,-1),.6,HexColor('#95B7C8'))])),Spacer(1,.1*cm)] st += [PageBreak(),p('4. Practice continued','H1')] for i,q in enumerate(qs[8:],9):st += [p(f'{i}. {q}'),Spacer(1,.08*cm),Table([['']],colWidths=[17.2*cm],rowHeights=[.55*cm],style=TableStyle([('LINEBELOW',(0,0),(-1,-1),.6,HexColor('#95B7C8'))])),Spacer(1,.17*cm)] st += [Spacer(1,.1*cm),box('MINI CHALLENGE','Write one cleft sentence about your day. Begin: <b>What made me happy today was ...</b>',cream,coral),PageBreak()] # answers final ans=['<b>It was Omar who</b> solved the puzzle.','<b>It is in July that</b> we are going to travel.','<b>What Nina bought was</b> a new laptop.','<b>What I like best about this café is</b> the music.','<b>It was in the garden that</b> the children played.','<b>What upsets me is that</b> nobody told me.','<b>What my teacher gave me was</b> useful feedback.','<b>All they did was</b> wait for the bus.','<b>It was my cousin who</b> won the chess match.','<b>It was at the new restaurant that</b> we had dinner.','<b>It is at 9:00 that</b> the meeting starts.','<b>What I need is</b> a little more time.','<b>What she lost was</b> her umbrella.','<b>It was because I needed help that</b> I called.','<b>What I enjoy most is</b> walking by the river.'] st += [p('Answers','H1'),p('Possible answers','H2')] for i,a in enumerate(ans,1): st.append(p(f'{i}. {a}')) st += [Spacer(1,.25*cm),box('REMEMBER','<b>It-cleft:</b> It was / is + focus + who / that + rest.<br/><b>What-cleft:</b> What + subject + verb + is / was + focus.<br/><br/>Use cleft sentences when you want your listener or reader to notice one part of the message.'),Spacer(1,.22*cm),p('Say a normal sentence first, ask “What is important here?”, then put that part in the spotlight.','CN')] doc.build(st,canvasmaker=Foot) r=PdfReader(out); text='\n'.join(x.extract_text() or '' for x in r.pages);print('pages',len(r.pages),'bytes',os.path.getsize(out));print('practice answers count',text.count('Possible answers'));print('has unwanted', 'Inside this handbook' in text, 'easy-to-use' in text, 'colourful' in text) PY

Revised the PDF with your requested changes:
  • Removed the unnecessary “colourful/easy-to-use handbook” wording and similar extra text.
  • Deleted the “Inside this handbook” heading and its information.
  • Expanded practice from 8 to 15 questions.
  • Added answers for all 15 questions on the final page.

Cleft Sentences ESL Handbook Revised

PDF Document · PDF

Please create the colorful handbook pdf attached by removing the box with heading and information what? Everyone,all women

Reading File
Browsing Directory

~/attachments/09868799-060a-4fe6-92a8-733d45962e9d/

Running Command

python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/attachments/09868799-060a-4fe6-92a8-733d45962e9d/DOC-20261001-WA0012.pdf' r=PdfReader(p) print('pages:',len(r.pages)) for i,page in enumerate(r.pages): print('\n--- PAGE',i+1,'---') print(page.extract_text() or '[no text]') PY

Browsing Directory

~/

Running Command

python - <<'PY' import fitz p='/tmp/workspace/attachments/09868799-060a-4fe6-92a8-733d45962e9d/DOC-20261001-WA0012.pdf' d=fitz.open(p) for pg in d: print('PAGE',pg.number+1,pg.rect) for b in pg.get_text('blocks'): txt=b[4].replace('\n',' | ')[:90] print(tuple(round(x,1) for x in b[:4]),txt) PY

Running Command

python - <<'PY' import pdfplumber p='/tmp/workspace/attachments/09868799-060a-4fe6-92a8-733d45962e9d/DOC-20261001-WA0012.pdf' with pdfplumber.open(p) as pdf: for pi,page in enumerate(pdf.pages,1): print('PAGE',pi,'size',page.width,page.height) words=page.extract_words() for w in words: if w['text'] in {'What?','Everyone?','women?','It’s','It’s'}: print(w) PY

Running Command

python - <<'PY' from pypdf import PdfReader, PdfWriter from reportlab.pdfgen import canvas from reportlab.lib.colors import white from reportlab.lib.utils import ImageReader from io import BytesIO import os src='/tmp/workspace/attachments/09868799-060a-4fe6-92a8-733d45962e9d/DOC-20261001-WA0012.pdf' outdir='/tmp/workspace/culture-identity-handbook/output' os.makedirs(outdir,exist_ok=True) out=outdir+'/Culture_Identity_Handbook_Without_What_Everyone_Box.pdf' reader=PdfReader(src); writer=PdfWriter() for idx,page in enumerate(reader.pages): if idx == 0: # The selected entry runs from approximately 528 to 722 points from the top. # Overlay a white rectangle across its full text column, preserving the rest of the page. packet=BytesIO() c=canvas.Canvas(packet,pagesize=(float(page.mediabox.width),float(page.mediabox.height))) c.setFillColor(white) c.rect(62,105,475,215,fill=1,stroke=0) c.save() packet.seek(0) overlay=PdfReader(packet).pages[0] page.merge_page(overlay) writer.add_page(page) with open(out,'wb') as f: writer.write(f) print(out, os.path.getsize(out), 'pages',len(writer.pages)) PY python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/culture-identity-handbook/output/Culture_Identity_Handbook_Without_What_Everyone_Box.pdf' r=PdfReader(p) print('pages',len(r.pages)) print('page1 first 600 chars:',(r.pages[0].extract_text() or '')[:600]) PY

Removed the complete box headed “What? Everyone? / All women?” from the attached handbook PDF.

Culture Identity Handbook Without What Everyone Box

PDF Document · PDF

This is a shared conversation. Sign in to Orris to start your own chat.