Cross-referencing numeric values and text from later section to executive summary of a latex document












5














I have almost completed drafting a report on consumption of different food items, and I am drafting an executive summary so that readers can quickly know what the report is about. Since there are quite a lot of tables and ranking and number generated from the dataset, I need to cross-reference quite a number of them in the executive summary, which I don't prefer "hard-code" these figures into the executive summary by means of copy and paste.



Having explored that use of macro maybe my way out, but it has a limitation that text to be quoted needs to present before where it needs to be quoted, which is not applicable to my case as the executive summary needs to present before the main text



Can anyone enlighten me on how to cross-reference the text or numbers from a later section in latex without manually copy and paste?



Thanks!










share|improve this question
























  • Welcome to TeX.SX! Please provide a minimal working example showing what you've tried so far.
    – JouleV
    Dec 17 at 11:16










  • How are the numbers and text you want to quote generated? Are they hard coded, or are they being produced by a tool. If they are hardcoded, and not too numerous, the simplest thing would be to define macros for them in the preamble, and then use those macros both in the executive summary and the later section.
    – Paul Stanley
    Dec 17 at 11:22










  • Paul, I am using R markdown that R script is integrated into the R markdown file for generating the figures, they are fairly lot script that moving them to preamble needs quite a lot of effort
    – lokheart
    Dec 17 at 11:27
















5














I have almost completed drafting a report on consumption of different food items, and I am drafting an executive summary so that readers can quickly know what the report is about. Since there are quite a lot of tables and ranking and number generated from the dataset, I need to cross-reference quite a number of them in the executive summary, which I don't prefer "hard-code" these figures into the executive summary by means of copy and paste.



Having explored that use of macro maybe my way out, but it has a limitation that text to be quoted needs to present before where it needs to be quoted, which is not applicable to my case as the executive summary needs to present before the main text



Can anyone enlighten me on how to cross-reference the text or numbers from a later section in latex without manually copy and paste?



Thanks!










share|improve this question
























  • Welcome to TeX.SX! Please provide a minimal working example showing what you've tried so far.
    – JouleV
    Dec 17 at 11:16










  • How are the numbers and text you want to quote generated? Are they hard coded, or are they being produced by a tool. If they are hardcoded, and not too numerous, the simplest thing would be to define macros for them in the preamble, and then use those macros both in the executive summary and the later section.
    – Paul Stanley
    Dec 17 at 11:22










  • Paul, I am using R markdown that R script is integrated into the R markdown file for generating the figures, they are fairly lot script that moving them to preamble needs quite a lot of effort
    – lokheart
    Dec 17 at 11:27














5












5








5







I have almost completed drafting a report on consumption of different food items, and I am drafting an executive summary so that readers can quickly know what the report is about. Since there are quite a lot of tables and ranking and number generated from the dataset, I need to cross-reference quite a number of them in the executive summary, which I don't prefer "hard-code" these figures into the executive summary by means of copy and paste.



Having explored that use of macro maybe my way out, but it has a limitation that text to be quoted needs to present before where it needs to be quoted, which is not applicable to my case as the executive summary needs to present before the main text



Can anyone enlighten me on how to cross-reference the text or numbers from a later section in latex without manually copy and paste?



Thanks!










share|improve this question















I have almost completed drafting a report on consumption of different food items, and I am drafting an executive summary so that readers can quickly know what the report is about. Since there are quite a lot of tables and ranking and number generated from the dataset, I need to cross-reference quite a number of them in the executive summary, which I don't prefer "hard-code" these figures into the executive summary by means of copy and paste.



Having explored that use of macro maybe my way out, but it has a limitation that text to be quoted needs to present before where it needs to be quoted, which is not applicable to my case as the executive summary needs to present before the main text



Can anyone enlighten me on how to cross-reference the text or numbers from a later section in latex without manually copy and paste?



Thanks!







cross-referencing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 17 at 11:30









Mico

273k30369756




273k30369756










asked Dec 17 at 11:14









lokheart

1283




