Solving Latex Problems Quickly

  • LaTeX
  • Thread starter Zurtex
  • Start date
  • Tags
    Latex
In summary: Caption}% \label{fig:label}%\end{figure}%\begin{table}[htbp]% \center% \begin{tabular}{|c|c|c|c|c|}% \hline% $z$ & $s(z)$ & $z$ & $s(z)$ & $z$ \\% \hline% 0 & 0 & 5 & 5 & 10 \\% 1 & 0 & 6
  • #1
Zurtex
Science Advisor
Homework Helper
1,120
1
Hey

I'm wanting to write up a small paper so I've installed various Latex things on my computer, I have the full Miktex package and I have TexnicCenter, I want to write something like:

[tex]\text{For all x, y} \, \in \mathbb{N}[/tex]

But the mathbb bit doesn't seem to be working, I can get mathrm and mathbf, but these aren't the fonts I want, can anyone help me please.
 
Physics news on Phys.org
  • #2
make sure you've got

\usepackage{amssymb}

in the preamble, and plenty of other pckages.

google to find out which package provides mathbb ot make sure I've got it right.
 
  • #3
You could use Open Office Maths. Its quick, easy and free. http://www.openoffice.org/"
 
Last edited by a moderator:
  • #4
Focus said:
You could use Open Office Maths. Its quick, easy and free. http://www.openoffice.org/"
But quite painful to do full maths papers, I've found it useful to do maths homework but anything like papers or coursework it just doesn't have the functionality for.

Plus it doesn't actually have all the symbols I require most the time and I end up depending on Mathematica fonts.

Anyway thanks matt, I think I've about worked it out but I spotted a mistake in my proof so I've been trying quite desperately to patch it up.
 
Last edited by a moderator:
  • #5
Hey Zurtex, you can try http://www.dessci.com/en/products/mathtype/
MathType is quiet easy to learn and
has several advanced functions.

Mathtype can convert to [tex]\LaTeX[/tex], MathML,...or you can just inline your equations as simple images. It is compatible with Microsoft Word, and you can later distill your documents into PDF files.
 
  • #6
As a bit of inspiration, here are an old .sty file and a template i used some time ago. place both files quoted below in the same directory and compile. works fine with my MikTeX (do note that not all enviroments in the style file work!, but the template compiles fine).


First here is "projects.sty":
Code:
%------------------------------------------------------------------------------
% Contents: Commands, package loading and page settings
% Id: projects.sty
%------------------------------------------------------------------------------
% By Bo Lind
%------------------------------------------------------------------------------
\ProvidesPackage{projects}

%--------------------------------------------------------
% Page setup and page style
%--------------------------------------------------------
\setlrmarginsandblock{1.5in}{0.8in}{*} % Sets the inner and outer margins
\setulmarginsandblock{1in}{1.3in}{*} % Sets the top and bottom margins
%\setmarginnotes{0.2in}{1.7in}{0.3in}

\checkandfixthelayout

\setlength{\droptitle}{3cm} % Sets the length before the title
\aliaspagestyle{title}{empty} % no page number on the front page

