Center page as a whole without centering each element individuallyCenter figure which spans over whole pagecenter and centeringcentering doesn't seem to center my textHow to center align the whole table?How to center align the whole table?The photo doesn't center when using centeringCenter the text in whole pageCentering versus Centercentering does not center textWhy does centering not center?

Why would five hundred and five be same as one?

Why the "ls" command is showing the permissions of files in a FAT32 partition?

Mimic lecturing on blackboard, facing audience

Can you identify this lizard-like creature I observed in the UK?

PTIJ: does fasting on Ta'anis Esther give us reward as if we celebrated 2 Purims? (similar to Yom Kippur)

How to leave product feedback on macOS?

Echo with obfuscation

What the heck is gets(stdin) on site coderbyte?

Sigmoid with a slope but no asymptotes?

Should I assume I have passed probation?

Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?

Telemetry for feature health

Why can't the Brexit deadlock in the UK parliament be solved with a plurality vote?

Make a Bowl of Alphabet Soup

What is this high flying aircraft over Pennsylvania?

Can I cause damage to electrical appliances by unplugging them when they are turned on?

Storage of electrolytic capacitors - how long?

Given this phrasing in the lease, when should I pay my rent?

How do I prevent inappropriate ads from appearing in my game?

Is there a RAID 0 Equivalent for RAM?

Why is the principal energy of an electron lower for excited electrons in a higher energy state?

Why is participating in the European Parliamentary elections used as a threat?

Why is the sun approximated as a black body at ~ 5800 K?

Do I have to know the General Relativity theory to understand the concept of inertial frame?



Center page as a whole without centering each element individually


Center figure which spans over whole pagecenter and centeringcentering doesn't seem to center my textHow to center align the whole table?How to center align the whole table?The photo doesn't center when using centeringCenter the text in whole pageCentering versus Centercentering does not center textWhy does centering not center?













2















I have some narrow text and tabular environments that I'd like to center based on the horizontal space they use up in total. However, it's important that when centered, the original alignments between the elements are preserved. So the effect would be more like increasing margins. Naturally, centering won't work, as it centers every element individually.



The closest I've come is using a minipage and scaling the width by eye. The total width of the page content might vary though. So is there a way to do this kind of centering?



I guess if there's a way to measure the total width that a page takes, it could be fed to minipage. I have very little experience with LaTeX macros and what's generally possible. So any help would be greatly appreciated!




Here's an example.



Situation now



Wanted result




And a minimal code with all cases:



documentclass[12pt]article
usepackage[margin=1in]geometry
usepackage[utf8]inputenc
usepackage[finnish]babel
usepackagegensymb

setlengthparskip1em

begindocument

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular

centering
Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular

centering
beginminipage0.3linewidth
setlengthparskip1em

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular
endminipage
enddocument









share|improve this question



















  • 1





    Please make a minimal working example (MWE) that illustrates your issue.

    – leandriis
    yesterday






  • 1





    If you can provide the code that produces the above content, one could better assist you with ideas on how to centre the content.

    – Werner
    yesterday











  • @leandriis Added.

    – Felix
    yesterday











  • @Felix: Thanks for adding the example. If I understand you correctly, you basically would like to achieve the result in the third example?

    – leandriis
    yesterday











  • @leandriis Correct, the second one is the attempt using centering, which I'm sure you see is not the proper output.

    – Felix
    yesterday















2















I have some narrow text and tabular environments that I'd like to center based on the horizontal space they use up in total. However, it's important that when centered, the original alignments between the elements are preserved. So the effect would be more like increasing margins. Naturally, centering won't work, as it centers every element individually.



The closest I've come is using a minipage and scaling the width by eye. The total width of the page content might vary though. So is there a way to do this kind of centering?



I guess if there's a way to measure the total width that a page takes, it could be fed to minipage. I have very little experience with LaTeX macros and what's generally possible. So any help would be greatly appreciated!




Here's an example.



Situation now



Wanted result




And a minimal code with all cases:



documentclass[12pt]article
usepackage[margin=1in]geometry
usepackage[utf8]inputenc
usepackage[finnish]babel
usepackagegensymb

setlengthparskip1em

begindocument

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular

centering
Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular

centering
beginminipage0.3linewidth
setlengthparskip1em

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular
endminipage
enddocument









share|improve this question



















  • 1





    Please make a minimal working example (MWE) that illustrates your issue.

    – leandriis
    yesterday






  • 1





    If you can provide the code that produces the above content, one could better assist you with ideas on how to centre the content.

    – Werner
    yesterday











  • @leandriis Added.

    – Felix
    yesterday











  • @Felix: Thanks for adding the example. If I understand you correctly, you basically would like to achieve the result in the third example?

    – leandriis
    yesterday











  • @leandriis Correct, the second one is the attempt using centering, which I'm sure you see is not the proper output.

    – Felix
    yesterday













2












2








2








I have some narrow text and tabular environments that I'd like to center based on the horizontal space they use up in total. However, it's important that when centered, the original alignments between the elements are preserved. So the effect would be more like increasing margins. Naturally, centering won't work, as it centers every element individually.



The closest I've come is using a minipage and scaling the width by eye. The total width of the page content might vary though. So is there a way to do this kind of centering?



I guess if there's a way to measure the total width that a page takes, it could be fed to minipage. I have very little experience with LaTeX macros and what's generally possible. So any help would be greatly appreciated!




Here's an example.



Situation now



Wanted result




And a minimal code with all cases:



documentclass[12pt]article
usepackage[margin=1in]geometry
usepackage[utf8]inputenc
usepackage[finnish]babel
usepackagegensymb

setlengthparskip1em

begindocument

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular

centering
Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular

centering
beginminipage0.3linewidth
setlengthparskip1em

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular
endminipage
enddocument









share|improve this question
















I have some narrow text and tabular environments that I'd like to center based on the horizontal space they use up in total. However, it's important that when centered, the original alignments between the elements are preserved. So the effect would be more like increasing margins. Naturally, centering won't work, as it centers every element individually.



The closest I've come is using a minipage and scaling the width by eye. The total width of the page content might vary though. So is there a way to do this kind of centering?



I guess if there's a way to measure the total width that a page takes, it could be fed to minipage. I have very little experience with LaTeX macros and what's generally possible. So any help would be greatly appreciated!




Here's an example.



Situation now



Wanted result




And a minimal code with all cases:



documentclass[12pt]article
usepackage[margin=1in]geometry
usepackage[utf8]inputenc
usepackage[finnish]babel
usepackagegensymb

setlengthparskip1em

begindocument

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular

centering
Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular

centering
beginminipage0.3linewidth
setlengthparskip1em

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular
endminipage
enddocument






horizontal-alignment






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday







Felix

















asked yesterday









FelixFelix

1506




1506







  • 1





    Please make a minimal working example (MWE) that illustrates your issue.

    – leandriis
    yesterday






  • 1





    If you can provide the code that produces the above content, one could better assist you with ideas on how to centre the content.

    – Werner
    yesterday











  • @leandriis Added.

    – Felix
    yesterday











  • @Felix: Thanks for adding the example. If I understand you correctly, you basically would like to achieve the result in the third example?

    – leandriis
    yesterday











  • @leandriis Correct, the second one is the attempt using centering, which I'm sure you see is not the proper output.

    – Felix
    yesterday












  • 1





    Please make a minimal working example (MWE) that illustrates your issue.

    – leandriis
    yesterday






  • 1





    If you can provide the code that produces the above content, one could better assist you with ideas on how to centre the content.

    – Werner
    yesterday











  • @leandriis Added.

    – Felix
    yesterday











  • @Felix: Thanks for adding the example. If I understand you correctly, you basically would like to achieve the result in the third example?

    – leandriis
    yesterday











  • @leandriis Correct, the second one is the attempt using centering, which I'm sure you see is not the proper output.

    – Felix
    yesterday







1




1





Please make a minimal working example (MWE) that illustrates your issue.

– leandriis
yesterday





Please make a minimal working example (MWE) that illustrates your issue.

– leandriis
yesterday




1




1





If you can provide the code that produces the above content, one could better assist you with ideas on how to centre the content.

– Werner
yesterday





If you can provide the code that produces the above content, one could better assist you with ideas on how to centre the content.

– Werner
yesterday













@leandriis Added.

– Felix
yesterday





@leandriis Added.

– Felix
yesterday













@Felix: Thanks for adding the example. If I understand you correctly, you basically would like to achieve the result in the third example?

– leandriis
yesterday





@Felix: Thanks for adding the example. If I understand you correctly, you basically would like to achieve the result in the third example?

– leandriis
yesterday













@leandriis Correct, the second one is the attempt using centering, which I'm sure you see is not the proper output.

– Felix
yesterday





@leandriis Correct, the second one is the attempt using centering, which I'm sure you see is not the proper output.

– Felix
yesterday










2 Answers
2






active

oldest

votes


















3














Instead of a minipage you could use a varwidth environment - this will automatically shrink to the necessary width:



documentclass[12pt]article
usepackage[margin=1in]geometry
usepackage[utf8]inputenc
usepackage[finnish]babel
usepackagegensymb