1283












  • Welcome to TeX.SX! Please provide a minimal working example showing what you've tried so far.
    – JouleV
    Dec 17 at 11:16










  • How are the numbers and text you want to quote generated? Are they hard coded, or are they being produced by a tool. If they are hardcoded, and not too numerous, the simplest thing would be to define macros for them in the preamble, and then use those macros both in the executive summary and the later section.
    – Paul Stanley
    Dec 17 at 11:22










  • Paul, I am using R markdown that R script is integrated into the R markdown file for generating the figures, they are fairly lot script that moving them to preamble needs quite a lot of effort
    – lokheart
    Dec 17 at 11:27


















  • Welcome to TeX.SX! Please provide a minimal working example showing what you've tried so far.
    – JouleV
    Dec 17 at 11:16










  • How are the numbers and text you want to quote generated? Are they hard coded, or are they being produced by a tool. If they are hardcoded, and not too numerous, the simplest thing would be to define macros for them in the preamble, and then use those macros both in the executive summary and the later section.
    – Paul Stanley
    Dec 17 at 11:22










  • Paul, I am using R markdown that R script is integrated into the R markdown file for generating the figures, they are fairly lot script that moving them to preamble needs quite a lot of effort
    – lokheart
    Dec 17 at 11:27
















Welcome to TeX.SX! Please provide a minimal working example showing what you've tried so far.
– JouleV
Dec 17 at 11:16




Welcome to TeX.SX! Please provide a minimal working example showing what you've tried so far.
– JouleV
Dec 17 at 11:16












How are the numbers and text you want to quote generated? Are they hard coded, or are they being produced by a tool. If they are hardcoded, and not too numerous, the simplest thing would be to define macros for them in the preamble, and then use those macros both in the executive summary and the later section.
– Paul Stanley
Dec 17 at 11:22




How are the numbers and text you want to quote generated? Are they hard coded, or are they being produced by a tool. If they are hardcoded, and not too numerous, the simplest thing would be to define macros for them in the preamble, and then use those macros both in the executive summary and the later section.
– Paul Stanley
Dec 17 at 11:22












Paul, I am using R markdown that R script is integrated into the R markdown file for generating the figures, they are fairly lot script that moving them to preamble needs quite a lot of effort
– lokheart
Dec 17 at 11:27




Paul, I am using R markdown that R script is integrated into the R markdown file for generating the figures, they are fairly lot script that moving them to preamble needs quite a lot of effort
– lokheart
Dec 17 at 11:27










1 Answer
1






active

oldest

votes


















7














You can e.g. use a label/ref:



documentclass[11pt]{article}
makeatletter
newcommandstore[2]{#1{def@currentlabel{#1}label{#2}}}

begin{document}

section{Use}
ref{text}, ref{number}


section{Store}
here ist the text store{some text}{text}
store{123456}{number}

end{document}


enter image description here






share|improve this answer





















    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%2f466189%2fcross-referencing-numeric-values-and-text-from-later-section-to-executive-summar%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









    7














    You can e.g. use a label/ref:



    documentclass[11pt]{article}
    makeatletter
    newcommandstore[2]{#1{def@currentlabel{#1}label{#2}}}

    begin{document}

    section{Use}
    ref{text}, ref{number}


    section{Store}
    here ist the text store{some text}{text}
    store{123456}{number}

    end{document}


    enter image description here






    share|improve this answer


























      7














      You can e.g. use a label/ref:



      documentclass[11pt]{article}
      makeatletter
      newcommandstore[2]{#1{def@currentlabel{#1}label{#2}}}

      begin{document}

      section{Use}
      ref{text}, ref{number}


      section{Store}
      here ist the text store{some text}{text}
      store{123456}{number}

      end{document}


      enter image description here






      share|improve this answer
























        7












        7








        7






        You can e.g. use a label/ref:



        documentclass[11pt]{article}
        makeatletter
        newcommandstore[2]{#1{def@currentlabel{#1}label{#2}}}

        begin{document}

        section{Use}
        ref{text}, ref{number}


        section{Store}
        here ist the text store{some text}{text}
        store{123456}{number}

        end{document}


        enter image description here






        share|improve this answer












        You can e.g. use a label/ref:



        documentclass[11pt]{article}
        makeatletter
        newcommandstore[2]{#1{def@currentlabel{#1}label{#2}}}

        begin{document}

        section{Use}
        ref{text}, ref{number}


        section{Store}
        here ist the text store{some text}{text}
        store{123456}{number}

        end{document}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 17 at 11:29









        Ulrike Fischer

        186k7290669




        186k7290669






























            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%2f466189%2fcross-referencing-numeric-values-and-text-from-later-section-to-executive-summar%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

            Morgemoulin

            Scott Moir

            Souastre