Skip to content

Instantly share code, notes, and snippets.

@kargaranamir
Last active August 22, 2021 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kargaranamir/c5fe3cee11bab4d5a59ed29ab2a6d133 to your computer and use it in GitHub Desktop.
Save kargaranamir/c5fe3cee11bab4d5a59ed29ab2a6d133 to your computer and use it in GitHub Desktop.
Create Custom Command Latex

Here is a simple custom command for adding underline to href package. Also there are another ways to do this but it's a good example to show how we can create a custom command!

\newcommand{\myhref}[2]{%
    \href{#1}{\underline{#2}}%
}

Then you can call the custom command in your tex file:

\myhref{http://en.wikipedia.org/wiki/}{Wiki}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment