What's the dotted line equivalent of rule?












4















I'm looking for the dotted line equivalent of :



rule[<height>]{<width>}{<thickness>}


Something that looks like :



.........................










share|improve this question




















  • 2





    You can have an approximation with the dashrule package.

    – Bernard
    Aug 23 '18 at 13:10
















4















I'm looking for the dotted line equivalent of :



rule[<height>]{<width>}{<thickness>}


Something that looks like :



.........................










share|improve this question




















  • 2





    You can have an approximation with the dashrule package.

    – Bernard
    Aug 23 '18 at 13:10














4












4








4


0






I'm looking for the dotted line equivalent of :



rule[<height>]{<width>}{<thickness>}


Something that looks like :



.........................










share|improve this question
















I'm looking for the dotted line equivalent of :



rule[<height>]{<width>}{<thickness>}


Something that looks like :



.........................







line






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 23 '18 at 13:14







Chung Ren Khoo

















asked Aug 23 '18 at 13:08









Chung Ren KhooChung Ren Khoo

1627




1627








  • 2





    You can have an approximation with the dashrule package.

    – Bernard
    Aug 23 '18 at 13:10














  • 2





    You can have an approximation with the dashrule package.

    – Bernard
    Aug 23 '18 at 13:10








2




2





You can have an approximation with the dashrule package.

– Bernard
Aug 23 '18 at 13:10





You can have an approximation with the dashrule package.

– Bernard
Aug 23 '18 at 13:10










1 Answer
1






active

oldest

votes


















0














hdashrule is only an approximation because the dots are little squares, but you can easily do what you need with TikZ.



I have created two commands, dhorline (for horizontal rules) and dvertline (for vertical ones), with the same syntax as rule, where the dots are actual dots.



Here some examples:



