Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Being quite an amateur to LaTeX, I am sorry, I don't know how to ask my question without telling the whole story:

In a large document, I made a rather simple command for citing (Classical Latin) authors following other conventions than I use for citing modern authors (where I use BibTeX, etc.). This is the command I use:

\newcommand{\citeCL}[3]{#1, \emph{#2}, \textbf{#3}}
%\citeCL{author}{text}{chapter}

As the first two arguments I use yet other commands from a list of author names and text titles (as I use every name several times and may be inconsistent if writing it in full every time), e.g.,

\newcommand{\Per}{N. Per.}
\newcommand{\PerRud}{Rud. gram.}

Within the document, I could call the cite command thus:

\citeCL{\Per}{\PerRud}{1117}

This cite command I use both in footnotes and in this quotation environment:

\newcommand{\QuoteCL}[4]{
\vspace{5pt}
\begin{quote}\itemsep1pt\parskip0pt\parsep0pt\begin{spacing}{1}
#4 \par\hspace*{\fill}\footnotesize{\citeCL{#1}{#2}{#3}}
\end{spacing}
\end{quote}
\vspace{-20pt}
}

In the document I call the command with the same three arguments as for the \citeCL, and additionally the text to quote, e.g.,

\QuoteCL{\Per}{\PerRud}{§ 1119}{Quis maxime proponendus est quem studeant adolescentes imitari? Marcus Cicero.}

All this works fine, and I have used it throughout my thesis. Now I wish to differ between the ways the author names and titles are written in footnotes and in quotations, using the abbreviated form in footnotes and a new, long form in quotations. My intuitive, naive approach was this:

\newcommand{\citeCL}[3]{#1, \emph{#2}, \textbf{#3}}
% Original command now used for footnotes

\newcommand{\citeCLLong}[3]{#1Long, \emph{#2Long}, \textbf{#3}}
% New command to be called by the \quoteCL command.

\newcommand{\Per}{N. Per.}
\newcommand{\PerLong}{Niccolò Perotti}
\newcommand{\PerRud}{Rud. gram.}
\newcommand{\PerRudLong}{Rudimenta grammatices}
% Duplicating the list of names and titles, adding a long version to be called by the \citeCLLong:

\newcommand{\QuoteCL}[4]{
\vspace{5pt}
\begin{quote}\itemsep1pt\parskip0pt\parsep0pt\begin{spacing}{1}
#4 \par\hspace*{\fill}\footnotesize{\citeCLLong{#1}{#2}{#3}}
\end{spacing}
\end{quote}
\vspace{-20pt}
}
% The command is changed to call the new \citeCLLong

\begin{document}
\QuoteCL{\Per}{\PerRud}{§ 1119}{Quis maxime proponendus est quem studeant adolescentes imitari? Marcus Cicero.}
\end{document}

Now to my question: I was hoping that adding Long to the arguments in \citeCLLong (#1Long, \emph{#2Long}) would make LaTeX choose, e.g., \PerLong instead of merely \Per from my author list, even though I call the \quoteCL command with the argument \Per. That the Long part would be added before it is decided whether to read \Per or \PerLong. But it writes, e.g., "N. Per.Long" instead of choosing \PerLong = "Niccolò Perotti".

Can this be done somehow, or is there any other, smarter solution, that does not need me to go through my entire thesis changing all arguments in all quotations, but make it possible to control from the preample? And that lets my citations in footnotes stay the same, original form?

share|improve this question
    
Welcome to TeX.SX. –  Claudio Fiandrino Apr 3 '13 at 10:24
2  
At the risk of emulating the MS Word PaperClip, I'd say "It looks like you're writing a bibliography. Do you need help?" Although it's a bit daunting at first sight, I believe BibLaTeX will do what you want, thus saving you the effort of rolling-your-own. –  Brent.Longborough Apr 3 '13 at 10:34
3  
Next time you need to cite classical works, you may want to take a look at the classics package, too. –  eduardo.tex Apr 3 '13 at 10:53

2 Answers 2

up vote 5 down vote accepted

Use a conditional; with a new command you can define in a coherent way commands with "short" and "long" forms. Then \citeCL and \citeCLLong can use

\documentclass{article}
\usepackage[utf8]{inputenc}

\newif\ifCLLong

\newcommand{\citeCL}[3]{\CLLongfalse #1, \emph{#2}, \textbf{#3}}

\newcommand{\citeCLLong}[3]{\CLLongtrue #1, \emph{#2}, \textbf{#3}}

\newcommand{\QuoteCL}[4]{%
\begin{quote}
#4 \par\hspace*{\fill}\footnotesize\citeCLLong{#1}{#2}{#3}
\end{quote}
}

% Abstraction for easing the definition    
\newcommand{\newshortlongcommand}[3]{\newcommand{#1}{\ifCLLong #3\else #2\fi}}

\newshortlongcommand{\Per}{N. Per.}{Niccolò Perotti}
\newshortlongcommand{\PerRud}{Rud. gram.}{Rudimenta grammatices}

\begin{document}

Testo introduttivo\footnote{\citeCL{\Per}{\PerRud}{§ 1119}}

\QuoteCL{\Per}{\PerRud}{§ 1119}{Quis maxime proponendus est quem studeant adolescentes imitari? Marcus Cicero.}
\end{document}

\end{document}

(I've simplified the definition of \QuoteCL, to get away with spacing and inessential things.)

In this way you can also input arguments directly without any worry; for instance

\QuoteCL{Niccolò Perotti}{Rudimenta Grammatices}{§ 1119}{...}

would work the same.

enter image description here

share|improve this answer

Change your first two arguments to just text strings, and use the \csname \endcsname construct to accomplish what you desire. (note: I turned off spacing environment, cause I didn't know what package had it)

\documentclass{article}
\usepackage[utf8]{inputenc}

\newcommand{\citeCL}[3]{\csname#1\endcsname, \emph{\csname#2\endcsname}, \textbf{#3}}
% Original command now used for footnotes

\newcommand{\citeCLLong}[3]{\csname#1Long\endcsname,
\emph{\csname#2Long\endcsname}, \textbf{#3}}
% New command to be called by the \quoteCL command.

\newcommand{\Per}{N. Per.}
\newcommand{\PerLong}{Niccolò Perotti}
\newcommand{\PerRud}{Rud. gram.}
\newcommand{\PerRudLong}{Rudimenta grammatices}
% Duplicating the list of names and titles, adding a long version to be called by the \citeCLLong:

\newcommand{\QuoteCL}[4]{
\vspace{5pt}
\begin{quote}\itemsep1pt\parskip0pt\parsep0pt%
%\begin{spacing}{1}%
#4 \par\hspace*{\fill}\footnotesize{\citeCLLong{#1}{#2}{#3}}
%\end{spacing}
\end{quote}
\vspace{-20pt}
}
% The command is changed to call the new \citeCLLong

\begin{document}
\QuoteCL{Per}{PerRud}{§ 1119}{Quis maxime proponendus est quem studeant adolescentes imitari? Marcus Cicero.}

\vspace{6em}
\citeCL{Per}{PerRud}{§ 1119}
\end{document}

enter image description here

share|improve this answer
    
@Mico The source had not been saved in UTF-8, and so I had to resave the source with different encoding. THen both LaTeX and pdfLaTeX both worked fine. –  Steven B. Segletes Apr 3 '13 at 16:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.