2014 dxdy logo

Научный форум dxdy

Математика, Физика, Computer Science, Machine Learning, LaTeX, Механика и Техника, Химия,
Биология и Медицина, Экономика и Финансовая Математика, Гуманитарные науки




Начать новую тему Ответить на тему
 
 Подключение русского языка
Сообщение16.11.2017, 02:26 


31/10/14
19
Здравствуйте!
Мной был найден интересный шаблон, хочу его взять за основу, да вот беда, никак не удается подключить русский язык. Т.е. я его указываю в настройках, но при его использовании вылетает ошибка (Оригинал на испанском).
Взято отсюда: https://www.overleaf.com/12235121ymqwbpkdnctk#/46503458/
Помогите разобраться, пожалуйста!

Код:
\documentclass[paper=a4,fontsize=11pt]{scrartcl} % KOMA-article class
                     
\usepackage[english,[b]russian[/b]]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm}     % Math packages
\usepackage{graphicx}                    % Enable pdflatex
\usepackage[svgnames]{xcolor}            % Colors by their 'svgnames'
\usepackage{geometry}
   \textheight=700px                    % Saving trees <!-- s;-) --><img src=\\"{SMILIES_PATH}/icon_wink.gif\\" alt=\\";-)\\" title=\\";-)\\" /><!-- s;-) -->
\usepackage{url}

\frenchspacing              % Better looking spacings after periods
\pagestyle{empty}           % No pagenumbers/headers/footers

%%% Custom sectioning (sectsty package)
%%% ------------------------------------------------------------
\usepackage{sectsty}

\sectionfont{%                     % Change font of \section command
   \usefont{OT1}{phv}{b}{n}%      % bch-b-n: CharterBT-Bold font
   \sectionrule{0pt}{0pt}{-5pt}{1pt}}

%%% Macros
%%% ------------------------------------------------------------
\newlength{\spacebox}
\settowidth{\spacebox}{8888888888}         % Box to align text
\newcommand{\sepspace}{\vspace*{1em}}      % Vertical space macro

\newcommand{\MyName}[1]{ % Name
      \Huge \usefont{OT1}{phv}{b}{n} \hfill #1
      \par \normalsize \normalfont}
      
