템플릿 생성

템플릿 생성

교수님께서 제가 편집한 템플릿을 주셨는데, 그 템플릿 때문에 오류가 많이 나더군요.

코드는 다음과 같습니다

\documentclass[12pt]{article}

\usepackage{rotating,graphics,psfrag,epsfig}

\usepackage{graphicx}
\usepackage{color}

\usepackage{latexsym}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[T1]{fontenc}

\usepackage{multicol}
\usepackage[dvipdfm]{hyperref}

\usepackage{fancyhdr}
\pagestyle{fancy}

\usepackage{lastpage}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{marvosym}
\newcommand{\ff}{Marzo del 2007}

\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{0.4pt}

%\usepackage[thickspace]{SIunits}

\usepackage[a]{esvect}
\usepackage{shortlst}

\usepackage{marvosym}
\usepackage[version=3]{mhchem}

\newcommand{\solucion}{\noindent\textbf{Soluci\'on}}
\newcommand{\comentario}{\noindent\textbf{Comentario}}
\newcommand{\nota}{\noindent\textbf{Nota}:}
\newcommand{\suge}{\noindent\textbf{Sugerencia}:}
\newcommand{\analisis}{\noindent\textbf{An\'alisis}}
\newcommand{\modelo}{\noindent\textbf{Modelo}}


\fancyhead[L]{} 
\fancyhead[C]{}
\fancyhead[R]{} 
%
\fancyfoot[L]{http://fisica.usach.cl/$\sim$cesparza/}
%\fancyfoot[C]{\ff} 
\fancyfoot[C]{} 
\fancyfoot[R]{TeoIngMat-EXA1s11.pdf -- 15 noviembre 2011}

\headwidth 18.0cm
\textwidth 18.0cm %18.0cm
\textheight 25.00cm % era25
\oddsidemargin -0.8cm
\evensidemargin -0.8cm
\topmargin -3.5000cm %era  -2.0cm
\columnsep 0.3cm
\parindent 0pt

\newcommand{\ia}{\'{\i}}
\newcommand{\xu}{\rm {\widehat{\bf{x}}}}
\newcommand{\yu}{\rm {\widehat{\bf{y}}}}
\newcommand{\zu}{\rm {\widehat{\bf{z}}}}

\newcommand{\iu}{\mathbf{\hat{\imath}}}
\newcommand{\ju}{\mathbf{\hat{\jmath}}}
\newcommand{\ku}{\mathbf{\hat{\kappa}}}
\newcommand{\kuw}{\mathbf{\widehat{\kappa}}}



\usepackage[dvipdfm]{hyperref}
\hypersetup{ 
pdfauthor = Carlos Esparza Barrera, 
pdftitle = TeoF1-IngMat-EXA1s11.pdf, 
pdfsubject = 2red, 
pdfkeywords [email protected], 
pdfcreator = {LaTeX con la paqueteria hyperref }, 
pdfproducer = {dvpdfm} 
}



\usepackage{type1cm} 
\usepackage{eso-pic}
\usepackage{color} 

\begin{document}

 \psfrag{xu}{$\widehat{\bf{x}}$}
 \psfrag{yu}{$\widehat{\bf{y}}$}
\psfrag{iu}{$\mathbf{\hat \imath}$}
 \psfrag{ju}{$\mathbf{\hat \jmath}$} 
 \psfrag{i}{$\hat \imath$}
 \psfrag{j}{$\hat \jmath$}

\textbf{Departamento de Fisica \hfill Universidad de Santiago de Chile} 

Teoria a Física I (22104)\hfill \textbf{EXAMEN} \hfill Ingeniería Matemática  \vspace{0.1cm}

\hline \hline \vspace{0.2cm}

Prof. Carlos H. Esparza-Barrera \hfill \begin{LARGE} \raisebox{-0.5ex}{\Email}                               
           \end{LARGE}  [email protected] \hfill \begin{LARGE}\Telefon \end{LARGE} ~(56-2-)7181239
\hfill Oficina 27 \\[0.1cm] 

\hline
\begin{itemize}

\item  \begin{large} \textbf{Esta prueba
consta de cuatro problemas, usted debe responder tres de ellos. La
elección es suya y debe indicarla en la hoja. Si responde los cuatro, se considerarán los tres
peor evaluados}\end{large}.  \hfill  Cada problema vale $2,0$ puntos. 

\item Fundamente su razonamiento; haga esquemas explicatorios. Use
l\'apiz  indeleble; en caso contrario, no puede pretender una segunda revisi\'on de su trabajo. Exprese sus
repuestas numéricas con 3 CS.


\item Las situaciones y los valores num\'ericos de los datos suministrados no necesariamente corresponden a
los de un experimento o situaci\'on pr\'actica real.  Se pretende que usted  trabaje cada problema  con
el modelo adecuado en el marco de la  teor\'ia  pertinente y obtenga las predicciones correspondientes. 

\end{itemize}
\hline

\begin{multicols}{2}
\begin{enumerate}


\item problema 1

\item ...

\item ...


\item ...


\item ...


\item ...
\end{enumerate}

Latex=>PS=>PDF로 컴파일할 때 다음 오류가 발생합니다.

잘못된 위치에 x4 정렬 및 비상 정지.

이 문제를 해결하는 방법을 모르겠습니다.

결과는 다음과 같아야 합니다.

여기에 이미지 설명을 입력하세요

마지막 수평선 이후에는 코드에서 볼 수 있듯이 문제를 편집하여 거기에 텍스트가 없습니다.

다른 스레드에서 내용을 망쳤기 때문에 다시 게시해야 했습니다. 도움에 감사드리며 미리 감사드립니다.

답변1

내가 보기에 LaTeX의 정신에 더 가까운 예가 있습니다. (다른 답변과 경쟁하기 위한 것이 아니라 LateX 접근 방식이 유익하다고 생각하는 사람들에게 이점을 보여주기 위한 것입니다.)

그러한 문서를 많이 생성해야 하는 경우 이러한 라인에 따라 사용자 정의 서문(또는 패키지)을 디자인할 수 있습니다. 이는 표현과 스타일을 완전히 분리하므로 환경 내부의 마크업은 document완전히 의미론적입니다. 그리고 원하는 레이아웃 스타일을 얻기 위해 상당히 간단한 솔루션도 사용한다고 생각합니다.

\documentclass{article}

\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[margin=1.5in]{geometry}
\usepackage{multicol}

\usepackage{marvosym} % for icons
\usepackage{url} % for e-mail address
\usepackage{sectsty}  % for customizing section font

\sectionfont{\normalsize\bfseries}

% Horizontal rule
\newlength{\normalrulethickness}
\setlength{\normalrulethickness}{0.4pt}
\newcommand{\thinrule}{\noindent\rule{\linewidth}{\normalrulethickness}}
\newcommand{\thickrule}{\noindent\rule{\linewidth}{2\normalrulethickness}}
\newcommand{\doublerule}{%
    \thickrule%
    \llap{\rule[2pt]{\linewidth}{\normalrulethickness}}%
}
% Letterhead at top of page
\newcommand{\letterhead}{%
    \noindent%
    \textbf{\department}\hfill \textbf{\university}\newline
    \course\hfill \documentname\hfill \subject\newline
    \doublerule\par\smallskip
    {\small\noindent%
    \professor\hfill \emailicon\ \email\hfill \phoneicon\ \phone\hfill \office%
    }\par\bigskip%
}

% Commands to set the values in the \letterhead
\newcommand{\setdepartment}[1]{\gdef\department{#1}}
\newcommand{\setuniversity}[1]{\gdef\university{#1}}
\newcommand{\setcourse}[1]{\gdef\course{#1}}
\newcommand{\setsubject}[1]{\gdef\subject{#1}}
\newcommand{\setdocumentname}[1]{\gdef\documentname{#1}}
\newcommand{\setprofessor}[1]{\gdef\professor{#1}}
\newcommand{\setemail}[1]{\gdef\email{\url{#1}}}
\newcommand{\setphone}[1]{\gdef\phone{#1}}
\newcommand{\setoffice}[1]{\gdef\office{#1}}

% Icons in letterhead
\newcommand{\emailicon}{\Email} % from marvosym
\newcommand{\phoneicon}{\Telefon}


% Block of instructions with rule before and after
\newenvironment{instructions}{\thickrule}{\thickrule}

% 2-column exam questions
\newenvironment{examquestions}
    {\begin{multicols}{2}}
    {\end{multicols}}

\newcommand{\pointvalue}[1]{\hfill\mbox{#1}}
\newcommand{\strong}[1]{\textbf{#1}}

\begin{document}
\setdepartment{Departamento de Física}
\setuniversity{Universidad de Santiago de Chile}
\setcourse{Teoría Física (22104)}
\setsubject{Ingeniería Matemática}
\setdocumentname{EXAMEN}
\setprofessor{Prof.~Carlos H.~Esparza-Barrera}
\setemail{[email protected]}
\setphone{(56-2-)7181239}
\setoffice{Oficina 27}

\letterhead

\begin{instructions}
\begin{itemize}
\item \strong{%
Esta prueba consta de cuatro problemas, usted debe responder tres de ellos.
La elección es suya y debe indicarla en la hoja. 
Si responde los cuatro, se considerarán los tres peor evaluados.
}\pointvalue{Cada problema vale $2,0$ puntos.}
\item Fundamente su razonamiento; haga esquemas explicatorios. [\dots]
\item Las situaciones y los valores numéricos de los datos suministrados [\dots]
\end{itemize}
\end{instructions}

\begin{examquestions}

\section{Insectos}
Algunos coleópteros pueden proyectarse verticalmente [\dots]

\section{Esferas de aluminio y fierro}
La masa de un metro cúbio de Al es $2,70 \times 10^3$~kg [\dots] %better to use siunitx 

\end{examquestions}


\end{document}

여기에 이미지 설명을 입력하세요

답변2

아래 코드에 잘못된 코드를 강조하는 수많은 설명을 남겼지만 이 버전은 latex 및 pdflatex에서 오류 없이 실행됩니다.

\documentclass[12pt]{article}

% never load epsfig it is just for emulating latex2.09 documents from 1980's
% rotating might be needed for sideways table, otherwise not
% psfrag doesn't work as is with pdflatex or dvipdfm
% graphics is loaded later
%\usepackage{rotating,graphics,psfrag,epsfig}


\usepackage{graphicx}

% color loaded later
%\usepackage{color}

\usepackage{latexsym}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}


%\usepackage[T1]{fontenc}

\usepackage{multicol}

%%% this is loaded later with different options
%\usepackage[dvipdfm]{hyperref}

\usepackage{fancyhdr}
\pagestyle{fancy}

\usepackage{lastpage}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{marvosym}
\newcommand{\ff}{Marzo del 2007}

\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{0.4pt}

%\usepackage[thickspace]{SIunits}

\usepackage[a]{esvect}

% no idea what this is, not in texlive
%\usepackage{shortlst}

\usepackage{marvosym}
\usepackage[version=3]{mhchem}

\newcommand{\solucion}{\noindent\textbf{Soluci\'on}}
\newcommand{\comentario}{\noindent\textbf{Comentario}}
\newcommand{\nota}{\noindent\textbf{Nota}:}
\newcommand{\suge}{\noindent\textbf{Sugerencia}:}
\newcommand{\analisis}{\noindent\textbf{An\'alisis}}
\newcommand{\modelo}{\noindent\textbf{Modelo}}


\fancyhead[L]{} 
\fancyhead[C]{}
\fancyhead[R]{} 
%
% don't use math \sim
\fancyfoot[L]{\url{http://fisica.usach.cl/~cesparza/}}
%\fancyfoot[C]{\ff} 
\fancyfoot[C]{} 
\fancyfoot[R]{TeoIngMat-EXA1s11.pdf -- 15 noviembre 2011}

\headwidth 18.0cm
\textwidth 18.0cm %18.0cm
\textheight 25.00cm % era25
\oddsidemargin -0.8cm
\evensidemargin -0.8cm
\topmargin -3.5000cm %era  -2.0cm
\columnsep 0.3cm

% I left this but having \parindent and \parskip both 0pt
% means that paragraph breaks  are not really visible
\parindent 0pt

\newcommand{\ia}{\'{\i}}

% The  \rm never did anything here and both
% \rm and \bf have been deprecated since 1994
%\newcommand{\xu}{\rm {\widehat{\bf{x}}}}
%\newcommand{\yu}{\rm {\widehat{\bf{y}}}}
%\newcommand{\zu}{\rm {\widehat{\bf{z}}}}
\newcommand{\xu}{\widehat{\mathbf{x}}}
\newcommand{\yu}{\widehat{\mathbf{y}}}
\newcommand{\zu}{\widehat{\mathbf{z}}}

\newcommand{\iu}{\mathbf{\hat{\imath}}}
\newcommand{\ju}{\mathbf{\hat{\jmath}}}
\newcommand{\ku}{\mathbf{\hat{\kappa}}}
\newcommand{\kuw}{\mathbf{\widehat{\kappa}}}



%\usepackage[dvipdfm]{hyperref}
\usepackage{hyperref}
\hypersetup{ 
pdfauthor = Carlos Esparza Barrera, 
pdftitle = TeoF1-IngMat-EXA1s11.pdf, 
pdfsubject = 2red, 
pdfkeywords [email protected], 
pdfcreator = {LaTeX con la paqueteria hyperref }, 
pdfproducer = {dvpdfm} 
}



\usepackage{type1cm} 
\usepackage{eso-pic}
\usepackage{color} 


\DeclareUnicodeCharacter{00ED}{\'{\i}}
\DeclareUnicodeCharacter{00F3}{\'{o}}
\DeclareUnicodeCharacter{00E1}{\'{a}}

\begin{document}



% psfrag doesn't work with pdf backends
% \psfrag{xu}{$\widehat{\bf{x}}$}
% \psfrag{yu}{$\widehat{\bf{y}}$}
%\psfrag{iu}{$\mathbf{\hat \imath}$}
% \psfrag{ju}{$\mathbf{\hat \jmath}$} 
% \psfrag{i}{$\hat \imath$}
% \psfrag{j}{$\hat \jmath$}

\textbf{Departamento de Fisica \hfill Universidad de Santiago de Chile} 

Teoria a Física I (22104)\hfill \textbf{EXAMEN} \hfill Ingeniería Matemática \vspace{0.1cm}

%\hline is only used in tables
%\hline \hline 
\vspace{0.2cm}

Prof. Carlos H. Esparza-Barrera \hfill \begin{LARGE} \raisebox{-0.5ex}{\Email}                               
           \end{LARGE}  [email protected] \hfill \begin{LARGE}\Telefon \end{LARGE} ~(56-2-)7181239
\hfill Oficina 27 

% never end a paragraph with \\
%\\[0.1cm] 

%\hline
\begin{itemize}

\item  \begin{large} \textbf{Esta prueba
consta de cuatro problemas, usted debe responder tres de ellos. La
elección es suya y debe indicarla en la hoja. Si responde los cuatro, se considerarán los tres
peor evaluados}
%Always include a paragraph end _within_ a size change this blank line is needed

\end{large}.  \hfill  Cada problema vale $2,0$ puntos. 

\item Fundamente su razonamiento; haga esquemas explicatorios. Use
l\'apiz  indeleble; en caso contrario, no puede pretender una segunda revisi\'on de su trabajo. Exprese sus
repuestas numéricas con 3 CS.


\item Las situaciones y los valores num\'ericos de los datos suministrados no necesariamente corresponden a
los de un experimento o situaci\'on pr\'actica real.  Se pretende que usted  trabaje cada problema  con
el modelo adecuado en el marco de la  teor\'ia  pertinente y obtenga las predicciones correspondientes. 

\end{itemize}
%\hline

\begin{multicols}{2}
\begin{enumerate}


\item problema 1

\item ...

\item ...


\item ...


\item ...


\item ...
\end{enumerate}

\end{multicols}
\end{document}

답변3

나는 일반 TeX 코드가 LaTeX보다 더 간단하다는 것을 보여줍니다. 시험 문서를 작성하려면 다음을 수행하십시오.

\input opmac

{\mubytein=0 
 \mubyte\revquestion ¿\endmubyte \gdef\revquestion{?`}
}
\let\secfont=\seccfont  
\font\mvfont=umvs at12pt 
\def\mvchr#1{{\mvfont\char#1}}
\def\Email{\mvchr{107}}  \def\Telefon{\mvchr{84}}
\def\u{\,\rm}

\line{\bf Departamento de Fisica \hfil Universidad de Santiago de Chile}
\line{Teoría a Física I (22104)\hfil {\bf EXAMEN}\hfil 
      Ingeniería Matemática\strut}
\hrule \kern1.5pt \hrule \medskip
\line{Prof. Carlos H. Esparza-Barrera\hfil 
      \lower.5ex\hbox{\Email} [email protected]\hfil
      {\Telefon} (56-2-)7181239\hfil Oficina 27\strut}
\medskip \hrule
\bigskip

\begitems \style x \parskip=\medskipamount
* {\typosize[12/14]\bf Esta prueba consta de cuatro problemas, 
  usted debe responder tres de ellos. La elección es suya y debe
  indicarla en la hoja. Si responde los cuatro, se considerarán 
  los tres peor evaluados.\par}
* Fundamente su razonamiento; haga esquemas explicatorios. Use
  lápiz  indeleble; en caso contrario, no puede pretender una segunda
  revisión de su trabajo. Exprese sus
  repuestas numéricas con 3 CS.
* Las situaciones y los valores numéricos de los datos suministrados no   
  necesariamente corresponden a los de un experimento o situación práctica   
  real. Se pretende que usted trabaje cada problema con el modelo 
  adecuado en el marco de la teoría pertinente y obtenga las predicciones
  correspondientes.
\enditems

\hrule\bigskip

\begmulti 2

\sec Insectos


Algunos coleópteros pueden proyectarse verticalmente por sí mismos con una
aceleración de unos $400{\u g}$ (ésto es, un orden de magnitud superior de
lo que un ser humano con entrenamiento puede resistir). El impulso proviene 
en algunos casos de desdoblar sus patas y en otros de curvar violentamente 
el abdomen, hecho que origina un recorrido vertical durante la aceleración 
de unos 0,5{\u cm}. Bajo las anteriores consideraciones:

\begitems \style n
* ¿A qué altura pueden saltar?
* ¿Cuánto tiempo permanecen en el aire?
\enditems

\sec Dos bloques

Un bloque de masa $m= 30{\u kg}$ desliza con aceleración horizontal
$a_{\u m}= 3{\u m/s^2}$ por la parte superior de otro bloque de masa
$M= 30{\u kg}$ por la acción de una fuerza horizontal de magnitud   
$F= 160{\u N}$, como se indica en la Figura.

El bloque de masa $M$ está sobre una superficie horizontal sin roce. Entre
los bloques
$m$ y $M$ hay roce.
\begitems \style n 
* Determine el coeficiente de roce cinético entre los bloques.
* Determine la aceleración del bloque $M$ durante el tiempo que $m$ está
  completamente en contacto con $M$.
\enditems

\endmulti
\bye

결과는 다음과 같습니다.

시험하다

로 이를 사전 처리해 볼 수 있습니다 pdfcsplain document. pdfcsplainó, í, á와 같은 UTF-8 코드를 올바르게 해석하려면 여기에서 형식을 권장합니다 . 역방향 물음표는 기본 요소 csplain로 선언할 수 있습니다 \mubyte(코드의 세 번째 줄 참조).

관련 정보