Как заставить элементы быть на одной линии? - PullRequest
0 голосов
/ 17 апреля 2019

Я хочу добавить навыки на боковую панель моего резюме, созданного в LaTeX, я использую пакет tcolorbox для создания овального блока вокруг текста, но каждый раз, когда я создаю новый овальный блок, текст (с блоком) переходит к новая линия. Как я могу заставить его быть добавлены один за другим в той же строке?

Вот код для шаблона (шаблон латекса двадцать секунд):

\documentclass[letterpaper]{twentysecondcv} % a4paper for A4
\definecolor{shadecolor}{rgb}{1,0.8,0.3}

\usepackage{times,tcolorbox}
\newtcbox{\ovalbox}{colback=gray!50!white,boxrule=0pt,arc=5pt,
  boxsep=0pt,left=4pt,right=4pt,top=2pt,bottom=2pt}

\profilepic{alice.jpeg}
\cvname{Your Name}
\cvjobtitle{about me}

\begin{document}

\aboutme{}
\contact{contact}

%----------------------------------------------------------------------------------------
%    SKILLS
%----------------------------------------------------------------------------------------

\myskills{
\ovalbox{Skill 1} 
\ovalbox{Skill2} 
\ovalbox{Skill3}
\ovalbox{Skill4}

}

\references{references document 1}

\makeprofile % Print the sidebar

%----------------------------------------------------------------------------------------
%    MAIN PAGE
%----------------------------------------------------------------------------------------

\section{About Me}

\hrulefill 

\section{Experience}

\hrulefill 

\section{Education}

\hrulefill 

\section{Courses}

\hrulefill 
\section{Other information}
\end{document} 

1 Ответ

1 голос
/ 18 апреля 2019
  • , чтобы все \tcbox были в одной строке, добавьте параметр nobeforeafter к определению \ovalbox

  • , если вы изменитефайл класса, также было бы лучше изменить имя (например, twentysecondcvx.cls), чтобы избежать путаницы в разных версиях.[соответственно измените первую строку в файле .cls]


\documentclass[letterpaper]{twentysecondcvx} % a4paper for A4
\definecolor{shadecolor}{rgb}{1,0.8,0.3}

\usepackage{tcolorbox}
\newtcbox{\ovalbox}{colback=gray!50!white,boxrule=0pt,arc=5pt,
  boxsep=0pt,left=4pt,right=4pt,top=2pt,bottom=2pt,nobeforeafter}

\profilepic{alice.jpeg}
\cvname{Your Name}
\cvjobtitle{about me}

\begin{document}

\aboutme{}
\contact{contact}

%----------------------------------------------------------------------------------------
%    SKILLS
%----------------------------------------------------------------------------------------

\myskills{
\ovalbox{Skill 1} 
\ovalbox{Skill2} 
\ovalbox{Skill3}
\ovalbox{Skill4}

}

\references{references document 1}

\makeprofile % Print the sidebar

%----------------------------------------------------------------------------------------
%    MAIN PAGE
%----------------------------------------------------------------------------------------

\section{About Me}

\hrulefill 

\section{Experience}

\hrulefill 

\section{Education}

\hrulefill 

\section{Courses}

\hrulefill 
\section{Other information}
\end{document} 

enter image description here

...