Aligning minicolumn with tcolorbox

Aligning minicolumn with tcolorbox



I'm trying to align two minipage environments to the page margins (the left minipage to the left margin and the right minipage to the right margin) but it does not seem to work. I also need a space between the two minipages and this is why I gave .45textwidth as parameter instead of .5textwidth to the minipage environments.


minipage


minipage


minipage


minipage


.45textwidth


.5textwidth


minipage


documentclass[10pt]article
usepackage[a4paper,top=15mm,bottom=10mm,left=15mm,right=15mm]geometry
usepackagetcolorbox
usepackagelipsum
begindocument
thispagestyleempty
beginminipage.45textwidth
raggedleft
begintcolorbox
centering
lipsum[1-2]
endtcolorbox
endminipage%
beginminipage.45textwidth
raggedright
begintcolorbox
centering
lipsum[3-4]
endtcolorbox
endminipage
enddocument



Could you please tell me how to align the columns?
Below is the output of my example:



enter image description here




2 Answers
2



Add hfill between the two minipages:


hfill


minipages


documentclass[10pt]article
usepackage[a4paper,top=15mm,bottom=10mm,left=15mm,right=15mm]geometry
usepackagetcolorbox
usepackagelipsum
begindocument
thispagestyleempty
beginminipage.45textwidth
raggedleft
begintcolorbox
centering
lipsum[1-2]
endtcolorbox
endminipage%
hfill
beginminipage.45textwidth
raggedright
begintcolorbox
centering
lipsum[3-4]
endtcolorbox
endminipage
enddocument



enter image description here



If you are using tcolorboxes, you can include them inside a tcbraster. By default columns are aligned to left a right margins and inter column space is 2mm, but you can change it with raster column skip value:


tcolorboxes


tcbraster


raster column skip


documentclass[10pt]article
usepackage[a4paper,top=15mm,bottom=10mm,left=15mm,right=15mm]geometry
usepackage[most]tcolorbox
usepackagelipsum
begindocument
thispagestyleempty
lipsum[1]
begintcbraster[raster columns=2, raster column skip=1cm]
begintcolorbox[halign=center]
lipsum[1-2]
endtcolorbox
begintcolorbox[halign=center]
lipsum[3-4]
endtcolorbox
endtcbraster
enddocument



enter image description here






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

How do I collapse sections of code in Visual Studio Code for Windows?

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