Variables (in some cases) not working inside `href`href not working with image (but OK with text)href not...

Where is the License file location for Identity Server in Sitecore 9.1?

How does a sound wave propagate?

Short story about cities being connected by a conveyor belt

How can I have x-axis ticks that show ticks scaled in powers of ten?

An Undercover Army

Help! My Character is too much for her story!

Did Amazon pay $0 in taxes last year?

Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?

Should I apply for my boss's promotion?

Create chunks from an array

Who has more? Ireland or Iceland?

Having the player face themselves after the mid-game

What exactly is the meaning of "fine wine"?

How do you make a gun that shoots melee weapons and/or swords?

Interpretation of linear regression interaction term plot

Is there a logarithm base for which the logarithm becomes an identity function?

Paper published similar to PhD thesis

Giving a talk in my old university, how prominently should I tell students my salary?

How does learning spells work when leveling a multiclass character?

Why does a car's steering wheel get lighter with increasing speed

Why aren't there more Gauls like Obelix?

Boss Telling direct supervisor I snitched

Inorganic chemistry handbook with reaction lists

If nine coins are tossed, what is the probability that the number of heads is even?



Variables (in some cases) not working inside `href`


href not working with image (but OK with text)href not working in beamer (not clickable)Defining some newcommand with href, Problems of ##textbf{} not working inside Breakurl burlaltUsing href inside footnoteUndefined reference (in some cases)input inside hrefhref not ignoring special characters inside macrohref not working on texlipseMacro expansion inside href













0















Given this small document class file mycustomloc.cls:



NeedsTeXFormat{LaTeX2e}
ProvidesClass{mycustomloc}[2019/03/06 My custom class]
LoadClass{article}
RequirePackage{hyperxmp}
RequirePackage[unicode]{hyperref}
RequirePackage{xstring}
RequirePackage{setspace}

