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:



Calendar screenshot



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?










share|improve this question
























  • 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

















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:



Calendar screenshot



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?










share|improve this question
























  • 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















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:



Calendar screenshot



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?










share|improve this question















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:



Calendar screenshot



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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




















  • 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












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:



enter image description here



% 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}}





share|improve this answer








New contributor




Brad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















    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',
    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%2f463084%2fmultiple-lines-of-text-with-rule%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








    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:



    enter image description here



    % 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}}





    share|improve this answer








    New contributor




    Brad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      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:



      enter image description here



      % 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}}





      share|improve this answer








      New contributor




      Brad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















        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:



        enter image description here



        % 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}}





        share|improve this answer








        New contributor




        Brad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        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:



        enter image description here



        % 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}}






        share|improve this answer








        New contributor




        Brad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        Brad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered Dec 7 at 5:17









        Brad

        1064




        1064




        New contributor




        Brad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Brad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Brad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            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.





            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.




            draft saved


            draft discarded














            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





















































            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

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents