How can I get the \rhead superiorly to the top and \chead down? - header

MWE
\documentclass[12pt,a4paper]{article}
\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage[margin=3cm]{geometry}
\usepackage{pgfplots}
\newlength{\tabcont}
\setlength{\parindent}{0.0in}
\setlength{\parskip}{0.05in}
\title{Assignment 4}
\newcommand{\course}{lipsum}
\newcommand{\coursen}{lipsum}
\newcommand{\semester}{lipsum}
\newcommand{\TDAG}{lipsum}
\newcommand{\campus}{lipsum}
\newcommand{\dept}{lipsum}
\pagestyle{fancyplain}
\headheight 56.2pt
\chead{\campus \\ \dept \\ \course \\ \coursen }
\lhead{\TDAG}
\rfoot{\thepage}
\begin{document}
\maketitle
Submit the following problems which are given in the tutorial 4 as your Assignment 4.
\begin{enumerate}
\item In question 19 ,part (d).
\end{enumerate}
\end{document}
The solution I want
After compiling the above document, the \rhead and \chead are similar in position of height. I want the \rhead to be up and \chead to be down/after \rhead.
I have reviewed a post that included something like \header[C], but that did not work. I am using Miktex + texMaker. But do provide an example if you know how to do it with \header[C] :)
Screenshots
Current one
What I get when I compile the above code
The solution that I need
I need code to get this look

You could just wrap the central header in a minipage:
\documentclass[12pt,a4paper]{article}
\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage[margin=3cm]{geometry}
\usepackage{pgfplots}
\newlength{\tabcont}
\setlength{\parindent}{0.0in}
\setlength{\parskip}{0.05in}
\title{Assignment 4}
\newcommand{\course}{lipsum}
\newcommand{\coursen}{lipsum}
\newcommand{\semester}{lipsum}
\newcommand{\TDAG}{lipsum}
\newcommand{\campus}{lipsum}
\newcommand{\dept}{lipsum}
\pagestyle{fancyplain}
\headheight 56.2pt
\chead{\begin{minipage}[t]{.3\textwidth}
\centering
\campus \\ \dept \\ \course \\ \coursen
\end{minipage}}
\lhead{\TDAG}
\rfoot{\thepage}
\begin{document}
\maketitle
Submit the following problems which are given in the tutorial 4 as your Assignment 4.
\begin{enumerate}
\item In question 19 ,part (d).
\end{enumerate}
\end{document}

Related

How to make pictures wider in LaTeX?

I have tried to make a several pictures in one big figure. However, they are placed very close to each other. I need to add more space between them (between pictures in horizontal and in vertical).
Code:
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h]
\centering
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[scale=0.6]{figs/solutions/transaction_solution.png}
\caption{Transaction level isolation}
\label{fig:subim1}
\end{subfigure}
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[scale=0.6]{figs/solutions/locking_solution.png}
\caption{Record locking}
\label{fig:subim2}
\end{subfigure}
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[scale=0.6]{figs/solutions/cache_solution.png}
\caption{Shared cache synchronization}
\label{fig:subim3}
\end{subfigure}
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[scale=0.6]{figs/solutions/message_broker_solution.png}
\caption{Message broker sequentializing}
\label{fig:subim4}
\end{subfigure}
\captionsetup{justification=centering,margin=1cm}
\caption{\label{fig:knng} Existing synchronization approaches for multiple server applications}
\end{figure}
\end{document}
Depending on what you want, you can have either images sticking to margins on both sides with some space in the middle or have them uniformly distributed over page. In both cases use \hspace{\hfill} in the middle as a filler. The former case does not require anything else. However, in the latter case, you would also need to add \hspace{\hfill} at both sides; this is the case in the example.
I also use a custom length since images seem to have the same size so you wouldn't need to repeat yourself each time you make a change.
Unfortunately, I can't post images this time.
The code
\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{subcaption}
\captionsetup{format=hang} % <--- added
\usepackage{showframe} % Draws frames around a page
\renewcommand*{\ShowFrameLinethickness}{0.2pt}
\renewcommand*{\ShowFrameColor}{\color{blue}}
\newlength\sfigwidth
\begin{document}
\setlength\sfigwidth{0.37\textwidth}
\begin{figure}[h]
\hspace{\fill}% % <--- cases uniform redistribution
\begin{subfigure}[t]{\sfigwidth}
\includegraphics[width=\linewidth]{example-image}
\caption{Transaction level isolation -- extra wording for demo}
\label{fig:subim1}
\end{subfigure}%
\hspace{\fill}%
\begin{subfigure}[t]{\sfigwidth}
\includegraphics[width=\linewidth]{example-image}
\caption{Record locking}
\label{fig:subim2}
\end{subfigure}%
\hspace{\fill} % <--- cases uniform redistribution
\vspace{3ex}
\hspace{\fill}%
\begin{subfigure}[t]{\sfigwidth}
\includegraphics[width=\linewidth]{example-image}
\caption{Shared cache synchronization}
\label{fig:subim3}
\end{subfigure}%
\hspace{\fill}%
\begin{subfigure}[t]{\sfigwidth}
\includegraphics[width=\linewidth]{example-image}
\caption{Message broker sequentializing}
\label{fig:subim4}
\end{subfigure}%
\hspace{\fill}
\captionsetup{justification=centering,margin=1cm}
\caption{\label{fig:knng} Existing synchronization approaches for multiple server applications}
\end{figure}
\end{document}
Use \hspace and \vspace between the subfigures.
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h]
\centering
\begin{subfigure}{0.4\textwidth}
\centering
\includegraphics[scale=0.6]{placeholder_1.png}
\caption{Transaction level isolation}
\label{fig:subim1}
\end{subfigure}%
\hspace{3em}%
\vspace{1em}
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[scale=0.6]{placeholder_1.png}
\caption{Record locking}
\label{fig:subim2}
\end{subfigure}%
\vspace{1em}
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[scale=0.6]{placeholder_1.png}
\caption{Shared cache synchronization}
\label{fig:subim3}
\end{subfigure}%
\hspace{3em}%
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[scale=0.6]{placeholder_1.png}
\caption{Message broker sequentializing}
\label{fig:subim4}
\end{subfigure}
\captionsetup{justification=centering,margin=1cm}
\caption{\label{fig:knng} Existing synchronization approaches for multiple server applications}
\end{figure}
\end{document}