newcommand{phone}[1]{def@phone{#1}}

newcommand{address}[4]{
def@neighborhood{#1}
def@city{#2}
def@state{#3}
def@country{#4}
}

def@urlparams{StrSubstitute{@neighborhood+@city+@state+@country}{ }{+}}
def@phoneparams{StrSubstitute{@phone}{ }{}}


newcommand{makecontact}{%
Phone: href{tel://@phone}{@phone}

vspace{baselineskip}
Why I can't add the variable urlparams in the texttt{href} below if I
can insert variables in the phone above (as you can see).

vspace{baselineskip}
The content of `urlparams` is given below:

texttt{@urlparams}.

If add the ``string'' manually to texttt{href} it works:

Loc.: href{https://www.google.com/maps?q=Spring+Falls+Helena-West+Helena+AR+United+States+of+America}{@city, @state ,-- @country}

But adding the variable do not

Loc.: href{https://www.google.com/maps?q=@urlparams}{@city, @state ,-- @country}
}

endinput


And this simple minimal working example mwe.tex



documentclass{mycustomloc}

address{Spring Falls}{Helena-West Helena}{AR}{United States of America}
phone{+1 123 555-1234}

begin{document}
makecontact
end{document}


I'm not able to compile it if I use @urlparams inside the href (last one, is commented), but "manually" writting the string contents to the first parameter of href works.



Why this behavior is ocurring and how to fix, since I want to be able to use the @urlparams inside the href command.









share



























    0















    Given this small document class file mycustomloc.cls:



    NeedsTeXFormat{LaTeX2e}
    ProvidesClass{mycustomloc}[2019/03/06 My custom class]
    LoadClass{article}
    RequirePackage{hyperxmp}
    RequirePackage[unicode]{hyperref}
    RequirePackage{xstring}
    RequirePackage{setspace}

    newcommand{phone}[1]{def@phone{#1}}

    newcommand{address}[4]{
    def@neighborhood{#1}
    def@city{#2}
    def@state{#3}
    def@country{#4}
    }

    def@urlparams{StrSubstitute{@neighborhood+@city+@state+@country}{ }{+}}
    def@phoneparams{StrSubstitute{@phone}{ }{}}


    newcommand{makecontact}{%
    Phone: href{tel://@phone}{@phone}

    vspace{baselineskip}
    Why I can't add the variable urlparams in the texttt{href} below if I
    can insert variables in the phone above (as you can see).

    vspace{baselineskip}
    The content of `urlparams` is given below:

    texttt{@urlparams}.

    If add the ``string'' manually to texttt{href} it works:

    Loc.: href{https://www.google.com/maps?q=Spring+Falls+Helena-West+Helena+AR+United+States+of+America}{@city, @state ,-- @country}

    But adding the variable do not

    Loc.: href{https://www.google.com/maps?q=@urlparams}{@city, @state ,-- @country}
    }

    endinput


    And this simple minimal working example mwe.tex



    documentclass{mycustomloc}

    address{Spring Falls}{Helena-West Helena}{AR}{United States of America}
    phone{+1 123 555-1234}

    begin{document}
    makecontact
    end{document}


    I'm not able to compile it if I use @urlparams inside the href (last one, is commented), but "manually" writting the string contents to the first parameter of href works.



    Why this behavior is ocurring and how to fix, since I want to be able to use the @urlparams inside the href command.









    share

























      0












      0








      0








      Given this small document class file mycustomloc.cls:



      NeedsTeXFormat{LaTeX2e}
      ProvidesClass{mycustomloc}[2019/03/06 My custom class]
      LoadClass{article}
      RequirePackage{hyperxmp}
      RequirePackage[unicode]{hyperref}
      RequirePackage{xstring}
      RequirePackage{setspace}

      newcommand{phone}[1]{def@phone{#1}}

      newcommand{address}[4]{
      def@neighborhood{#1}
      def@city{#2}
      def@state{#3}
      def@country{#4}
      }

      def@urlparams{StrSubstitute{@neighborhood+@city+@state+@country}{ }{+}}
      def@phoneparams{StrSubstitute{@phone}{ }{}}


      newcommand{makecontact}{%
      Phone: href{tel://@phone}{@phone}

      vspace{baselineskip}
      Why I can't add the variable urlparams in the texttt{href} below if I
      can insert variables in the phone above (as you can see).

      vspace{baselineskip}
      The content of `urlparams` is given below:

      texttt{@urlparams}.

      If add the ``string'' manually to texttt{href} it works:

      Loc.: href{https://www.google.com/maps?q=Spring+Falls+Helena-West+Helena+AR+United+States+of+America}{@city, @state ,-- @country}

      But adding the variable do not

      Loc.: href{https://www.google.com/maps?q=@urlparams}{@city, @state ,-- @country}
      }

      endinput


      And this simple minimal working example mwe.tex



      documentclass{mycustomloc}

      address{Spring Falls}{Helena-West Helena}{AR}{United States of America}
      phone{+1 123 555-1234}

      begin{document}
      makecontact
      end{document}


      I'm not able to compile it if I use @urlparams inside the href (last one, is commented), but "manually" writting the string contents to the first parameter of href works.



      Why this behavior is ocurring and how to fix, since I want to be able to use the @urlparams inside the href command.









      share














      Given this small document class file mycustomloc.cls:



      NeedsTeXFormat{LaTeX2e}
      ProvidesClass{mycustomloc}[2019/03/06 My custom class]
      LoadClass{article}
      RequirePackage{hyperxmp}
      RequirePackage[unicode]{hyperref}
      RequirePackage{xstring}
      RequirePackage{setspace}

      newcommand{phone}[1]{def@phone{#1}}

      newcommand{address}[4]{
      def@neighborhood{#1}
      def@city{#2}
      def@state{#3}
      def@country{#4}
      }

      def@urlparams{StrSubstitute{@neighborhood+@city+@state+@country}{ }{+}}
      def@phoneparams{StrSubstitute{@phone}{ }{}}


      newcommand{makecontact}{%
      Phone: href{tel://@phone}{@phone}

      vspace{baselineskip}
      Why I can't add the variable urlparams in the texttt{href} below if I
      can insert variables in the phone above (as you can see).

      vspace{baselineskip}
      The content of `urlparams` is given below:

      texttt{@urlparams}.

      If add the ``string'' manually to texttt{href} it works:

      Loc.: href{https://www.google.com/maps?q=Spring+Falls+Helena-West+Helena+AR+United+States+of+America}{@city, @state ,-- @country}

      But adding the variable do not

      Loc.: href{https://www.google.com/maps?q=@urlparams}{@city, @state ,-- @country}
      }

      endinput


      And this simple minimal working example mwe.tex



      documentclass{mycustomloc}

      address{Spring Falls}{Helena-West Helena}{AR}{United States of America}
      phone{+1 123 555-1234}

      begin{document}
      makecontact
      end{document}


      I'm not able to compile it if I use @urlparams inside the href (last one, is commented), but "manually" writting the string contents to the first parameter of href works.



      Why this behavior is ocurring and how to fix, since I want to be able to use the @urlparams inside the href command.







      hyperref variable





      share












      share










      share



      share










      asked 4 mins ago









      LinLin

      3167




      3167






















          0






          active

          oldest

          votes











          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%2f478526%2fvariables-in-some-cases-not-working-inside-href%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f478526%2fvariables-in-some-cases-not-working-inside-href%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

          Can't compile dgruyter and caption packagesLaTeX templates/packages for writing a patent specificationLatex...

          Schneeberg (Smreczany) Bibliografia | Menu...

          Hans Bellmer Spis treści Życiorys | Upamiętnienie | Przypisy | Bibliografia | Linki zewnętrzne |...