## LaTeX forum ⇒ General ⇒ Change standard arguments of \newcommand

LaTeX specific issues not fitting into one of the other forums of this category.
Thomas_l
Posts: 6
Joined: Fri Apr 19, 2013 3:13 pm

### Change standard arguments of \newcommand

Hi All

I am working on a presentation and have to use a load of references. These references looks like this:
par. 4.4.1 blz 4.30 - 4.31
So i defined my one command t do this automaticaly to get this result:
\verw{4.2.2}{4.6}{4.7} => par. 4.2.2 blz. 4.6 - 4.7
Whenever i use this function i get the standard form:
\verw{arg1}{arg2}{arg3}
Is there a way to change this form to:
\verw{section}{startpage}{endpage}
This would make it a load easyer for me to remember what i have to put where in the command.

Regards

Thoams
Last edited by cgnieder on Fri Apr 19, 2013 5:14 pm, edited 1 time in total.

Tags:

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
Hi Thomas,

Welcome to the LaTeX community!

It is of course possible to program a command with a different syntax. The question is: which syntax would you like?

Edit: I realized I misread your question... and I must admit I am not 100% sure I got what you want. Could you please post a minimal working example?

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

sommerfee
Posts: 498
Joined: Mon Apr 09, 2007 4:20 pm
Thomas_l wrote:Whenever i use this function i get the standard form:
\verw{arg1}{arg2}{arg3}
Is there a way to change this form to:
\verw{section}{startpage}{endpage}

To me this seems to be a problem with your editor, not with LaTeX itself.

So what editor do you use?

Thomas_l
Posts: 6
Joined: Fri Apr 19, 2013 3:13 pm
I atached a file which I hope brings a litle more clearity.
Knipsel.PNG (8.01 KiB) Viewed 3181 times

I used this source code (hope this is what you mean whit a minimal example)

\documentclass{article} \newcommand{\ref}[3]{par. #1 page: #2 - #3} \begin{document}\ref{arg1}{arg2}{arg3}\ref{section}{starting page}{ending page}\end{document}

To me this seems to be a problem with your editor, not with LaTeX itself.

So what editor do you use?

I use the Texstudio editor
Last edited by cgnieder on Sat Apr 20, 2013 10:13 am, edited 1 time in total.
Reason: changed code markup from inline to block

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
Ok, so I did misunderstand your question and Axel was right. Unfortunately I don't have much experience with TeXstudio but I'll take a look when I'm home.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

Thomas_l
Posts: 6
Joined: Fri Apr 19, 2013 3:13 pm
cgnieder wrote:Ok, so I did misunderstand your question and Axel was right. Unfortunately I don't have much experience with TeXstudio but I'll take a look when I'm home.

Regards

So if I use another editor this would be possible?

Thanks in advance for looking into it.

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
Thomas_l wrote:So if I use another editor this would be possible?

I know for sure it is possible with Kile which isn't easy to install on Windows IIRC, though. I would think it should be doable with TeXstudio, too, but I have to wait until I am home where I have a Windows desktop so I can test it.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim