Multiple lines of text with rule?
up vote
1
down vote
favorite
I'm editing a tex file which generates a calendar. It works great, and I want to add text to a day on the calendar. The calendar looks like this currently:
Each cell of the calendar is generated with a command:
documentclass[12pt]{article}
usepackage{amsmath}
usepackage{color}
definecolor{WriteBgSec}{gray}{0.9}
definecolor{Black}{gray}{0}
begin{document}
newlength{DayColWidthMP}
setlength{DayColWidthMP}{0.25textwidth}
newcommand{vstrut}[2][0pt]{rule[#1]{0pt}{#2}}
% Cell format on Monthly Planner
% - template: #1 - color for day number and left rule, #2 - date number
newcommand{CellFormatMPTemplate}[2]{%
% gray bar at the top, ~ half row width
makebox[0pt][l]{smash[b]{color{WriteBgSec}rule[0.4baselineskip]{DayColWidthMP}{0.5baselineskip}}}%
% thin rule to the left almost full heigh
{color{#1}rule[-6baselineskip]{arrayrulewidth}{6baselineskip}}%
% right-aligned date numbers
makebox[2.7ex]{hspace{fill}{color{#1}#2}}%
% the column is centered so force the previous box to the left
hspace*{fill}%
break%
% white last row, makes the left sided line open/incomplete (does not join the one below)
vstrut{1em}}
% These calls are put in a tabular* to make a calendar
CellFormatMPTemplate{Black}{2}
end{document}
I'd like to add holidays below the day number, such as "New Year's Day", "Company Picnic" etc. I cannot for the life of me figure out how to get text to the right of that rule
. I'm not finding much documentation, but I suspect rule
doesn't support this concept of multiple lines of text inline with it?
What options do I have? Should I do something else to draw the line? Can I do something else to get multiple lines of text here?
rules
add a comment |
up vote
1
down vote
favorite
I'm editing a tex file which generates a calendar. It works great, and I want to add text to a day on the calendar. The calendar looks like this currently:
Each cell of the calendar is generated with a command:
documentclass[12pt]{article}
usepackage{amsmath}
usepackage{color}
definecolor{WriteBgSec}{gray}{0.9}
definecolor{Black}{gray}{0}
begin{document}
newlength{DayColWidthMP}
setlength{DayColWidthMP}{0.25textwidth}
newcommand{vstrut}[2][0pt]{rule[#1]{0pt}{#2}}
% Cell format on Monthly Planner
% - template: #1 - color for day number and left rule, #2 - date number
newcommand{CellFormatMPTemplate}[2]{%
% gray bar at the top, ~ half row width
makebox[0pt][l]{smash[b]{color{WriteBgSec}rule[0.4baselineskip]{DayColWidthMP}{0.5baselineskip}}}%
% thin rule to the left almost full heigh
{color{#1}rule[-6baselineskip]{arrayrulewidth}{6baselineskip}}%
% right-aligned date numbers
makebox[2.7ex]{hspace{fill}{color{#1}#2}}%
% the column is centered so force the previous box to the left
hspace*{fill}%
break%
% white last row, makes the left sided line open/incomplete (does not join the one below)
vstrut{1em}}
% These calls are put in a tabular* to make a calendar
CellFormatMPTemplate{Black}{2}
end{document}
I'd like to add holidays below the day number, such as "New Year's Day", "Company Picnic" etc. I cannot for the life of me figure out how to get text to the right of that rule
. I'm not finding much documentation, but I suspect rule
doesn't support this concept of multiple lines of text inline with it?
What options do I have? Should I do something else to draw the line? Can I do something else to get multiple lines of text here?
rules
Welcome to TeX.SE! Please make your code snippet compilable ...
– Kurt
Dec 4 at 3:09
Thanks @Kurt, edited.
– Brad
Dec 4 at 3:20
1
Can you say or indicate with a diagram exactly where you want to put the text? Or is it that you want to put the dates slightly lower so that the rules don't cut through them?
– Andrew
Dec 4 at 3:35
Sorry this wasn't more clear @Andrew! I've updated the request - I want to show holidays and similar events below the day of month number. I can try to photoshop something if that would be helpful
– Brad
Dec 4 at 3:43
There are two baiic approaches. 1) put everything beside the rule into a parbox or minipage the same size. 2) use smash or raisebox to overlap the rule with the text.
– John Kormylo
Dec 4 at 15:30
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm editing a tex file which generates a calendar. It works great, and I want to add text to a day on the calendar. The calendar looks like this currently:
Each cell of the calendar is generated with a command:
documentclass[12pt]{article}
usepackage{amsmath}
usepackage{color}
definecolor{WriteBgSec}{gray}{0.9}
definecolor{Black}{gray}{0}
begin{document}
newlength{DayColWidthMP}
setlength{DayColWidthMP}{0.25textwidth}
newcommand{vstrut}[2][0pt]{rule[#1]{0pt}{#2}}
% Cell format on Monthly Planner
% - template: #1 - color for day number and left rule, #2 - date number
newcommand{CellFormatMPTemplate}[2]{%
% gray bar at the top, ~ half row width
makebox[0pt][l]{smash[b]{color{WriteBgSec}rule[0.4baselineskip]{DayColWidthMP}{0.5baselineskip}}}%
% thin rule to the left almost full heigh
{color{#1}rule[-6baselineskip]{arrayrulewidth}{6baselineskip}}%
% right-aligned date numbers
makebox[2.7ex]{hspace{fill}{color{#1}#2}}%
% the column is centered so force the previous box to the left
hspace*{fill}%
break%
% white last row, makes the left sided line open/incomplete (does not join the one below)
vstrut{1em}}
% These calls are put in a tabular* to make a calendar
CellFormatMPTemplate{Black}{2}
end{document}
I'd like to add holidays below the day number, such as "New Year's Day", "Company Picnic" etc. I cannot for the life of me figure out how to get text to the right of that rule
. I'm not finding much documentation, but I suspect rule
doesn't support this concept of multiple lines of text inline with it?
What options do I have? Should I do something else to draw the line? Can I do something else to get multiple lines of text here?
rules
I'm editing a tex file which generates a calendar. It works great, and I want to add text to a day on the calendar. The calendar looks like this currently:
Each cell of the calendar is generated with a command:
documentclass[12pt]{article}
usepackage{amsmath}
usepackage{color}
definecolor{WriteBgSec}{gray}{0.9}
definecolor{Black}{gray}{0}
begin{document}
newlength{DayColWidthMP}
setlength{DayColWidthMP}{0.25textwidth}
newcommand{vstrut}[2][0pt]{rule[#1]{0pt}{#2}}
% Cell format on Monthly Planner
% - template: #1 - color for day number and left rule, #2 - date number
newcommand{CellFormatMPTemplate}[2]{%
% gray bar at the top, ~ half row width
makebox[0pt][l]{smash[b]{color{WriteBgSec}rule[0.4baselineskip]{DayColWidthMP}{0.5baselineskip}}}%
% thin rule to the left almost full heigh
{color{#1}rule[-6baselineskip]{arrayrulewidth}{6baselineskip}}%
% right-aligned date numbers
makebox[2.7ex]{hspace{fill}{color{#1}#2}}%
% the column is centered so force the previous box to the left
hspace*{fill}%
break%
% white last row, makes the left sided line open/incomplete (does not join the one below)
vstrut{1em}}
% These calls are put in a tabular* to make a calendar
CellFormatMPTemplate{Black}{2}
end{document}
I'd like to add holidays below the day number, such as "New Year's Day", "Company Picnic" etc. I cannot for the life of me figure out how to get text to the right of that rule
. I'm not finding much documentation, but I suspect rule
doesn't support this concept of multiple lines of text inline with it?
What options do I have? Should I do something else to draw the line? Can I do something else to get multiple lines of text here?
rules
rules
edited Dec 4 at 3:42
asked Dec 4 at 2:51
Brad
1064
1064
Welcome to TeX.SE! Please make your code snippet compilable ...
– Kurt
Dec 4 at 3:09
Thanks @Kurt, edited.
– Brad
Dec 4 at 3:20
1
Can you say or indicate with a diagram exactly where you want to put the text? Or is it that you want to put the dates slightly lower so that the rules don't cut through them?
– Andrew
Dec 4 at 3:35
Sorry this wasn't more clear @Andrew! I've updated the request - I want to show holidays and similar events below the day of month number. I can try to photoshop something if that would be helpful
– Brad
Dec 4 at 3:43
There are two baiic approaches. 1) put everything beside the rule into a parbox or minipage the same size. 2) use smash or raisebox to overlap the rule with the text.
– John Kormylo
Dec 4 at 15:30
add a comment |
Welcome to TeX.SE! Please make your code snippet compilable ...
– Kurt
Dec 4 at 3:09
Thanks @Kurt, edited.
– Brad
Dec 4 at 3:20
1
Can you say or indicate with a diagram exactly where you want to put the text? Or is it that you want to put the dates slightly lower so that the rules don't cut through them?
– Andrew
Dec 4 at 3:35
Sorry this wasn't more clear @Andrew! I've updated the request - I want to show holidays and similar events below the day of month number. I can try to photoshop something if that would be helpful
– Brad
Dec 4 at 3:43
There are two baiic approaches. 1) put everything beside the rule into a parbox or minipage the same size. 2) use smash or raisebox to overlap the rule with the text.
– John Kormylo
Dec 4 at 15:30
Welcome to TeX.SE! Please make your code snippet compilable ...
– Kurt
Dec 4 at 3:09
Welcome to TeX.SE! Please make your code snippet compilable ...
– Kurt
Dec 4 at 3:09
Thanks @Kurt, edited.
– Brad
Dec 4 at 3:20
Thanks @Kurt, edited.
– Brad
Dec 4 at 3:20
1
1
Can you say or indicate with a diagram exactly where you want to put the text? Or is it that you want to put the dates slightly lower so that the rules don't cut through them?
– Andrew
Dec 4 at 3:35
Can you say or indicate with a diagram exactly where you want to put the text? Or is it that you want to put the dates slightly lower so that the rules don't cut through them?
– Andrew
Dec 4 at 3:35
Sorry this wasn't more clear @Andrew! I've updated the request - I want to show holidays and similar events below the day of month number. I can try to photoshop something if that would be helpful
– Brad
Dec 4 at 3:43
Sorry this wasn't more clear @Andrew! I've updated the request - I want to show holidays and similar events below the day of month number. I can try to photoshop something if that would be helpful
– Brad
Dec 4 at 3:43
There are two baiic approaches. 1) put everything beside the rule into a parbox or minipage the same size. 2) use smash or raisebox to overlap the rule with the text.
– John Kormylo
Dec 4 at 15:30
There are two baiic approaches. 1) put everything beside the rule into a parbox or minipage the same size. 2) use smash or raisebox to overlap the rule with the text.
– John Kormylo
Dec 4 at 15:30
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Many thanks for the feedback, @John's tip got me on the right path. I used parbox to add text where I needed it. Finished look:
% Cell format on Monthly Planner
% - template: #1 - color for day number and left rule, #2 - date number, #3 - event text to show on date
newcommand{CellFormatMPTemplate}[3]{%
% gray bar at the top, ~ half row height
makebox[0pt][l]{smash[b]{color{WriteBgSec}rule[0.4baselineskip]{DayColWidthMP}{0.5baselineskip}}}%
% thin rule to the left almost full heigh
{color{#1}rule[-6baselineskip]{arrayrulewidth}{6baselineskip}}%
% date numbers and event text
hspace{1ex}parbox[t]{DayColWidthMP-1.5ex}{color{#1}makebox[1.7ex][r]{#2}\scriptsize#3}%
% white last row, makes the left sided line open/incomplete (does not join the one below)
vstrut{1em}}
New contributor
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Many thanks for the feedback, @John's tip got me on the right path. I used parbox to add text where I needed it. Finished look:
% Cell format on Monthly Planner
% - template: #1 - color for day number and left rule, #2 - date number, #3 - event text to show on date
newcommand{CellFormatMPTemplate}[3]{%
% gray bar at the top, ~ half row height
makebox[0pt][l]{smash[b]{color{WriteBgSec}rule[0.4baselineskip]{DayColWidthMP}{0.5baselineskip}}}%
% thin rule to the left almost full heigh
{color{#1}rule[-6baselineskip]{arrayrulewidth}{6baselineskip}}%
% date numbers and event text
hspace{1ex}parbox[t]{DayColWidthMP-1.5ex}{color{#1}makebox[1.7ex][r]{#2}\scriptsize#3}%
% white last row, makes the left sided line open/incomplete (does not join the one below)
vstrut{1em}}
New contributor
add a comment |
up vote
0
down vote
accepted
Many thanks for the feedback, @John's tip got me on the right path. I used parbox to add text where I needed it. Finished look:
% Cell format on Monthly Planner
% - template: #1 - color for day number and left rule, #2 - date number, #3 - event text to show on date
newcommand{CellFormatMPTemplate}[3]{%
% gray bar at the top, ~ half row height
makebox[0pt][l]{smash[b]{color{WriteBgSec}rule[0.4baselineskip]{DayColWidthMP}{0.5baselineskip}}}%
% thin rule to the left almost full heigh
{color{#1}rule[-6baselineskip]{arrayrulewidth}{6baselineskip}}%
% date numbers and event text
hspace{1ex}parbox[t]{DayColWidthMP-1.5ex}{color{#1}makebox[1.7ex][r]{#2}\scriptsize#3}%
% white last row, makes the left sided line open/incomplete (does not join the one below)
vstrut{1em}}
New contributor
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Many thanks for the feedback, @John's tip got me on the right path. I used parbox to add text where I needed it. Finished look:
% Cell format on Monthly Planner
% - template: #1 - color for day number and left rule, #2 - date number, #3 - event text to show on date
newcommand{CellFormatMPTemplate}[3]{%
% gray bar at the top, ~ half row height
makebox[0pt][l]{smash[b]{color{WriteBgSec}rule[0.4baselineskip]{DayColWidthMP}{0.5baselineskip}}}%
% thin rule to the left almost full heigh
{color{#1}rule[-6baselineskip]{arrayrulewidth}{6baselineskip}}%
% date numbers and event text
hspace{1ex}parbox[t]{DayColWidthMP-1.5ex}{color{#1}makebox[1.7ex][r]{#2}\scriptsize#3}%
% white last row, makes the left sided line open/incomplete (does not join the one below)
vstrut{1em}}
New contributor
Many thanks for the feedback, @John's tip got me on the right path. I used parbox to add text where I needed it. Finished look:
% Cell format on Monthly Planner
% - template: #1 - color for day number and left rule, #2 - date number, #3 - event text to show on date
newcommand{CellFormatMPTemplate}[3]{%
% gray bar at the top, ~ half row height
makebox[0pt][l]{smash[b]{color{WriteBgSec}rule[0.4baselineskip]{DayColWidthMP}{0.5baselineskip}}}%
% thin rule to the left almost full heigh
{color{#1}rule[-6baselineskip]{arrayrulewidth}{6baselineskip}}%
% date numbers and event text
hspace{1ex}parbox[t]{DayColWidthMP-1.5ex}{color{#1}makebox[1.7ex][r]{#2}\scriptsize#3}%
% white last row, makes the left sided line open/incomplete (does not join the one below)
vstrut{1em}}
New contributor
New contributor
answered Dec 7 at 5:17
Brad
1064
1064
New contributor
New contributor
add a comment |
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f463084%2fmultiple-lines-of-text-with-rule%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
Welcome to TeX.SE! Please make your code snippet compilable ...
– Kurt
Dec 4 at 3:09
Thanks @Kurt, edited.
– Brad
Dec 4 at 3:20
1
Can you say or indicate with a diagram exactly where you want to put the text? Or is it that you want to put the dates slightly lower so that the rules don't cut through them?
– Andrew
Dec 4 at 3:35
Sorry this wasn't more clear @Andrew! I've updated the request - I want to show holidays and similar events below the day of month number. I can try to photoshop something if that would be helpful
– Brad
Dec 4 at 3:43
There are two baiic approaches. 1) put everything beside the rule into a parbox or minipage the same size. 2) use smash or raisebox to overlap the rule with the text.
– John Kormylo
Dec 4 at 15:30