documentclass{article}
usepackage{dashrule}
usepackage{tikz}
usetikzlibrary{decorations.markings}
newcommand{dhorline}[3][0]{%
tikz[baseline]{path[decoration={markings,
mark=between positions 0 and 1 step 2*#3
with {node[fill, circle, minimum width=#3, inner sep=0pt, anchor=south west] {};}},postaction={decorate}] (0,#1) -- ++(#2,0);}}
newcommand{dvertline}[3][0]{%
tikz[baseline]{path[decoration={markings,
mark=between positions 0 and 1 step 2*#2
with {node[fill, circle, minimum width=#2, inner sep=0pt, anchor=south west] {};}},postaction={decorate}] (0, #1) -- ++(0,#3);}}
begin{document}
With verb|rule{10em}{4pt}| rule{10em}{4pt}

With verb|hdashrule{10em}{4pt}{4pt}|
hdashrule{10em}{4pt}{4pt}

With verb|dhorline{10em}{4pt}| dhorline{10em}{4pt}

vspace{4pt}
With verb|rule[-4ex]{40pt}{1em}| rule[-4ex]{40pt}{1em}

vspace{4pt}
With verb|dhorline[-4ex]{40pt}{1em}| dhorline[-4ex]{40pt}{1em}

With verb|rule{4pt}{10em}| rule{4pt}{10em}
with verb|dvertline{4pt}{10em}|
dvertline{4pt}{10em}

vspace{4pt}
With verb|rule[3ex]{4pt}{10em}| rule[3ex]{4pt}{10em}
with verb|dvertline[3ex]{4pt}{10em}|
dvertline[3ex]{4pt}{10em}
end{document}


enter image description here



Inspiration from this answer.





share























    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%2f447326%2fwhats-the-dotted-line-equivalent-of-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









    0














    hdashrule is only an approximation because the dots are little squares, but you can easily do what you need with TikZ.



    I have created two commands, dhorline (for horizontal rules) and dvertline (for vertical ones), with the same syntax as rule, where the dots are actual dots.



    Here some examples:



    documentclass{article}
    usepackage{dashrule}
    usepackage{tikz}
    usetikzlibrary{decorations.markings}
    newcommand{dhorline}[3][0]{%
    tikz[baseline]{path[decoration={markings,
    mark=between positions 0 and 1 step 2*#3
    with {node[fill, circle, minimum width=#3, inner sep=0pt, anchor=south west] {};}},postaction={decorate}] (0,#1) -- ++(#2,0);}}
    newcommand{dvertline}[3][0]{%
    tikz[baseline]{path[decoration={markings,
    mark=between positions 0 and 1 step 2*#2
    with {node[fill, circle, minimum width=#2, inner sep=0pt, anchor=south west] {};}},postaction={decorate}] (0, #1) -- ++(0,#3);}}
    begin{document}
    With verb|rule{10em}{4pt}| rule{10em}{4pt}

    With verb|hdashrule{10em}{4pt}{4pt}|
    hdashrule{10em}{4pt}{4pt}

    With verb|dhorline{10em}{4pt}| dhorline{10em}{4pt}

    vspace{4pt}
    With verb|rule[-4ex]{40pt}{1em}| rule[-4ex]{40pt}{1em}

    vspace{4pt}
    With verb|dhorline[-4ex]{40pt}{1em}| dhorline[-4ex]{40pt}{1em}

    With verb|rule{4pt}{10em}| rule{4pt}{10em}
    with verb|dvertline{4pt}{10em}|
    dvertline{4pt}{10em}

    vspace{4pt}
    With verb|rule[3ex]{4pt}{10em}| rule[3ex]{4pt}{10em}
    with verb|dvertline[3ex]{4pt}{10em}|
    dvertline[3ex]{4pt}{10em}
    end{document}


    enter image description here



    Inspiration from this answer.





    share




























      0














      hdashrule is only an approximation because the dots are little squares, but you can easily do what you need with TikZ.



      I have created two commands, dhorline (for horizontal rules) and dvertline (for vertical ones), with the same syntax as rule, where the dots are actual dots.



      Here some examples:



      documentclass{article}
      usepackage{dashrule}
      usepackage{tikz}
      usetikzlibrary{decorations.markings}
      newcommand{dhorline}[3][0]{%
      tikz[baseline]{path[decoration={markings,
      mark=between positions 0 and 1 step 2*#3
      with {node[fill, circle, minimum width=#3, inner sep=0pt, anchor=south west] {};}},postaction={decorate}] (0,#1) -- ++(#2,0);}}
      newcommand{dvertline}[3][0]{%
      tikz[baseline]{path[decoration={markings,
      mark=between positions 0 and 1 step 2*#2
      with {node[fill, circle, minimum width=#2, inner sep=0pt, anchor=south west] {};}},postaction={decorate}] (0, #1) -- ++(0,#3);}}
      begin{document}
      With verb|rule{10em}{4pt}| rule{10em}{4pt}

      With verb|hdashrule{10em}{4pt}{4pt}|
      hdashrule{10em}{4pt}{4pt}

      With verb|dhorline{10em}{4pt}| dhorline{10em}{4pt}

      vspace{4pt}
      With verb|rule[-4ex]{40pt}{1em}| rule[-4ex]{40pt}{1em}

      vspace{4pt}
      With verb|dhorline[-4ex]{40pt}{1em}| dhorline[-4ex]{40pt}{1em}

      With verb|rule{4pt}{10em}| rule{4pt}{10em}
      with verb|dvertline{4pt}{10em}|
      dvertline{4pt}{10em}

      vspace{4pt}
      With verb|rule[3ex]{4pt}{10em}| rule[3ex]{4pt}{10em}
      with verb|dvertline[3ex]{4pt}{10em}|
      dvertline[3ex]{4pt}{10em}
      end{document}


      enter image description here



      Inspiration from this answer.





      share


























        0












        0








        0







        hdashrule is only an approximation because the dots are little squares, but you can easily do what you need with TikZ.



        I have created two commands, dhorline (for horizontal rules) and dvertline (for vertical ones), with the same syntax as rule, where the dots are actual dots.



        Here some examples:



        documentclass{article}
        usepackage{dashrule}
        usepackage{tikz}
        usetikzlibrary{decorations.markings}
        newcommand{dhorline}[3][0]{%
        tikz[baseline]{path[decoration={markings,
        mark=between positions 0 and 1 step 2*#3
        with {node[fill, circle, minimum width=#3, inner sep=0pt, anchor=south west] {};}},postaction={decorate}] (0,#1) -- ++(#2,0);}}
        newcommand{dvertline}[3][0]{%
        tikz[baseline]{path[decoration={markings,
        mark=between positions 0 and 1 step 2*#2
        with {node[fill, circle, minimum width=#2, inner sep=0pt, anchor=south west] {};}},postaction={decorate}] (0, #1) -- ++(0,#3);}}
        begin{document}
        With verb|rule{10em}{4pt}| rule{10em}{4pt}

        With verb|hdashrule{10em}{4pt}{4pt}|
        hdashrule{10em}{4pt}{4pt}

        With verb|dhorline{10em}{4pt}| dhorline{10em}{4pt}

        vspace{4pt}
        With verb|rule[-4ex]{40pt}{1em}| rule[-4ex]{40pt}{1em}

        vspace{4pt}
        With verb|dhorline[-4ex]{40pt}{1em}| dhorline[-4ex]{40pt}{1em}

        With verb|rule{4pt}{10em}| rule{4pt}{10em}
        with verb|dvertline{4pt}{10em}|
        dvertline{4pt}{10em}

        vspace{4pt}
        With verb|rule[3ex]{4pt}{10em}| rule[3ex]{4pt}{10em}
        with verb|dvertline[3ex]{4pt}{10em}|
        dvertline[3ex]{4pt}{10em}
        end{document}


        enter image description here



        Inspiration from this answer.





        share













        hdashrule is only an approximation because the dots are little squares, but you can easily do what you need with TikZ.



        I have created two commands, dhorline (for horizontal rules) and dvertline (for vertical ones), with the same syntax as rule, where the dots are actual dots.



        Here some examples:



        documentclass{article}
        usepackage{dashrule}
        usepackage{tikz}
        usetikzlibrary{decorations.markings}
        newcommand{dhorline}[3][0]{%
        tikz[baseline]{path[decoration={markings,
        mark=between positions 0 and 1 step 2*#3
        with {node[fill, circle, minimum width=#3, inner sep=0pt, anchor=south west] {};}},postaction={decorate}] (0,#1) -- ++(#2,0);}}
        newcommand{dvertline}[3][0]{%
        tikz[baseline]{path[decoration={markings,
        mark=between positions 0 and 1 step 2*#2
        with {node[fill, circle, minimum width=#2, inner sep=0pt, anchor=south west] {};}},postaction={decorate}] (0, #1) -- ++(0,#3);}}
        begin{document}
        With verb|rule{10em}{4pt}| rule{10em}{4pt}

        With verb|hdashrule{10em}{4pt}{4pt}|
        hdashrule{10em}{4pt}{4pt}

        With verb|dhorline{10em}{4pt}| dhorline{10em}{4pt}

        vspace{4pt}
        With verb|rule[-4ex]{40pt}{1em}| rule[-4ex]{40pt}{1em}

        vspace{4pt}
        With verb|dhorline[-4ex]{40pt}{1em}| dhorline[-4ex]{40pt}{1em}

        With verb|rule{4pt}{10em}| rule{4pt}{10em}
        with verb|dvertline{4pt}{10em}|
        dvertline{4pt}{10em}

        vspace{4pt}
        With verb|rule[3ex]{4pt}{10em}| rule[3ex]{4pt}{10em}
        with verb|dvertline[3ex]{4pt}{10em}|
        dvertline[3ex]{4pt}{10em}
        end{document}


        enter image description here



        Inspiration from this answer.






        share











        share


        share










        answered 9 mins ago









        CarLaTeXCarLaTeX

        31.3k449130




        31.3k449130






























            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%2f447326%2fwhats-the-dotted-line-equivalent-of-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

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

            Calculate evaluation metrics using cross_val_predict sklearn

            Insert data from modal to MySQL (multiple modal on website)