setlengthparskip1em

usepackagevarwidth

begindocument

centering
beginvarwidthlinewidth
setlengthparskip1em

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular
endvarwidth
enddocument


enter image description here






share|improve this answer

























  • Well damn, yet again I'm not alone with my problems. Simple. Effective. Thanks!

    – Felix
    yesterday











  • @Felix You're welcome! Thanks to the nice MWE you prepared, this was easy to answer!

    – samcarter
    yesterday


















2














I would just set the constructions inside a tabular (that doesn't have any column padding, although that's necessary). The tabular will expand as needed, ultimately representing an unbreakable box that you can centre:



enter image description here



documentclassarticle

usepackage[margin=1in]geometry

begindocument

centering
begintabular@ l @
Intro \
\
begintabular l
C & C
endtabular \
\
Juttu \
\
begintabular l
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C
endtabular
endtabular

enddocument





share|improve this answer























  • Having the line breaks everywhere bothers me a bit. Maybe too much. But yeah, didn't think of that, thanks for the answer!

    – Felix
    yesterday











  • Maybe one could also use Intro \[parskip] instead of Intro \ \ ?

    – leandriis
    yesterday











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480364%2fcenter-page-as-a-whole-without-centering-each-element-individually%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














Instead of a minipage you could use a varwidth environment - this will automatically shrink to the necessary width:



documentclass[12pt]article
usepackage[margin=1in]geometry
usepackage[utf8]inputenc
usepackage[finnish]babel
usepackagegensymb

setlengthparskip1em

usepackagevarwidth

begindocument

centering
beginvarwidthlinewidth
setlengthparskip1em

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular
endvarwidth
enddocument


enter image description here






share|improve this answer

























  • Well damn, yet again I'm not alone with my problems. Simple. Effective. Thanks!

    – Felix
    yesterday











  • @Felix You're welcome! Thanks to the nice MWE you prepared, this was easy to answer!

    – samcarter
    yesterday















3














Instead of a minipage you could use a varwidth environment - this will automatically shrink to the necessary width:



documentclass[12pt]article
usepackage[margin=1in]geometry
usepackage[utf8]inputenc
usepackage[finnish]babel
usepackagegensymb

setlengthparskip1em

usepackagevarwidth

begindocument

centering
beginvarwidthlinewidth
setlengthparskip1em

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular
endvarwidth
enddocument


enter image description here






share|improve this answer

























  • Well damn, yet again I'm not alone with my problems. Simple. Effective. Thanks!

    – Felix
    yesterday











  • @Felix You're welcome! Thanks to the nice MWE you prepared, this was easy to answer!

    – samcarter
    yesterday













3












3








3







Instead of a minipage you could use a varwidth environment - this will automatically shrink to the necessary width:



documentclass[12pt]article
usepackage[margin=1in]geometry
usepackage[utf8]inputenc
usepackage[finnish]babel
usepackagegensymb

setlengthparskip1em

usepackagevarwidth

begindocument

centering
beginvarwidthlinewidth
setlengthparskip1em

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular
endvarwidth
enddocument


enter image description here






share|improve this answer















Instead of a minipage you could use a varwidth environment - this will automatically shrink to the necessary width:



documentclass[12pt]article
usepackage[margin=1in]geometry
usepackage[utf8]inputenc
usepackage[finnish]babel
usepackagegensymb

setlengthparskip1em

usepackagevarwidth

begindocument

centering
beginvarwidthlinewidth
setlengthparskip1em

Intro

begintabularl
C & C \
endtabular

Juttu

begintabularl
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C \
endtabular
endvarwidth
enddocument


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday









Werner

448k709921697




448k709921697










answered yesterday









samcartersamcarter

92.3k7105298




92.3k7105298












  • Well damn, yet again I'm not alone with my problems. Simple. Effective. Thanks!

    – Felix
    yesterday











  • @Felix You're welcome! Thanks to the nice MWE you prepared, this was easy to answer!

    – samcarter
    yesterday

















  • Well damn, yet again I'm not alone with my problems. Simple. Effective. Thanks!

    – Felix
    yesterday











  • @Felix You're welcome! Thanks to the nice MWE you prepared, this was easy to answer!

    – samcarter
    yesterday
















Well damn, yet again I'm not alone with my problems. Simple. Effective. Thanks!

– Felix
yesterday





Well damn, yet again I'm not alone with my problems. Simple. Effective. Thanks!

– Felix
yesterday













@Felix You're welcome! Thanks to the nice MWE you prepared, this was easy to answer!

– samcarter
yesterday





@Felix You're welcome! Thanks to the nice MWE you prepared, this was easy to answer!

