I cannot use qcircuit package in Springer Nature journal template, the latex template for Springer journal papers. It makes an error when I use that package in that template. Could anybody please help me?
-
Please include a minimal working example (MWE) that demonstrates your issue. And please share the actual error message that you're getting.– deddedCommented Nov 22, 2022 at 14:30
-
if asking about an error show the full error message from the log– David CarlisleCommented Nov 22, 2022 at 14:31
-
1Use standalone and \includegraphics.– John KormyloCommented Nov 22, 2022 at 19:12
-
Thank you for your feedback!! If the answer meets your requirement, please accept it by checking the green tickmark on left side of the answer.– Simon DispaCommented Dec 22, 2022 at 21:29
Add a comment
|
1 Answer
The sn-jnl
class loads the package program
. From CTAN:
its main offering is a program environment; a programbox environment is available for fragments that must not break with the pages.
Unfortunately, it defines a command \push
that conflicts with the qcircuit
package. If you don't need such "programbox environment", you can avoid loading the package program
.
Using the solution from disable loading the package program
% !TeX TS-program = pdflatex
\makeatletter% added <<<<<<<<<<<<<<<<
\disable@package@load{program}{}
\makeatother
\documentclass[pdflatex,sn-mathphys]{sn-jnl}
\usepackage{braket}
\usepackage{qcircuit}
\begin{document}
\centerline{%
\Qcircuit @C=1em @!R {
\lstick{\ket{x}} & \qw & \ctrl{1} & \qw & \rstick{\ket{x}} \qw \\
\lstick{\ket{y}} & \qw & \ctrl{1} & \qw & \rstick{\ket{y}} \qw \\
\lstick{\ket{z}} & \qw & \targ & \qw & \rstick{\ket{x \oplus (y \wedge z})} \qw
}
}
\end{document}
-
Thank you very much. I worked for me and the problem solved! Commented Nov 29, 2022 at 5:53