\newcommand{\published}[1]{
  \gdef\puB{#1}
}
\newcommand{\puB}{}
\renewcommand{\maketitlehookd}{
  \vskip 30em
  \begin{center}
    \puB
  \end{center}
}
\newcommand{\subtitle}[1]{
  \gdef\suB{#1}
}
\newcommand{\suB}{}
\renewcommand{\maketitlehookb}{
  \begin{center}
    \LARGE\scshape\suB
  \end{center}
}

\pretitle{\begin{center}\Huge\bfseries}
\posttitle{\par\end{center}\vskip 0.5em}
\preauthor{\begin{center}
    \large\bfseries \vskip 8em%
    \begin{tabular}[t]{c}}
\postauthor{\end{tabular}\end{center}}
\predate{\begin{center}\large}
\postdate{\par\end{center}}

\cftsetindents{chapter}{1.5em}{6.0em}
%\cftsetindents{subsection}{5.5em}{6.0em}
\renewcommand{\cftchapterleader}{}
\renewcommand{\cftchapterpresnum}{\chaptername\ }

\maxsecnumdepth{subsection}
\setsecnumdepth{subsection}
\maxtocdepth{subsection}

\captiondelim{. }
\captionnamefont{\small\scshape}
\captiontitlefont{\small}

%\tightlists % suppress space between list entries

\pagestyle{plain}
\renewcommand{\baselinestretch}{1.1} % 1.1 line-distance

\usepackage[danish]{varioref} % More inteligent refrences.
\usepackage[round]{natbib} % Use author-date citation.

%--------------------------------------------------------
% Fonts and layout
%--------------------------------------------------------

\usepackage[latin1]{inputenc} % Input encoding. Makes it possible to type special characters.
\usepackage[danish]{babel} % Danish hyphenation and changes Figures, Chapter etc to Danish.
\usepackage{lmodern} % Makes the Latin Modern fonts the default for LaTeX.
\usepackage[T1]{fontenc} % Standard font encoding.
\usepackage{textcomp} % TS1-encoding symbols.

\usepackage{amssymb}
\usepackage{amsfonts} % Better math fonts.
\usepackage{amsmath} % Provides various features to facilitate writing math formulas and to improve the typographical quality of their output. 

\usepackage{bm} % Blackboard Bold font.

\usepackage{url} 
\usepackage{units} % To typeset units use the command \unit{m^2}.

%--------------------------------------------------------
% Enviroments, theorems etc.
%--------------------------------------------------------

\usepackage[amsmath,thmmarks]{ntheorem}


\theoremstyle{plain}
\theoremheaderfont{\normalfont\bfseries}
\theorembodyfont{\itshape}
\newtheorem{thm}{Sætning}[chapter]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{kor}[thm]{Korollar}
\newtheorem{eks}[thm]{Eksempel}

\theorembodyfont{\normalfont}
\newtheorem{defn}[thm]{Definition}
\newtheorem{exerc}{\O{}velse}[chapter]

\theoremstyle{nonumberplain}
\theoremheaderfont{\normalsize\normalfont\scshape}
\theorembodyfont{\upshape}
\theoremsymbol{\rule{1ex}{1ex}}
\newtheorem{proof}{Bevis}

\newcommand{\refthm}[1]{S\ae{}tning~\ref{#1}}
\newcommand{\reflemma}[1]{Lemma~\ref{#1}}
\newcommand{\refcor}[1]{Korollar~\ref{#1}}
\newcommand{\refdefn}[1]{Definition~\ref{#1}}
\newcommand{\refexerc}[1]{\O{}velse~\ref{#1}}
\newcommand{\refexample}[1]{Eksempel~\ref{#1}}

%--------------------------------------------------------
% Useful commands
%------------------------------------------------------------------------- Misc

\newcommand{\itemMath}[1]{\raisebox{-\abovedisplayshortskip}{%
 \parbox{0.75\linewidth}{%
 \[#1\]}}}


%---------------------------------------------------------- Figure preferences:
% The following four numbers are to make TeX more likely to put figures on the
% same page rather than on a separate figures page. Can tinker with these, but
% make sure floatpagefraction<topfraction.
% Values recommended by the web page I found were 0.15, 0.85, 0.65, 0.60. The 
% default values are 0.2, 0.7, 0.3, 0.5
%\renewcommand{\textfraction}{0.2}
%\renewcommand{\topfraction}{0.7}
%\renewcommand{\bottomfraction}{0.3}
%\renewcommand{\floatpagefraction}{0.5}
%---------------------------------------------------------------------- Figures
\newcommand\tabcaption{\def\@captype{table}\caption}
\newcommand\figcaption{\def\@captype{figure}\caption}

\usepackage[dvips]{graphicx}
\usepackage{sidecap}
\usepackage{psfrag}

\newlength{\marginwidth} % Let a length to use for margin figures
\setlength{\marginwidth}{\marginparwidth} 
\addtolength{\marginwidth}{\marginparsep}

% \begin{adjustwidth*}{0in}{-\marginwidth} ... \end{adjustwidth*} needs to be 
% placed OUTSIDE the table environment to work, while it can be placed INSIDE 
% in the figure enviroment. (In memoir).

\newcommand{\fig}[3]{ %\fig{filename}{caption}{optional commands}
  \begin{figure}[htbp]
    #3
    \center
    \includegraphics{#1}
    \figcaption{#2} %
    \label{fig:#1} %
  \end{figure}
}

\newcommand{\sidefig}[3]{ %\sigfig{filename}{caption}{optional commands}
  \begin{SCfigure}[][htbp]
    #3
    \includegraphics[width=0.5\textwidth]{#1}
    \caption{#2} %
    \label{fig:#1} %
  \end{SCfigure}
}

%---------------------------------------------------------------------- Physics

\newcommand{\Hamiltonian}{\mathcal{H}}
\newcommand{\Lagrangian}{\mathcal{L}}
\newcommand{\mean}[1]{\langle #1 \rangle}

%------------------------------------------------------------------------- Sets
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}

\newcommand{\emtyset}{\varnothing}

\newcommand{\set}[1]{\ensuremath{\{#1\}}} 
\newcommand{\suchthat}{\bigm|}
\newcommand{\union}{\cup}
\newcommand{\Union}{\bigcup}
\newcommand{\intersection}{\cap}
\newcommand{\Intersection}{\bigcap}

% Other set commands:
% \complement
% \setminus
% \in

\newcommand{\map}[3]{\ensuremath{#1\colon #2\to #3}}

%---------------------------------------------------------------------- Vectors
\renewcommand{\vec}[1]{\bm{\mathrm{#1}}}
\newcommand{\uvec}[1]{\vec{e}_{#1}}

\newcommand{\ket}[1]{\, |#1\rangle}
\newcommand{\bra}[1]{\langle #1 |\,} 

\newcommand{\rr}{\vec{r}}
\newcommand{\vv}{\vec{v}}
\newcommand{\aaa}{\vec{a}}

\newcommand{\zero}{\ensuremath{\mathbf{0}}}

%------------------------------------------------------------------ Derivatives
\newcommand{\D}[2]{\frac{d #1}{d #2}}
\newcommand{\DD}[2]{\frac{d^2 #1}{d #2^2}}
\newcommand{\PD}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\PDD}[2]{\frac{\partial^2 #1}{\partial #2^2}}

%-------------------------------------------------------------------- Integrals
\newcommand{\oiint}{\int\hspace{-2ex}\int\hspace{-3.04ex}\bigcirc~}
\renewcommand{\iint}{\int\hspace{-1.5ex}\int}
\renewcommand{\iiint}{\int\hspace{-1.5ex}\int\hspace{-1.5ex}\int}

here is template.tex
Code:
\documentclass[a4paper,10pt,twoside,article]{memoir}

\usepackage{projects}

\title{Title of the project}
\subtitle{Subtitle}
\author{xxxxx xxxxxx \textnormal{, \textsc{cpr no. xxxxxx}}}
\date{\today}
\published{Fysisk Institut, Syddansk Universitet}
%\published{Physics Department\\ University of Southern Denmark}

%--------------------------------------------------------------\begin{document}
\begin{document}
\frontmatter

\maketitle
\newpage

%\tableofcontents*
%\listoffigures*
%\listoftables*
%\newpage

%\begin{abstract}
%  Max en side der sammenfatter, hvad rapporten handler om og hvilke konklusioner, der drages i rapporten
%\end{abstract}
%\newpage

\mainmatter
%------------------------------------------------------------chapter:Indledning
\chapter{Indledning}\label{cha:indledning}

\[
\forall x,y\in\N
\]

\appendix


\bibliography{mybiblio}
\bibliographystyle{plainnat} 

%In \cite{qriffiths:quantum} ... 

\end{document}
 
  • #7
bomba923 said:
Hey Zurtex, you can try http://www.dessci.com/en/products/mathtype/
MathType is quiet easy to learn and
has several advanced functions.

Mathtype can convert to [tex]\LaTeX[/tex], MathML,...or you can just inline your equations as simple images. It is compatible with Microsoft Word, and you can later distill your documents into PDF files.
Same problem with Mathtype as I have with open office, just doesn't work for writting lots of stuff. Mathtype is even worse really because of its wysiwyg interface.

Thanks Triss, I'll try it out :smile:
 

Related to Solving Latex Problems Quickly

1. What are the most common Latex problems that need to be solved quickly?

The most common Latex problems that need to be solved quickly include errors in the code, issues with formatting and spacing, missing packages, and incompatible packages.

2. How can I quickly identify and fix errors in my Latex code?

To quickly identify and fix errors in Latex code, it is important to use a text editor with syntax highlighting and error detection, such as TeXworks or TeXstudio. Additionally, using the "log file" feature in Latex can help pinpoint the source of errors.

3. What are some tips for formatting and spacing in Latex to avoid problems?

To avoid problems with formatting and spacing in Latex, it is important to use consistent formatting throughout the document, use the proper commands (such as \vspace and \hspace) for spacing, and pay attention to details like line breaks and paragraph indentations. It can also be helpful to use templates or style files for a uniform layout.

4. How can I quickly find and install missing or incompatible packages in Latex?

To quickly find and install missing or incompatible packages in Latex, you can use the "Package Manager" feature in your Latex distribution. This will allow you to search for and install the necessary packages for your document.

5. Is there a way to prevent Latex problems from occurring in the first place?

While some Latex problems are inevitable, there are steps you can take to prevent them from occurring. This includes using a consistent and organized document structure, keeping track of packages and updates, and carefully proofreading your code before compiling. It can also be helpful to reference resources such as the Latex wikibook or forums for troubleshooting tips and best practices.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
11K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
298
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
Back
Top