Paragraph with text alignment and width of contained textSubfloat caption width requirements and alignment...
Could a US political party gain complete control over the government by removing checks & balances?
What Brexit solution does the DUP want?
Draw simple lines in Inkscape
What are these boxed doors outside store fronts in New York?
A Journey Through Space and Time
Why is this code 6.5x slower with optimizations enabled?
The use of multiple foreign keys on same column in SQL Server
Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)
Motorized valve interfering with button?
N.B. ligature in Latex
Download, install and reboot computer at night if needed
A function which translates a sentence to title-case
Is there a minimum number of transactions in a block?
Are tax years 2016 & 2017 back taxes deductible for tax year 2018?
Can town administrative "code" overule state laws like those forbidding trespassing?
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?
Concept of linear mappings are confusing me
Is it possible to do 50 km distance without any previous training?
How do I create uniquely male characters?
How to make payment on the internet without leaving a money trail?
How can bays and straits be determined in a procedurally generated map?
XeLaTeX and pdfLaTeX ignore hyphenation
The magic money tree problem
Paragraph with text alignment and width of contained text
Subfloat caption width requirements and alignment problemstext alignment with center environmentText Alignment in paragraph boxColumn with fixed width and centre alignmentCommand to fill paragraph with repeated text (alignment/spacing problem)Text alignment in minipageProblem with alignment paragraph headingLongtable, contained tikz, padding, custom columns, and an alignment issueText alignment with tikzCentering a left-justified column within a tabular environment
I need a (centered) paragraph that has the width of the text that it contains. This text has to be centered/left-aligned/right-aligned (one of these).
The text contains newlines.
It is no problem to set this with a given width but as the text within the paragraph is variable I don't find a way to do this.
I am using the standalone documentclass.
This is the example with fixed height:
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
begin{document}
{fontsize{6}{9}selectfont%hier schon setzenfür em/ex
begin{minipage}{115em}
{centering
begin{tabular}[t]{c}
parbox[t][][t]{92em}{
centering{}textbf{EINE ÜBERSCHRIFT}
}\[0ex]
parbox[t][][t]{92em}{
centering{}{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
}
end{tabular}\[3ex]
}
{centering
parbox[t][][t]{30em}{raggedright{}Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs\[3ex]Fritz Blumenthal}\
}
end{minipage}
}%End fontsize
end{document}
So right now, this parbox has a fixed width and the content is not centered properly:
I want it this way:
Here, the parbox has a width that is fitted to the content and thus it is centered correctly. I cannot use a fixed width as the content is generated by a script and therefore variable.
horizontal-alignment standalone
New contributor
add a comment |
I need a (centered) paragraph that has the width of the text that it contains. This text has to be centered/left-aligned/right-aligned (one of these).
The text contains newlines.
It is no problem to set this with a given width but as the text within the paragraph is variable I don't find a way to do this.
I am using the standalone documentclass.
This is the example with fixed height:
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
begin{document}
{fontsize{6}{9}selectfont%hier schon setzenfür em/ex
begin{minipage}{115em}
{centering
begin{tabular}[t]{c}
parbox[t][][t]{92em}{
centering{}textbf{EINE ÜBERSCHRIFT}
}\[0ex]
parbox[t][][t]{92em}{
centering{}{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
}
end{tabular}\[3ex]
}
{centering
parbox[t][][t]{30em}{raggedright{}Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs\[3ex]Fritz Blumenthal}\
}
end{minipage}
}%End fontsize
end{document}
So right now, this parbox has a fixed width and the content is not centered properly:
I want it this way:
Here, the parbox has a width that is fitted to the content and thus it is centered correctly. I cannot use a fixed width as the content is generated by a script and therefore variable.
horizontal-alignment standalone
New contributor
The your paragraph will have only one line, right? Btw why are you usingstandalone
?
– JouleV
22 hours ago
@JouleV No, it contains several lines (see added picture). Standalone is used to get a pdf without pages.
– Julius S.
22 hours ago
As far as I can understand English, a paragraph doesn't contain new lines or line breaks.
– JouleV
22 hours ago
@JouleV Added code.
– Julius S.
22 hours ago
Added some illustrations.
– Julius S.
22 hours ago
add a comment |
I need a (centered) paragraph that has the width of the text that it contains. This text has to be centered/left-aligned/right-aligned (one of these).
The text contains newlines.
It is no problem to set this with a given width but as the text within the paragraph is variable I don't find a way to do this.
I am using the standalone documentclass.
This is the example with fixed height:
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
begin{document}
{fontsize{6}{9}selectfont%hier schon setzenfür em/ex
begin{minipage}{115em}
{centering
begin{tabular}[t]{c}
parbox[t][][t]{92em}{
centering{}textbf{EINE ÜBERSCHRIFT}
}\[0ex]
parbox[t][][t]{92em}{
centering{}{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
}
end{tabular}\[3ex]
}
{centering
parbox[t][][t]{30em}{raggedright{}Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs\[3ex]Fritz Blumenthal}\
}
end{minipage}
}%End fontsize
end{document}
So right now, this parbox has a fixed width and the content is not centered properly:
I want it this way:
Here, the parbox has a width that is fitted to the content and thus it is centered correctly. I cannot use a fixed width as the content is generated by a script and therefore variable.
horizontal-alignment standalone
New contributor
I need a (centered) paragraph that has the width of the text that it contains. This text has to be centered/left-aligned/right-aligned (one of these).
The text contains newlines.
It is no problem to set this with a given width but as the text within the paragraph is variable I don't find a way to do this.
I am using the standalone documentclass.
This is the example with fixed height:
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
begin{document}
{fontsize{6}{9}selectfont%hier schon setzenfür em/ex
begin{minipage}{115em}
{centering
begin{tabular}[t]{c}
parbox[t][][t]{92em}{
centering{}textbf{EINE ÜBERSCHRIFT}
}\[0ex]
parbox[t][][t]{92em}{
centering{}{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
}
end{tabular}\[3ex]
}
{centering
parbox[t][][t]{30em}{raggedright{}Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs\[3ex]Fritz Blumenthal}\
}
end{minipage}
}%End fontsize
end{document}
So right now, this parbox has a fixed width and the content is not centered properly:
I want it this way:
Here, the parbox has a width that is fitted to the content and thus it is centered correctly. I cannot use a fixed width as the content is generated by a script and therefore variable.
horizontal-alignment standalone
horizontal-alignment standalone
New contributor
New contributor
edited 22 hours ago
JouleV
11.4k22561
11.4k22561
New contributor
asked 22 hours ago
Julius S.Julius S.
1034
1034
New contributor
New contributor
The your paragraph will have only one line, right? Btw why are you usingstandalone
?
– JouleV
22 hours ago
@JouleV No, it contains several lines (see added picture). Standalone is used to get a pdf without pages.
– Julius S.
22 hours ago
As far as I can understand English, a paragraph doesn't contain new lines or line breaks.
– JouleV
22 hours ago
@JouleV Added code.
– Julius S.
22 hours ago
Added some illustrations.
– Julius S.
22 hours ago
add a comment |
The your paragraph will have only one line, right? Btw why are you usingstandalone
?
– JouleV
22 hours ago
@JouleV No, it contains several lines (see added picture). Standalone is used to get a pdf without pages.
– Julius S.
22 hours ago
As far as I can understand English, a paragraph doesn't contain new lines or line breaks.
– JouleV
22 hours ago
@JouleV Added code.
– Julius S.
22 hours ago
Added some illustrations.
– Julius S.
22 hours ago
The your paragraph will have only one line, right? Btw why are you using
standalone
?– JouleV
22 hours ago
The your paragraph will have only one line, right? Btw why are you using
standalone
?– JouleV
22 hours ago
@JouleV No, it contains several lines (see added picture). Standalone is used to get a pdf without pages.
– Julius S.
22 hours ago
@JouleV No, it contains several lines (see added picture). Standalone is used to get a pdf without pages.
– Julius S.
22 hours ago
As far as I can understand English, a paragraph doesn't contain new lines or line breaks.
– JouleV
22 hours ago
As far as I can understand English, a paragraph doesn't contain new lines or line breaks.
– JouleV
22 hours ago
@JouleV Added code.
– Julius S.
22 hours ago
@JouleV Added code.
– Julius S.
22 hours ago
Added some illustrations.
– Julius S.
22 hours ago
Added some illustrations.
– Julius S.
22 hours ago
add a comment |
1 Answer
1
active
oldest
votes
I can't still not figure out why standalone
is really needed in this case - adjusting contents in this class is not easy, when you can always change page size in normal classes.
As for the parbox
, I propose an alternative using TikZ nodes:
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
usepackage{tikz}
begin{document}
fontsize{6}{9}selectfont
begin{minipage}{115em}
centering
begin{tabular}[t]{c}
textbf{EINE ÜBERSCHRIFT}\[0ex]
{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
end{tabular}\[3ex]
tikznode[draw,align=left] {%
Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs lang lang lang lang\[3ex]Fritz Blumenthal};
end{minipage}
end{document}
Removing the draw
option will remove the box.
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
usepackage{tikz}
begin{document}
fontsize{6}{9}selectfont
begin{minipage}{115em}
centering
begin{tabular}[t]{c}
textbf{EINE ÜBERSCHRIFT}\[0ex]
{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
end{tabular}\[3ex]
tikznode[align=left] {%
Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs lang lang lang lang\[3ex]Fritz Blumenthal};
end{minipage}
end{document}
add a comment |
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
});
}
});
Julius S. is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483616%2fparagraph-with-text-alignment-and-width-of-contained-text%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I can't still not figure out why standalone
is really needed in this case - adjusting contents in this class is not easy, when you can always change page size in normal classes.
As for the parbox
, I propose an alternative using TikZ nodes:
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
usepackage{tikz}
begin{document}
fontsize{6}{9}selectfont
begin{minipage}{115em}
centering
begin{tabular}[t]{c}
textbf{EINE ÜBERSCHRIFT}\[0ex]
{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
end{tabular}\[3ex]
tikznode[draw,align=left] {%
Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs lang lang lang lang\[3ex]Fritz Blumenthal};
end{minipage}
end{document}
Removing the draw
option will remove the box.
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
usepackage{tikz}
begin{document}
fontsize{6}{9}selectfont
begin{minipage}{115em}
centering
begin{tabular}[t]{c}
textbf{EINE ÜBERSCHRIFT}\[0ex]
{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
end{tabular}\[3ex]
tikznode[align=left] {%
Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs lang lang lang lang\[3ex]Fritz Blumenthal};
end{minipage}
end{document}
add a comment |
I can't still not figure out why standalone
is really needed in this case - adjusting contents in this class is not easy, when you can always change page size in normal classes.
As for the parbox
, I propose an alternative using TikZ nodes:
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
usepackage{tikz}
begin{document}
fontsize{6}{9}selectfont
begin{minipage}{115em}
centering
begin{tabular}[t]{c}
textbf{EINE ÜBERSCHRIFT}\[0ex]
{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
end{tabular}\[3ex]
tikznode[draw,align=left] {%
Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs lang lang lang lang\[3ex]Fritz Blumenthal};
end{minipage}
end{document}
Removing the draw
option will remove the box.
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
usepackage{tikz}
begin{document}
fontsize{6}{9}selectfont
begin{minipage}{115em}
centering
begin{tabular}[t]{c}
textbf{EINE ÜBERSCHRIFT}\[0ex]
{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
end{tabular}\[3ex]
tikznode[align=left] {%
Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs lang lang lang lang\[3ex]Fritz Blumenthal};
end{minipage}
end{document}
add a comment |
I can't still not figure out why standalone
is really needed in this case - adjusting contents in this class is not easy, when you can always change page size in normal classes.
As for the parbox
, I propose an alternative using TikZ nodes:
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
usepackage{tikz}
begin{document}
fontsize{6}{9}selectfont
begin{minipage}{115em}
centering
begin{tabular}[t]{c}
textbf{EINE ÜBERSCHRIFT}\[0ex]
{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
end{tabular}\[3ex]
tikznode[draw,align=left] {%
Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs lang lang lang lang\[3ex]Fritz Blumenthal};
end{minipage}
end{document}
Removing the draw
option will remove the box.
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
usepackage{tikz}
begin{document}
fontsize{6}{9}selectfont
begin{minipage}{115em}
centering
begin{tabular}[t]{c}
textbf{EINE ÜBERSCHRIFT}\[0ex]
{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
end{tabular}\[3ex]
tikznode[align=left] {%
Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs lang lang lang lang\[3ex]Fritz Blumenthal};
end{minipage}
end{document}
I can't still not figure out why standalone
is really needed in this case - adjusting contents in this class is not easy, when you can always change page size in normal classes.
As for the parbox
, I propose an alternative using TikZ nodes:
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
usepackage{tikz}
begin{document}
fontsize{6}{9}selectfont
begin{minipage}{115em}
centering
begin{tabular}[t]{c}
textbf{EINE ÜBERSCHRIFT}\[0ex]
{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
end{tabular}\[3ex]
tikznode[draw,align=left] {%
Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs lang lang lang lang\[3ex]Fritz Blumenthal};
end{minipage}
end{document}
Removing the draw
option will remove the box.
documentclass[border={0pt 100px 0pt 100px}]{standalone}
usepackage{xcolor,pagecolor,lipsum,pbox,graphicx,anyfontsize}
usepackage[utf8]{inputenc}
usepackage[sfdefault,light]{roboto}
usepackage[T1]{fontenc}
usepackage{tikz}
begin{document}
fontsize{6}{9}selectfont
begin{minipage}{115em}
centering
begin{tabular}[t]{c}
textbf{EINE ÜBERSCHRIFT}\[0ex]
{fontsize{5}{9}selectfont{}Eine Unter-Überschrift}
end{tabular}\[3ex]
tikznode[align=left] {%
Karl Meier\[3ex]Gustav Henrich\[3ex]Lisa Schöne\[3ex]Anton Dachs lang lang lang lang\[3ex]Fritz Blumenthal};
end{minipage}
end{document}
answered 22 hours ago
JouleVJouleV
11.4k22561
11.4k22561
add a comment |
add a comment |
Julius S. is a new contributor. Be nice, and check out our Code of Conduct.
Julius S. is a new contributor. Be nice, and check out our Code of Conduct.
Julius S. is a new contributor. Be nice, and check out our Code of Conduct.
Julius S. is a new contributor. Be nice, and check out our Code of Conduct.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483616%2fparagraph-with-text-alignment-and-width-of-contained-text%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
The your paragraph will have only one line, right? Btw why are you using
standalone
?– JouleV
22 hours ago
@JouleV No, it contains several lines (see added picture). Standalone is used to get a pdf without pages.
– Julius S.
22 hours ago
As far as I can understand English, a paragraph doesn't contain new lines or line breaks.
– JouleV
22 hours ago
@JouleV Added code.
– Julius S.
22 hours ago
Added some illustrations.
– Julius S.
22 hours ago