Latex subsection remove dotted lines [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Please suggest how can I remove dotted lines from the technical skills sections
Link to error image
\section{TECHNICAL SKILLS}
\vspace{-4mm}
\begin{minipage}[t]{.6\textwidth}
\subsection{Languages}
\paragraph{Proficient:}
\textbullet{} Test \textbullet{} Test \textbullet{} Test \textbullet{} Dart \textbullet{} Test \\
\location{Familiar / Studying:}
\textbullet{} Test \textbullet{} Test \\
\end{minipage}
Find code here: https://www.overleaf.com/read/wxwpscypyhrc
Thanks,
Several problems:
\location is not defined. You must either define it or not use it. Ignoring the error messages is not an option
In this particular documentclass \paragraph is not defined. You must either define it or not use it. Ignoring the error messages is not an option
If you don't supply the required information, you must not use \makecvtitle. In particular an empty address causes an error message. Ignoring the error messages is not an option
to remove the dotted lines in the subsections you can use \renewcommand*{\subsectionrule}{}
the \vspace*{-12mm} in the preamble does nothing useful
\documentclass[11pt,a4paper,roman]{moderncv}
% possible options include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')
% modern themes
\moderncvstyle{banking}
\moderncvcolor{black}
% color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
\usepackage[utf8]{inputenc}
\usepackage{fontawesome}
\usepackage{tabularx}
\usepackage{ragged2e}
\usepackage[scale=0.85]{geometry}
\usepackage{multicol}
\usepackage{import}
\vspace*{-12mm}
\name{Test}{Test}
\address{}{}{}
\newcommand*{\customcventry}[7][.25em]{
\begin{tabular}{#{}l}
{\bfseries #4}
\end{tabular}
\hfill% move it to the right
\begin{tabular}{l#{}}
{\bfseries #5}
\end{tabular} \\
\begin{tabular}{#{}l}
{\itshape #3}
\end{tabular}
\hfill% move it to the right
\begin{tabular}{l#{}}
{\itshape #2}
\end{tabular}
\ifx&#7&%
\else{\\%
\begin{minipage}{\maincolumnwidth}%
\small#7%
\end{minipage}}\fi%
\par\addvspace{#1}}
\newcommand*{\customcvproject}[4][.25em]{
% \vfill\noindent
\begin{tabular}{#{}l}
{\bfseries #2}
\end{tabular}
\hfill% move it to the right
\begin{tabular}{l#{}}
{\itshape #3}
\end{tabular}
\ifx&#4&%
\else{\\%
\begin{minipage}{\maincolumnwidth}%
\small#4%
\end{minipage}}\fi%
\par\addvspace{#1}}
\setlength{\tabcolsep}{12pt}
\newcommand{\location}[1]{#1}
\newcommand{\paragraph}[1]{#1}
\renewcommand*{\subsectionrule}{}
\address{12 somestreet}{3456 somecity}
\begin{document}
\makecvtitle
\vspace*{-11mm}
\begin{center}
\begin{tabular}{ c c c c }
\faEnvelopeO\enspace \href{mailto:test#gmail.com}{\underline{test#gmail.com}} & \faGithub\enspace \href{https://github.com/}{\underline{test-name}} & \faMobile\enspace 12345678900 & \faLinkedinSquare\enspace \href{https://www.linkedin.com/}{\underline{test-test}} \\
\end{tabular}
\end{center}
\section{EDUCATION}
{\customcventry{1 Jan 1011}{Position}{University}{10 CGPA}{}{}}
{\customcventry{1 Jan 1011}{Position}{University}{10 CGPA}{}{}}
\section{PROJECTS}
{\customcvproject{Test name}{1 Jan 1011}
{\begin{itemize}
\item Test
\item Reverse engineered obfuscated Java using a decompiler and reflection
\end{itemize}
}
}
{\customcvproject{Test name}{1 Jan 1011}
{\begin{itemize}
\item Test
\item Reverse engineered obfuscated Java using a decompiler and reflection
\end{itemize}
}
{\customcvproject{Test name}{1 Jan 1011}
{\begin{itemize}
\item Test
\item Reverse engineered obfuscated Java using a decompiler and reflection
\end{itemize}
}
}
\section{EXPERIENCE}
{\customcventry{Jan 1011}{Position}{Company}{US}{}
{\begin{itemize}
\item Designed and built the first version of infrastructure code base which teams’ monthly expenses on AWS servers by 100 thousand dollars.
\end{itemize}
}
}
{\customcventry{Jan 1011}{Position}{Company}{US}{}
{\begin{itemize}
\item Designed and built the first version of infrastructure code base which teams’ monthly expenses on AWS servers by 100 thousand dollars.
\end{itemize}
}
}
{\customcventry{Jan 1011}{Position}{Company}{US}{}
{\begin{itemize}
\item Designed and built the first version of infrastructure code base which teams’ monthly expenses on AWS servers by 100 thousand dollars.
\end{itemize}
}
}
{\customcventry{Jan 1011}{Position}{Company}{US}{}
{\begin{itemize}
\item Designed and built the first version of infrastructure code base which teams’ monthly expenses on AWS servers by 100 thousand dollars.
\end{itemize}
}
}
\section{TECHNICAL SKILLS}
\vspace{-4mm}
\begin{minipage}[t]{.6\textwidth}
\subsection{Languages}
\paragraph{Proficient:}
\textbullet{} Test \textbullet{} Test \textbullet{} Test \textbullet{} Dart \textbullet{} Test \\
\location{Familiar / Studying:}
\textbullet{} Test \textbullet{} Test \\
\end{minipage}
\begin{minipage}[t]{.5\textwidth}
\subsection{Spoken \& Written}
\location{Fluent:} \textbullet{} Test \textbullet{} Test \textbullet{} Test \\
\location{Learning:} \textbullet{} Test \\
\end{minipage}
\begin{minipage}[t]{.6\textwidth}
\subsection{Frameworks}
\textbullet{} Test \textbullet{} Test \textbullet{} Test \textbullet{} Test \\
\end{minipage}
\begin{minipage}[t]{.5\textwidth}
\subsection{Software / Version Control}
\textbullet{} Test \\
\end{minipage}
\vspace{-3mm}
\section{AWARDS AND ACHIEVEMENTS}
\begin{minipage}{\maincolumnwidth}%
\small{
\begin{itemize}
\item Test
\item Test
\item Test
\item Test
\item Test
\item Test
\item Test
\end{itemize}}%
\end{minipage}%
}
\end{document}

How do I convert markdown equations to pdf using pandoc

I have a markdown document with lots of equations (mathjax I think) which renders fine with the application Marked 2. When I try to convert it to pdf with pandoc to create the bibliography, I get an error.
For example, with
\\[ \mu_{s,h,d,y} = \left\{
\begin{array}{1 1}
\omega_{s,h,d,y} + \delta_{s}(t_{s,h,d-1,y} - \omega_{s,h,d-1,y}) & \quad \text{for $t_{s,h,d-1,y}$ is real} \\
\omega_{s,h,d,y} & \quad \text{for $t_{s,h,d-1,y}$ is not real}
\end{array} \right.
\\]
It looks like
However, when I run
pandoc -H format.sty -V fontsize=12pt --bibliography northeast_temperature_refs.bib --csl=american-geophysical-union.csl northeast_temperature_ms2.md -o northeast_temperature_ms.pdf --mathjax
with or without --mathjax I get the following error
! Missing $ inserted.
<inserted text>
$
l.268 \textbackslash{}{[} \mu
pandoc: Error producing PDF from TeX source
If I try to use $$ instead of \\[ like:
$$
\mu_{s,h,d,y} = \left\{
\begin{array}
\omega_{s,h,d,y} + \delta_{s}(t_{s,h,d-1,y} - \omega_{s,h,d-1,y}) & \quad \text{for $$t_{s,h,d-1,y}$$ is real} \\
\omega_{s,h,d,y} & \quad \text{for $$t_{s,h,d-1,y}$$ is not real}
\end{array} \right.
$$
I get the following error:
! LaTeX Error: Illegal character in array arg.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.278 \begin{array}{1 1}
pandoc: Error producing PDF from TeX source
This is my first time ever trying to write equations outside a canned program so any help would be appreciated. I thought I was doing such a good job when I did quick checks with Marked but apparently it doesn't work with pandoc the way I have it.
I am on a Mac with Yosemite and have MacTex installed.
Marked uses a different markdown processor under the hood (MultiMarkdown) than Pandoc, which has different syntax for equations (\\[ \\] instead of $$). If you want to write in a single format for both Marked previewing/HTML and pandoc PDF/anything else output, you can change Marked's processor to Pandoc (directions here). This way you can use $$ syntax for everything.
I think that pandoc doesn't cover the array command, as your command doesn't work for me in an IPython notebook. However, replacing the array command with a cases statement does work for me:
\\[ \mu_{s,h,d,y} = \begin{cases}
\omega_{s,h,d,y} + \delta_{s}(t_{s,h,d-1,y} - \omega_{s,h,d-1,y}) & \quad \text{for $t_{s,h,d-1,y}$ is real} \\
\omega_{s,h,d,y} & \quad \text{for $t_{s,h,d-1,y}$ is not real}
\end{cases}
\\]

Microwind does not create my equation in compile

I user microwind and try to build the mask from the compile one line choice but it wont let me the equation simplified is ~A&(~B|~C|D)
Try bisecting the equation into small parts and then try.
part1
Get a layout of only ~B | ~C | D . save that as module1
part2
Import module1 and go for its implementation for ~A & *module1*
Follow the D flip Flop tutorial and post the efforts done.

LaTeX \newcommand \par issue

When I assign a new command and call it at the beginning of a \par the space between the variable text and next word is missing.
\newcommand{\testcmd}{This is a test}
\par \testcmd foobar.
Will be rendered as:
This is a testfoobar.
\par foo \testcmd bar.
Renders fine as: foo This is a test bar.
Anyone come across this before and have a solution?
Thanks
I do not know the exact thing which is going on here but there are several ways to get that space back:
\newcommand{\testcmd}{This is a test } % <- space before closing brace
par \testcmd{} foobar % <- note {}
The most verbose but the most robust way too:
\usepackage{xspace}
\newcommand{\testcmd}{This is a test\xspace}
Actually a much simpler answer would be to:
\newcommand{\testcmd}{This is a test}
\par \testcmd \ foobar.
Notice the extra "\ " before foobar (slash and space). No extra package needed. It is the same as the most common method for things like:
Mr.\ Smith
etc.\ and
Proc.\ Amer.\ Math.\ Soc.