Latex page issues - latex

\documentclass{article}
\usepackage{geometry}
\usepackage{amsthm, amsmath, amssymb}
\usepackage{anyfontsize}
\newgeometry{vmargin={15mm}, hmargin={12mm}}
\makeatletter
\newcommand{\mathleft}{\#fleqntrue\#mathmargin0pt}
\newcommand{\mathcenter}{\#fleqnfalse}
\makeatother
\begin{document}
\fontsize{18}{21.6}
\mathleft
\begin{gather*}
8x^2+10x-3=0\\\\
8x^2-2x+12x-3=0\\\\
2x(4x-1)+3(4x-1)=0\\\\
(2x+3)(4x-1)=0\\\\
x=-\frac{3}{2}\;or\;\frac{1}{4}\\\\\\\\\\\\
-7x^2-4x+3=0\\\\
-7x^2-7x+3x+3=0\\\\
-7x(x+1)+3(x+1)=0\\\\
(3-7x)(x+1)=0\\\\
x=\frac{3}{7}\;or\;-1\\\\\\\\\\\\
x^2+4=8x-8\\\\
x^2-8x+12=0\\\\
x^2-2x-6x+12=0\\\\
x(x-2)+-6(x-2)=0\\\\
(x-6)(x-2)=0\\\\
x=2\;or\;6
\end{gather*}
\end{document}
When I run this code I get a pdf with the first page blank and some of the actual text outside the page. How can I fix it so that it does not leave a blank page and the text stays in the page so that if it can't fit it creates a new page and puts the text there. Both of these issues disappear if the text between begin gather and end gather is small, but how do I make it work regardless of the amount of text or size of the font? The question is similar to this but I am not using the xcolor package or counters. To get the pdf I am using the TexShop application installed from mactex.

Related

latex hyperref form choice menu finding a way to make the box of the list for choosing wider than the field of the ChoiceMenu

I'm using MikTeX LaTeX and I want to create a form with a choice menu of the hyperref package. I was wondering if there is a way to make the box of the list for choosing wider than the field of the choice menu? Does someone know a way? The approach present here includes that the width of the choice menu field specified in the parameter is kept, even though the text of the items in the list are much longer.
Here is a working minimal working example:
\documentclass[landscape]{scrartcl}
\usepackage[top=2cm, bottom=3cm, left=2cm, right=2cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\newcommand{\hide}[1]{\texorpdfstring{\makebox[0pt]{#1}}{#1}}
% begin document
\begin{document}
\begin{Form}
\begin{tabular}{l}
\mbox{\ChoiceMenu[combo, name=test_choice, width=4cm]{Choice field:}{short 1, \hide{this is a very long sentence leading to a much greater field width than specified}}}
\end{tabular}
\end{Form}
\end{document}
The drop down to select one of the choices is not done by latex, but by your pdf viewer. Use a suitable viewer to see the choices in full width.
Preview.app:
Skim.app:

Fancyhdr does not show page number

I am struggling with fancyhdr package. Specifically, with the following:
\fancypagestyle{mystyle}{
\fancyhead{}
\fancyfoot[C]{\thepage}
\setlength{\headheight}{180pt}
\chead{\includegraphics[width=8cm]{x.png}}
}
The header shows up correctly, but the page number is not shown at all, when using \thispagestyle{mystyle}. Could someone please help me?
In none of the standard latex classes is enough room to accommodate an header of 180pt height without pushing the footer off the page. You can see that the page number is actually printed if you reduce the height of the text area:
\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\fancypagestyle{mystyle}{
\fancyhead{}
\fancyfoot[C]{\thepage}
\setlength{\headheight}{180pt}
\chead{\includegraphics[width=8cm]{example-image-duck}}
}
\usepackage[includeheadfoot,height=15cm]{geometry}
\begin{document}
\thispagestyle{mystyle}
test
\end{document}

Koma scrbook seems not to include BCOR

The proof copies of a book laid out with KOMA scrbook show that the inner margins are too narrow. I had BCOR set to 10mm and want to increase them, but my experiments with BCOR set to 20mm show that the layout is the same independent what BCOR value I set. Here my MWE:
\documentclass{scrbook}
\KOMAoptions{paper=
128.5mm:198.4mm, %(5,06" x 7,91") %ziel
BCOR=20mm,
twoside,
headinclude=false, footinclude=false,
headings=normal,
titlepage=true,
% draft=true,
DIV=9, %ziel kleines buch
fontsize=12pt,
}
\usepackage[german]{babel}
\usepackage{lipsum}
\usepackage{geometry}
\usepackage[a4,axes,cross,pdftex,center]{crop}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\part{ Philosophie}
some text
\lipsum
\lipsum
\end{document}
What is wrong?
My real question is: how can I just move the text area on both pages to the outside (i.e. making the gutter wider) without changing the text area size (and thus preserve line breaks)?
I found a hint in some other questions answered before and the problem was caused by the interaction between the KOMA script and the geometry package. Using the geometry package recalculates the page layout and overwrites the one calculated by scrbook including the BCOR value. This can be avoided when adding the option pass to geometry as in
`\usepackage[pass]{geometry}`.
In general the interaction between the layout calculated by KOMAscript and other package can lead to surprises. The discussion in https://tex.stackexchange.com/questions/182821/div-and-bcor-setting-in-koma-best-practices/183839 is very useful.

How to make a hyperlink navigate to the top of the figure in LaTeX when using hyperref?

I have a LaTeX document with a figure and references to it:
\begin{figure}
...
\caption{...}
\label{fig:1}
\end{figure}
\ref{fig:1}
I use the hyperref package to get hyperlinks in the resulting PDF.
However the link to the figure navigates to the caption leaving the figure itself out of the view. How can I make it navigate to the start of the figure instead without moving the caption to the top?
Add this in your preamble
\usepackage{hyperref}
\usepackage[all]{hypcap} %for going to the top of an image when a figure reference is clicked
Make sure that the \usepackage[all]{hypcap} is written after the hyperref package is imported.
To previous comment:
\usepackage{hyperref}
\usepackage{caption}
is slightly better than \usepackage[all]{hypcap} because when you use e.g. figure without captions there won't be a compilation problem. The caption package by default sets option
hypcap=true
anchoring hyperlinks to the beginning of an environment.
\usepackage{hyperref}
\usepackage{caption}
Using this is a better idea than \usepackage[all]{hypcap}.

latex template or example for personal statement

I am writing a personal statement in latex. I don't want the big margin at the top of the page not big title taking a lot of space. I just like to make the layout compact but still clearly spaced with title, name and other necessary information, since there may be restriction on the number of pages. One example would be http://www.hsc.unt.edu/education/CIM/Documents/PS-Sample2_000.pdf. I wonder where to find some good latex templates or examples?
Thanks and regards!
I would use the geometry package to establish the desired margins. To get the margins in your sample document, try:
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
Your next requirement was to fix the title block. LaTeX uses the internal command \#maketitle to format the title block. You can redefine this as you like. To achieve the same title block style as in the sample document, use:
\usepackage[svgnames]{xcolor}% provides colors for text
\makeatletter% since there's an at-sign (#) in the command name
\renewcommand{\#maketitle}{%
\begin{center}
\parskip\baselineskip% skip a line between paragraphs in the title block
\parindent=0pt% don't indent paragraphs in the title block
\textcolor{red}{\bf\#title}\par
\textbf{\#author}\par
%\#date% remove the percent sign at the beginning of this line if you want the date printed
\end{center}
}
\makeatother% resets the meaning of the at-sign (#)
The \#title, \#author, and \#date commands will print the title, author, and date. You can use whatever formatting commands you like to set the text in bold, different colors, etc.
Put all of the above commands in the preamble of the document. The preamble is the space between \documentclass and \begin{document}.
\documentclass{article}
% this is the preamble
% put all of the above code in here
\title{Personal Statement}
\author{Tim}
\begin{document}
\maketitle% prints the title block
Emergency medicine has always been a passion of mine\ldots
\end{document}
Attempt #1: I've used the following style file, which I call cramp2e, for similar purposes. It is probably not right for you, but have a look:
\oddsidemargin -1cm
\evensidemargin -2cm
\topmargin 1cm
\textheight 24cm
\textwidth 19cm
\headheight 0cm
\headsep .7cm
\footskip .7cm
\parskip .2cm
\paperheight 25cm
\setlength\voffset{-.33in}
\setlength\hoffset{-.25in}
Any good?
Postscript This is for A4 size paper.
A slightly less LaTeX-ey solution would be to not use the \maketitle command. A couple of times I've simply used this as my title(marginsize helps too).
Set up smaller margins:
\documentclass{article}
\usepackage{anysize}
\marginsize{1cm}{1cm}{1cm}{1cm}
(EDIT: 1cm might be even better..)
Minimal title:
\begin{document}
\begin{center}
\section*{My Document Title}
\today
\end{center}
% content goes here
\end{document}
The result looks something like:

Resources