– samcarter
yesterday











2














I would just set the constructions inside a tabular (that doesn't have any column padding, although that's necessary). The tabular will expand as needed, ultimately representing an unbreakable box that you can centre:



enter image description here



documentclassarticle

usepackage[margin=1in]geometry

begindocument

centering
begintabular@ l @
Intro \
\
begintabular l
C & C
endtabular \
\
Juttu \
\
begintabular l
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C
endtabular
endtabular

enddocument





share|improve this answer























  • Having the line breaks everywhere bothers me a bit. Maybe too much. But yeah, didn't think of that, thanks for the answer!

    – Felix
    yesterday











  • Maybe one could also use Intro \[parskip] instead of Intro \ \ ?

    – leandriis
    yesterday
















2














I would just set the constructions inside a tabular (that doesn't have any column padding, although that's necessary). The tabular will expand as needed, ultimately representing an unbreakable box that you can centre:



enter image description here



documentclassarticle

usepackage[margin=1in]geometry

begindocument

centering
begintabular@ l @
Intro \
\
begintabular l
C & C
endtabular \
\
Juttu \
\
begintabular l
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C
endtabular
endtabular

enddocument





share|improve this answer























  • Having the line breaks everywhere bothers me a bit. Maybe too much. But yeah, didn't think of that, thanks for the answer!

    – Felix
    yesterday











  • Maybe one could also use Intro \[parskip] instead of Intro \ \ ?

    – leandriis
    yesterday














2












2








2







I would just set the constructions inside a tabular (that doesn't have any column padding, although that's necessary). The tabular will expand as needed, ultimately representing an unbreakable box that you can centre:



enter image description here



documentclassarticle

usepackage[margin=1in]geometry

begindocument

centering
begintabular@ l @
Intro \
\
begintabular l
C & C
endtabular \
\
Juttu \
\
begintabular l
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C
endtabular
endtabular

enddocument





share|improve this answer













I would just set the constructions inside a tabular (that doesn't have any column padding, although that's necessary). The tabular will expand as needed, ultimately representing an unbreakable box that you can centre:



enter image description here



documentclassarticle

usepackage[margin=1in]geometry

begindocument

centering
begintabular@ l @
Intro \
\
begintabular l
C & C
endtabular \
\
Juttu \
\
begintabular l
C & C & Am & G \
C Dm & C & C quad G G & C \
C & C & Am & G \
C Dm & C & C quad G G & C
endtabular
endtabular

enddocument






share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









WernerWerner

448k709921697




448k709921697












  • Having the line breaks everywhere bothers me a bit. Maybe too much. But yeah, didn't think of that, thanks for the answer!

    – Felix
    yesterday











  • Maybe one could also use Intro \[parskip] instead of Intro \ \ ?

    – leandriis
    yesterday


















  • Having the line breaks everywhere bothers me a bit. Maybe too much. But yeah, didn't think of that, thanks for the answer!

    – Felix
    yesterday











  • Maybe one could also use Intro \[parskip] instead of Intro \ \ ?

    – leandriis
    yesterday

















Having the line breaks everywhere bothers me a bit. Maybe too much. But yeah, didn't think of that, thanks for the answer!

– Felix
yesterday





Having the line breaks everywhere bothers me a bit. Maybe too much. But yeah, didn't think of that, thanks for the answer!

– Felix
yesterday













Maybe one could also use Intro \[parskip] instead of Intro \ \ ?

– leandriis
yesterday






Maybe one could also use Intro \[parskip] instead of Intro \ \ ?

– leandriis
yesterday


















draft saved

draft discarded
















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480364%2fcenter-page-as-a-whole-without-centering-each-element-individually%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bulk add to cart function issuecart vs. mini cart issue … rwd themeRedirect Add to cart button to cart pageAdd to cart issue - Magento 2.1The requested Payment Method is not available When creating an orderM2: reason add-to-cart might not function in production modeAdd to cart issue in some android devicesMagento 2 - custom price can not add to subtotal and grand total after add to cartAdd to cart codeIssue with my cart module on pdp and cart pages, just keeps spinningBulk price and quantity update using rest api

Magento2 - How to hide price filter only in specific categories?Multiselect price filter attribute in layered navigationhide only some categories from layered navigation in magentoRemove Price Filter on certain categoriescustomize layered price filter?Hide Price for a particular customer groupPrice filter in layered navigation not working correctly with price including tax in magento 2.2.3Magento 2 how to hide attribute at Layered navigation?Magento 2. how to hide price only for specific categoriesMagento 2 How can I hide the price and total from cart and checkout summary?Magento2: Can we add navigation layered filter like price filter for other attribute?