\newcommand{\MySlogan}[1]{ % Slogan (optional)
      \large \usefont{OT1}{phv}{m}{n}\hfill \textit{#1}
      \par \normalsize \normalfont}

\newcommand{\NewPart}[1]{\section*{\uppercase{#1}}}

\newcommand{\PersonalEntry}[2]{
      \noindent\hangindent=2em\hangafter=0 % Indentation
      \parbox{\spacebox}{        % Box to align text
      \textit{#1}}             % Entry name (birth, address, etc.)
      \hspace{1.5em} #2 \par}    % Entry value

\newcommand{\SkillsEntry}[2]{      % Same as \PersonalEntry
      \noindent\hangindent=2em\hangafter=0 % Indentation
      \parbox{\spacebox}{        % Box to align text
      \textit{#1}}            % Entry name (birth, address, etc.)
      \hspace{1.5em} #2 \par}    % Entry value   
      
\newcommand{\EducationEntry}[4]{
      \noindent \textbf{#1} \hfill      % Study
      \colorbox{White}{%
         \parbox{5cm}{%
         \hfill\color{Black}#2}} \par  % Duration
      \noindent \textit{#3} \par        % School
      \noindent\hangindent=2em\hangafter=0 \small #4 % Description
      \normalsize \par}

\newcommand{\WorkEntry}[4]{              % Same as \EducationEntry
      \noindent \textbf{#1} \hfill      % Jobname
      \noindent\colorbox{Black}{\color{White}#2} \par  % Duration
      \noindent \textit{#3} \par              % Company
      \noindent\hangindent=2em\hangafter=0 \small #4 % Description
      \normalsize \par}

%%% Begin Document
%%% ------------------------------------------------------------
\begin{document}
% you can upload a photo and include it here...
%\begin{wrapfigure}{l}{0.5\textwidth}
%   \vspace*{-2em}
%      \includegraphics[width=0.15\textwidth]{photo}
%\end{wrapfigure}

\MyName{Nombre Apellido Apellido}
\MySlogan{Nombre de tu carrera}

\sepspace

%%% Personal details
%%% ------------------------------------------------------------
\NewPart{Datos personales}{}

\PersonalEntry{Nacimiento}{11 de diciembre, 1997}
%\PersonalEntry{Address}{111 First St, New York}
\PersonalEntry{Teléfono}{(+00) 0000-0000-0000}
\PersonalEntry{E--Mail}{\url{mailmailmail@gmail.com}}

%%% Education
%%% ------------------------------------------------------------
\NewPart{Educación}{}

\EducationEntry{Ingeniería de Lo que sea}{2001-2002}{Universidad Politécnica de Madrid}{
\begin{itemize}
\item{Especialidad }
\item{Asignaturas más relevantes de carrera/especialidad}
\item{Proyecto de fin de carrera: \emph{título del proyecto}}
\end{itemize}
}

\sepspace

\EducationEntry{Curso extracurricular}{Verano 2001}{Lugar}{Descripcion del curso, horas invertidas, habilidades ganadas}

%%% Work experience
%%% ------------------------------------------------------------
\NewPart{Experiencia laboral}{}

\EducationEntry{Título trabajo 1}{Periodo}{Empresa}{
\begin{itemize}
\item{Función 1}
\item{Función 2}
\item{Función 3}
\end{itemize}
}
\sepspace

\EducationEntry{Título trabajo 2}{Periodo}{Empresa}{Descripción, habilidades}

%%% Skills
%%% ------------------------------------------------------------
\NewPart{Habilidades personales}{}

\SkillsEntry{Idiomas}{Español (nativo)}
\SkillsEntry{}{Inglés (nivel).}
\SkillsEntry{}{Francés (nivel)}

\SkillsEntry{Software}{Excel, PowerPoint, ...}
\SkillsEntry{Soft skills}{Trabajo en equipos multiculturales}
\SkillsEntry{}{Flexibilidad y adaptación ante cambios en el proyecto}
\SkillsEntry{}{Gran capacidad de comunicación}
\SkillsEntry{}{Análisis y resolución de problemas}
%\SkillsEntry{}{}




%%% References
%%% ------------------------------------------------------------
%\NewPart{References}{}
%Available upon request
\end{document}

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение16.11.2017, 02:41 
Заслуженный участник


09/05/12
25179
Какая конкретно ошибка? Ваш документ собирается (с TeXLive 2016), надо только убрать непонятно откуда возникшие тэги [ b ] и [ / b ] (пишу с разрядкой, чтобы форумный движок не воспринял их как выделение жирным) вокруг russian в 3-й строке.

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение16.11.2017, 02:43 
Заслуженный участник
Аватара пользователя


31/01/14
11017
Hogtown
Добавьте
Используется синтаксис LaTeX
\usepackage[T2A]{fontenc}

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение16.11.2017, 08:47 


31/10/14
19
Цитата:
Какая конкретно ошибка? Ваш документ собирается (с TeXLive 2016), надо только убрать непонятно откуда возникшие тэги [ b ] и [ / b ] (пишу с разрядкой, чтобы форумный движок не воспринял их как выделение жирным) вокруг russian в 3-й строке.


Да, но если вставить хоть одно слово на русском, все разваливается. Например, вместо edication - Образование.
Вылетает ошибка:
Package utf8x Error: MalformedUTF-8sequence.

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение16.11.2017, 09:32 
Заслуженный участник


09/05/12
25179
white flomaster в сообщении #1265700 писал(а):
Да, но если вставить хоть одно слово на русском, все разваливается.
Вообще-то не везде. :-) Но ладно, проблема в том, что в некоторых определенных в преамбуле командах есть следующее: \usefont{OT1}{phv}{m}{n} и т.п. Если поменять OT1 на T2A, то все заработает, правда, ценой смены шрифта.

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение16.11.2017, 10:17 


31/10/14
19
Цитата:
Вообще-то не везде. :-) Но ладно, проблема в том, что в некоторых определенных в преамбуле командах есть следующее: \usefont{OT1}{phv}{m}{n} и т.п. Если поменять OT1 на T2A, то все заработает, правда, ценой смены шрифта.


Точно, не везде)
Спасибо!!!
Можно последний глупый вопрос?:)
После замены, Вами предложенной, в заголовках шрифт меняется, ок, но вместо "Образование" получается "[U+FFFD]Бразование".
Как это исправить? :-(

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение16.11.2017, 10:40 
Заслуженный участник


09/05/12
25179
Покажите текущий вариант, тут уже сложно восстановить, что и как Вы сделали.

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение16.11.2017, 10:44 


31/10/14
19
Код:
\documentclass[paper=a4,fontsize=11pt]{scrartcl} % KOMA-article class
                     
\usepackage[english,russian]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm}     % Math packages
\usepackage{graphicx}                    % Enable pdflatex
\usepackage[svgnames]{xcolor}            % Colors by their 'svgnames'
\usepackage{geometry}
   \textheight=700px                    % Saving trees <!-- s;-) --><img src=\\"{SMILIES_PATH}/icon_wink.gif\\" alt=\\";-)\\" title=\\";-)\\" /><!-- s;-) -->
\usepackage{url}

\frenchspacing              % Better looking spacings after periods
\pagestyle{empty}           % No pagenumbers/headers/footers

%%% Custom sectioning (sectsty package)
%%% ------------------------------------------------------------
\usepackage{sectsty}

\sectionfont{%                     % Change font of \section command
   \usefont{T2A}{phv}{b}{n}%      % bch-b-n: CharterBT-Bold font
   \sectionrule{0pt}{0pt}{-5pt}{1pt}}

%%% Macros
%%% ------------------------------------------------------------
\newlength{\spacebox}
\settowidth{\spacebox}{8888888888}         % Box to align text
\newcommand{\sepspace}{\vspace*{1em}}      % Vertical space macro

\newcommand{\MyName}[1]{ % Name
      \Huge \usefont{T2A}{phv}{b}{n} \hfill #1
      \par \normalsize \normalfont}
     
\newcommand{\MySlogan}[1]{ % Slogan (optional)
      \large \usefont{T2A}{phv}{m}{n}\hfill \textit{#1}
      \par \normalsize \normalfont}

\newcommand{\NewPart}[1]{\section*{\uppercase{#1}}}

\newcommand{\PersonalEntry}[2]{
      \noindent\hangindent=2em\hangafter=0 % Indentation
      \parbox{\spacebox}{        % Box to align text
      \textit{#1}}             % Entry name (birth, address, etc.)
      \hspace{1.5em} #2 \par}    % Entry value

\newcommand{\SkillsEntry}[2]{      % Same as \PersonalEntry
      \noindent\hangindent=2em\hangafter=0 % Indentation
      \parbox{\spacebox}{        % Box to align text
      \textit{#1}}            % Entry name (birth, address, etc.)
      \hspace{1.5em} #2 \par}    % Entry value   
     
\newcommand{\EducationEntry}[4]{
      \noindent \textbf{#1} \hfill      % Study
      \colorbox{White}{%
         \parbox{5cm}{%
         \hfill\color{Black}#2}} \par  % Duration
      \noindent \textit{#3} \par        % School
      \noindent\hangindent=2em\hangafter=0 \small #4 % Description
      \normalsize \par}

\newcommand{\WorkEntry}[4]{              % Same as \EducationEntry
      \noindent \textbf{#1} \hfill      % Jobname
      \noindent\colorbox{Black}{\color{White}#2} \par  % Duration
      \noindent \textit{#3} \par              % Company
      \noindent\hangindent=2em\hangafter=0 \small #4 % Description
      \normalsize \par}

%%% Begin Document
%%% ------------------------------------------------------------
\begin{document}
% you can upload a photo and include it here...
%\begin{wrapfigure}{l}{0.5\textwidth}
%   \vspace*{-2em}
%      \includegraphics[width=0.15\textwidth]{photo}
%\end{wrapfigure}

\MyName{Иванов Иван}
\MySlogan{Nombre de tu carrera}

\sepspace

%%% Personal details
%%% ------------------------------------------------------------
\NewPart{Персональные данные}{}

\PersonalEntry{Nacimiento}{11 de diciembre, 1997}
%\PersonalEntry{Address}{111 First St, New York}
\PersonalEntry{Teléfono}{(+00) 0000-0000-0000}
\PersonalEntry{E--Mail}{\url{mailmailmail@gmail.com}}

%%% Education
%%% ------------------------------------------------------------
\NewPart{Образование}{}

\EducationEntry{Ingeniería de Lo que sea}{2001-2002}{Universidad Politécnica de Madrid}{
\begin{itemize}
\item{Especialidad }
\item{Asignaturas más relevantes de carrera/especialidad}
\item{Proyecto de fin de carrera: \emph{título del proyecto}}
\end{itemize}
}

\sepspace

\EducationEntry{Curso extracurricular}{Verano 2001}{Lugar}{Descripcion del curso, horas invertidas, habilidades ganadas}

%%% Work experience
%%% ------------------------------------------------------------
\NewPart{Experiencia laboral}{}

\EducationEntry{Título trabajo 1}{Periodo}{Empresa}{
\begin{itemize}
\item{Función 1}
\item{Función 2}
\item{Función 3}
\end{itemize}
}
\sepspace

\EducationEntry{Título trabajo 2}{Periodo}{Empresa}{Descripción, habilidades}

%%% Skills
%%% ------------------------------------------------------------
\NewPart{Habilidades personales}{}

\SkillsEntry{Idiomas}{Español (nativo)}
\SkillsEntry{}{Inglés (nivel).}
\SkillsEntry{}{Francés (nivel)}

\SkillsEntry{Software}{Excel, PowerPoint, ...}
\SkillsEntry{Soft skills}{Ansys}
\SkillsEntry{}{Flexibilidad y adaptación ante cambios en el proyecto}
\SkillsEntry{}{Gran capacidad de comunicación}
\SkillsEntry{}{Análisis y resolución de problemas}
%\SkillsEntry{}{}




%%% References
%%% ------------------------------------------------------------
%\NewPart{References}{}
%Available upon request
\end{document}

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение16.11.2017, 10:49 
Заслуженный участник


09/05/12
25179
М-да, странно... правда, тут это не единственная проблема, судя по результату такой сборки.

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение16.11.2017, 14:41 
Заслуженный участник
Аватара пользователя


11/01/06
3822
Как минимум, замените \uppercase на \MakeUppercase.

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение16.11.2017, 22:14 
Заслуженный участник


01/06/15
1149
С.-Петербург
Используется синтаксис LaTeX
\usepackage[T2A]{fontenc}
плюс замена \uppercase на \MakeUppercase -- никаких проблем при компиляции (pdfLaTeX, MikTeX).

 Профиль  
                  
 
 Re: Подключение русского языка
Сообщение17.11.2017, 19:06 


31/10/14
19
Всем огромная благодарность!!!!

 Профиль  
                  
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 12 ] 

Модераторы: Karan, Toucan, PAV, maxal, Супермодераторы



Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group