简体   繁体   中英

newcommand latex arguments

just a quick question, I could not find an answer to on Google.

I need to introduce a secondary citation method for my LaTeX project. And I cannot get it to work.

\newcommand{\sekcite[4]}{
    {
        (\cite[#1]{#2} qtd. in \cite[#4]{#3})
    }
}

I have in my text the following lines for testing purposes:

\par \textcite[1]{Su2016}
\par \parencite[2]{Spar2014}
\par \sekcite{Su2016}{1}{Spar2014}{2}

The desired outcome should look like this:

CH Su, Fan, and PY Su (2016, p. 1)

(Sparwelt.de 2014, p. 2)

(CH Su, Fan, and PY Su 2016, p. 1 qtd. in Sparwelt.de 2014, p. 2)

The problem is, that I get:

CH Su, Fan, and PY Su (2016, p. 1)

(Sparwelt.de 2014, p. 2)

(CH Su, Fan, and PY Su 2016, p. 0 qtd. in 1 ) 2

As I read here: http://www.golatex.de/wiki/%5Cnewcommand

I can create a new command with

\newcommand{\NAME}[COUNT]{CODE}

What am I doing wrong?

EDIT: What I should have added: I get following warning:

The following entry could not be found(biblatex) in the database:(biblatex) 1(biblatex) Please verify the spelling and rerun(biblatex) LaTeX afterwards.

And I am using Texmaker 4.5 on MiKTeX in the current stable version on Windows 7

Try with

\newcommand{\sekcite}[4]{%
  (\cite[#2]{#1} qtd.\ in \cite[#4]{#3})%
}

Note the use of % . Additionally, the use of \\ after the . ensures you don't have a sentence-ending period space.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM