LaTeX forum ⇒ Text Formattingfootline text is not aligned and centered in Beamer class

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
hicham
Posts: 12
Joined: Mon Mar 13, 2017 3:33 pm

footline text is not aligned and centered in Beamer class

Postby hicham » Wed May 23, 2018 4:44 am

\setbeamerfont{footline}{size=\fontsize{6}{6}\selectfont}
\makeatletter
\setbeamertemplate{footline}{%
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.19\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor%\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.55\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.35\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertinstitute{},~\insertshortdate{}~~~\insertframenumber{}/\inserttotalframenumber\hspace*{2ex}hspace*{2ex}
%\insertframenumber{}/\inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother

User avatar
Stefan Kottwitz
Site Admin
Posts: 8904
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed May 23, 2018 2:13 pm

Hi,

ok, that's a piece of code!

What shall we do with this? Read it line by line? For testing it, we would need a compilable (complete small) sample document. For example, that code doesn't show the theme you use (general theme, inner theme) and that's of cause important regarding footling styling.

Stefan
Site admin

hicham
Posts: 12
Joined: Mon Mar 13, 2017 3:33 pm

Postby hicham » Thu May 24, 2018 3:34 pm

  1. \documentclass[xcolor=pdftex,dvipsnames,table]{beamer}
  2. %\definecolor{LHCblue}{RGB}{4, 114, 255}
  3. %\usecolortheme[named=LHCblue]{structure}
  4.  
  5. \setbeamerfont{headline}{size=\footnotesize}
  6. \setbeamerfont{section in head/foot}{size=\tiny}
  7.  
  8. \usepackage[bars]{beamerthemetree} % Beamer theme v 2.2
  9. \usepackage{kerkis}
  10. \usepackage{multimedia}
  11. \usepackage{subfigure}
  12.  
  13. \usepackage{xspace}
  14. \usepackage[absolute,overlay]{textpos}
  15. \usepackage{amsmath,amsfonts,amssymb,mathrsfs}
  16. \usepackage[utf8]{inputenc}
  17. \usepackage[T1]{fontenc}
  18.  
  19. \usepackage{color,colortbl}
  20. \usepackage[most]{tcolorbox}
  21. \usepackage{varwidth}
  22. \usepackage{makeidx}
  23. \usepackage{empheq}
  24. \usepackage{array}
  25. \usepackage{adjustbox}
  26. \usepackage{pstricks}
  27. \usetikzlibrary{matrix}
  28. \usepackage{tkz-euclide}
  29. \usetkzobj[all]
  30. \usepackage{xlop}
  31. \usepackage{tcolorbox}
  32. \usepackage{pgfplots}
  33. \usepackage[makeroom]{cancel}
  34. \usepackage{pgf-pie}
  35. \usepackage{bchart}
  36. \usepackage{pifont}
  37. \let\checkmark\undefined
  38. \usepackage{dingbat}
  39. \usepackage{keystroke}
  40. \usepackage{booktabs}
  41. \usepackage{xcolor,multirow}
  42. \usepackage{beamerthemesplit}
  43. \usepackage{tikz,tcolorbox}
  44. \usepackage[tikz]{bclogo}
  45. \usetikzlibrary{calc,fadings,mindmap,trees,shadows,arrows,shapes,shapes.callouts,ocgx} %\usetikzlibrary{arrows,shapes}
  46.  
  47. \usepackage{ragged2e}
  48. \usetikzlibrary{positioning}
  49.  
  50. \usepackage{tikzpeople}
  51. \usepackage{clock,colortbl}
  52. \usepackage{color}
  53. \usepackage{graphicx}
  54.  
  55. %\usepackage{enumitem}
  56. %\usepackage{multirow}
  57. \usetikzlibrary{shadings}
  58. \usepackage{marvosym}
  59. \usepackage{wasysym}
  60. \usepackage{fancybox}
  61. \usepackage{hyperref}
  62. \usepackage{lmodern}
  63. \usepackage{arabtex}
  64. \usepackage{engrec}
  65. \usepackage{C:/arabtex/arab311/tex/latex/arabtex/arabtex}
  66. \usepackage{C:/arabtex/apatch}
  67. \usepackage{C:/arabtex/alocal}
  68. \usepackage[francais]{babel}
  69.  
  70. \usepackage{multicol}
  71.  
  72. \mode<presentation>
  73. \newcommand*\oldmacro{}%
  74. \let\oldmacro\insertshorttitle%
  75. \renewcommand*\insertshorttitle{%
  76. \oldmacro\hfill%
  77. %\insertframenumber\,}%/\,\inserttotalframenumber
  78. }
  79. \setbeamertemplate{footline}[frame number]
  80. %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. %\usetheme{Ilmenau} % Beamer theme v 3.0
  82. \usetheme{Madrid}
  83. %\usetheme{Warsaw}
  84.  
  85. \usecolortheme[rgb={0.0, 0.14, 0.4}]{structure} % 29/01/2018
  86.  
  87. %\usecolortheme{whale}
  88. \usefonttheme{default}
  89. %\usefonttheme{professionalfonts}
  90. \useoutertheme[subsection=true]{smoothbars}%Beamer Outer Theme-circles on top
  91. \useinnertheme{circles} %rectangle bullet points instead of circle ones
  92. \usepackage{beamerthemebars}
  93.  
  94. \setbeamertemplate{blocks}[rounded][shadow=false]
  95. %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  96.  
  97. %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98. \setbeamerfont{footline}{size=\fontsize{6}{6}\selectfont}
  99. \makeatletter
  100. \setbeamertemplate{footline}{%
  101. \leavevmode%
  102. \hbox{%
  103. \begin{beamercolorbox}[wd=.19\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
  104. \usebeamerfont{author in head/foot}\insertshortauthor%\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
  105. \end{beamercolorbox}%
  106. \begin{beamercolorbox}[wd=.55\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
  107. \usebeamerfont{title in head/foot}\insertshorttitle
  108. \end{beamercolorbox}%
  109. \begin{beamercolorbox}[wd=.35\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
  110. \usebeamerfont{date in head/foot}\insertinstitute{},~\insertshortdate{}~~~\insertframenumber{}/\inserttotalframenumber\hspace*{2ex}hspace*{2ex}
  111. %\insertframenumber{}/\inserttotalframenumber\hspace*{2ex}
  112. \end{beamercolorbox}}%
  113. \vskip0pt%
  114. }
  115. \makeatother
  116. %%%%%%%%%%%%%%_____END MAKEATLETTER_____%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  117.  
  118. \title[XXXXXXXX]{\textcolor[rgb]{1.00,1.00,0.07}{ZZZZZZ}}
  119. \author[AAAA]{AAAAAA\\AAAAA}
  120. \institute{AAA}
  121. \date{\today}
  122. %\titlegraphic{\vspace{8cm}}
  123.  
  124.  
  125. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  126. \usetikzlibrary{mindmap,shadows}
  127. % Information boxes
  128. \newcommand*{\info}[4][16.3]{%
  129. \node[annotation, #3, scale=0.55, text width = #1em, %scale=0.65
  130. inner sep = 2mm ] at (#2) {%
  131. \list{$\bullet$}{\topsep=0pt\itemsep=0pt\parsep=0pt
  132. \parskip=0pt\labelwidth=8pt\leftmargin=8pt
  133. \itemindent=0pt\labelsep=2pt}%
  134. #4
  135. \endlist
  136. };
  137. }
  138. %************************************** TEXTE BUBBLE **************************************************************************
  139. \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture,baseline=0.5ex] \node (#1) {};}
  140.  
  141. % \explainword: #1= identifier to mark the word, #2 text
  142. \NewDocumentCommand{\explainword}{r[] m}{
  143. \switchocg{#1}{#2}\tikzmark{#1}
  144. }
  145.  
  146. \tikzset{my callout style/.style={
  147. draw,rectangle callout,anchor=pointer,callout relative pointer={(230:1cm)},
  148. rounded corners=2pt,align=left,text width=4.5cm,fill=white%cyan!20,
  149. }
  150. }
  151. % \mycallout: #1 opacity style, #2 pointer base position, #3= text
  152. \NewDocumentCommand{\mycallout}{O{opacity=0.8,text opacity=1} m m}{%
  153. \begin{tikzpicture}[remember picture, overlay]
  154. \begin{scope}[ocg={ref=#2,status=invisible,name={#3}}]
  155. \node[my callout style,#1]at (#2) {#3};
  156. \end{scope}
  157. \end{tikzpicture}
  158. }
  159. %*****************************************************************************************************************
  160. \setbeamertemplate{blocks}[rounded][shadow=true]
  161.  
  162. \setbeamercolor{titre}{bg=red,fg=white}
  163. \setbeamercolor{texte}{bg=red!10,fg=black}
  164. \beamerboxesdeclarecolorscheme{blocbleu}{blue}{yellow}
  165. %%%%**************************************** REDFINING BLOCK *****************************************************
  166. \definecolor{myblue}{rgb}{0.15,0.15,0.53}
  167. \definecolor{myred}{rgb}{0.89,0.20,0.45}
  168. \makeatletter
  169. \newtcbox{\titlebox}{
  170. enhanced,
  171. overlay={
  172. \draw[myblue,fill=myblue](frame.south east)--+(0,.2)to[bend right]+(.2,-0)--cycle;},
  173. colback=myblue,
  174. top=-1pt,bottom=-2pt,left=2pt,right=2pt,
  175. boxrule=1pt,
  176. colframe=myblue,
  177. sharp corners=south,
  178. colupper=white,
  179. fontupper=\bfseries
  180. }
  181. \newtcolorbox{myblock}[1][]{
  182. enhanced,
  183. left=2pt,
  184. right=2pt,
  185. %colframe=myblue,
  186. %colframe=red!50!white,
  187. colframe=blue!75!black,
  188. boxrule=1pt,
  189. colback=blue!10,
  190. overlay={
  191. \def\myblock@tempa{#1}
  192. \ifx\myblock@tempa\@empty
  193. \else
  194. \draw[myblue,fill=myblue]($(frame.north west)+(.2pt,-.2pt)$)--+(.1,0)to[bend right]+(-0,-.1)--cycle;
  195. \node [
  196. anchor=south west,
  197. inner sep=0pt,
  198. outer sep=0pt
  199. ]at(frame.north west){\titlebox{#1}};
  200. \fi
  201. },
  202. }
  203. \makeatother
  204. %%%%%*************************************************************************************************************
  205. \newtcolorbox{myblock2}[1][]{
  206. enhanced,
  207. width=\textwidth+5pt,
  208. enlarge left by=-3pt,
  209. colframe=block body.bg,
  210. colback=blue!10,
  211. %colframe=myblue,
  212. boxrule=1pt,
  213. bottom=0pt,
  214. top=-2pt,
  215. left=0pt,
  216. right=0pt,
  217. toptitle=-1pt,
  218. bottomtitle=-1pt,
  219. fonttitle=\normalfont,
  220. adjusted title=#1,
  221. interior titled code={
  222. \shade[left color=red!80,right color=orange!70,middle color=lime]
  223. (title.south west) --
  224. (title.south east) {[rounded corners] --
  225. (title.north east) --
  226. (title.north west)} --
  227. (title.south west);
  228. }
  229. }
  230. %%%%**************************************** END REDFINING BLOCK *************************************************
  231. \usepackage{siunitx}
  232. \sisetup{
  233. output-decimal-marker={,},
  234. group-separator={\,},
  235. }
  236. \def\ScanPercentage#1\afternumber{\SI{#1}{\percent}}
  237.  
  238. %%%%%%%%%%%*************************** MD FRAMED*******************************************************************
  239. \mdfdefinestyle{mystyle}{%
  240. linecolor=green!40!black,outerlinewidth=0.2pt,%
  241. %frametitlerule=true,frametitlefont=\rmfamily\bfseries\color{white},% \normalfont
  242. frametitlerule=true,frametitlefont=\normalfont\bfseries\color{white},
  243. frametitlerulewidth=1pt,frametitlerulecolor=green!40!black,%
  244. frametitlebackgroundcolor=green!40!black,
  245. backgroundcolor=green!5,
  246. %backgroundcolor=lime!5,%backgroundcolor=purple!5,
  247. innertopmargin=\topskip,
  248. roundcorner=5pt
  249. }
  250. \newmdenv[style=mystyle]{exe}
  251. \newenvironment{exemple}[1]
  252. {\begin{exe}[frametitle=#1]}
  253. {\end{exe}}
  254. %%%%%%%%%%%%%%%%%%% ALERT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  255. \setbeamertemplate{itemize subitem}[triangle]
  256. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  257. %%% ENCADREMENT EQUATION
  258.  
  259. \newcommand*\eqbox[1]{\definecolor{shadowcolor}{RGB}{0, 0, 102}\setlength\shadowsize{2pt}\shadowbox*{#1}}
  260.  
  261. \newcommand{\EqBox}[2][.8]{%
  262. \definecolor{shadowcolor}{RGB}{0, 0, 102}
  263. \setlength\shadowsize{2pt}
  264. \begin{equation}
  265. \shadowbox*{%
  266. \begin{minipage}{#1\linewidth}
  267. \[#2\]
  268. \end{minipage}
  269. }
  270. \end{equation}
  271. }
  272. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  273. \usetikzlibrary{fit,shapes.misc}
  274. \newcommand\marktopleft[1]{%
  275. \tikz[overlay,remember picture]
  276. \node (marker-#1-a) at (0,1.5ex) {};%
  277. }
  278. \newcommand\markbottomright[1]{%
  279. \tikz[overlay,remember picture]
  280. \node (marker-#1-b) at (0,0) {};%
  281. \tikz[overlay,remember picture,thick,dashed,inner sep=3pt]
  282. \node[draw,rounded rectangle,fit=(marker-#1-a.center) (marker-#1-b.center)] {};%
  283. }
  284. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TABLE OF CONTENETS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  285.  
  286. %%%%%*************************************************************************************************************
  287. \tikzset{
  288. abstractbox/.style={
  289. draw=black, fill=white, rectangle,
  290. inner sep=10pt, style=rounded corners,
  291. drop shadow={fill=black, opacity=1}
  292. },
  293. abstracttitle/.style={fill=white}
  294. }
  295.  
  296. \newcommand{\boxabstract}[2][fill=white]{
  297. \begin{tikzpicture}
  298. \node [abstractbox, #1] (box)
  299. {\begin{minipage}{0.80\linewidth}
  300. \setlength{\parindent}{2mm} % Indentar.
  301. \footnotesize #2
  302. \end{minipage}};
  303. \node[abstracttitle, right=10pt] at (box.north west) {Motivations:};
  304. \node[draw=none, fit=(box)] {};
  305. \end{tikzpicture}
  306. }
  307. %**************************************************************************************
  308. \newtcolorbox{Box2}[2][]{
  309. lower separated=false,
  310. colback=white,
  311. colframe=black,fonttitle=\sffamily,
  312. colbacktitle=red!50!black,
  313. coltitle=yellow,%red!15!yellow,
  314. enhanced,
  315. attach boxed title to top left={yshift=-0.1in,xshift=0.15in},
  316. boxed title style={boxrule=0pt,colframe=white,},
  317. title=#2,#1}
  318. %***************************************************************************************
  319. \newcommand\mindmapTitle{\textsc{\huge Projet d'intégration}}
  320. % FIRST MAP (IN THE TOP LEFT)
  321. \newcommand\mindmapTitleA{\scriptsize\textsc{ Enseignement }}
  322. \newcommand\mindmapAitemA{$\bullet$ Opérationnel et disponible en enseignement}
  323. \newcommand\mindmapAitemB{$\bullet$ Ouvert pour enseigner autres filières (LP, Master)}
  324. \newcommand\mindmapAitemC{$\bullet$ Collaborer et coopérer avec l'équipe pédagogique}
  325. \newcommand\mindmapAitemD{$\bullet$ Savoir-faire et savoir-\^etre}
  326.  
  327. % SECOND MAP (IN THE TOP RIGHT)
  328. \newcommand\mindmapTitleD{\scriptsize\textsc{Encadrement}}
  329. \newcommand\mindmapDitemA{$\bullet$ Encadrer des projets de recherche pour les étudiants de l'établissement}
  330. \newcommand\mindmapDitemB{$\bullet$ Etablir des conventions et de projets d'études avec autres établissement}
  331. \newcommand\mindmapDitemC{$\bullet$ Créer des partenariats avec le secteur privé et professionnel}
  332.  
  333. % THIRD MAP (IN THE BOTTOM RIGHT)
  334. \newcommand\mindmapTitleC{\scriptsize\textsc{Manifestation\\scientifique}} %conoscenze\\linguistiche
  335. \newcommand\mindmapCitemA{$\bullet$ Organisation de Conférences et Journées Scientifiques}
  336. \newcommand\mindmapCitemB{$\bullet$ Monter des projets de recherche avec des partenaires}
  337. \newcommand\mindmapCitemC{$\bullet$ Présenter l'établissement dans les évènements nationaux et internationaux}
  338.  
  339. % FOURTH MAP (IN THE BOTTOM LEFT)
  340. \newcommand\mindmapTitleB{\scriptsize\textsc{Recherche}}
  341. \newcommand\mindmapBitemA{$\bullet$ S'intégrer dans une équipe de recherche de l'établissement}
  342. \newcommand\mindmapBitemB{$\bullet$ Développer un réseau de recherche avec d’autres disciplines}
  343. \newcommand\mindmapBitemC{$\bullet$ S'ouvrir sur le monde socio-économique et industriel}
  344.  
  345. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  346. \setbeamercovered{transparent}
  347.  
  348. \usepackage{smartdiagram}
  349. \usetikzlibrary{shapes.symbols}
  350. \newtcolorbox{somebox}[1][]{%
  351. colback=white!70!yellow,
  352. colframe=white!20!black,
  353. titlerule=1mm,
  354. #1%
  355. }
  356. %***************************************************************************************************
  357. \newcommand{\ballexample}{\begin{tikzpicture}
  358. \path[use as bounding box] (0,0.8) rectangle +(0.1,0.1);
  359. \shadedraw [shading=ball] (0,0) circle (.8cm);
  360. \shadedraw [ball color=red] (3,-2.2) circle (.8cm);
  361. \end{tikzpicture}}
  362.  
  363. \begin{document}
  364. \begin{frame}
  365. %\titlegraphic{\includegraphics[height=1cm,width=2cm]{c:/logoum5rabat.png}}
  366. \titlepage
  367. \end{frame}
  368.  
  369. \end{document}
Last edited by Stefan Kottwitz on Thu May 24, 2018 4:03 pm, edited 1 time in total.
Reason: code marked

User avatar
Stefan Kottwitz
Site Admin
Posts: 8904
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu May 24, 2018 4:08 pm

It works as aligned in the commands in the boxes: center, center, and right aligned, each in its box in the footline.

beamer-footline.png
beamer-footline.png (22.69 KiB) Viewed 150 times


Stefan
Site admin


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 1 guest