New answers tagged

4

Here is a solution based on atbegshi and answers packages. The idea is to use answers that write contents of theorem, lemma to an external file (mtfile.tex), discard all pages (all contents of the main file http://tex.stackexchange.com/a/267555/71471) and then use the external file to output only theorems. We use a newif test \onlytrue for only theorem and ...


0

Another way to include mathematica packages into latex is to use this package mma.sty by Manuel Kauers. With \usepackage{mma} in the preamble one can do a lot. I find it really amazing. I normally enclose it in mdframed environment which I think is pretty cool. See the image below: There are also example on how one can use the package in the style ...


2

By default footnotes start at the end of the text block so if the page is not full the space required to pad the page comes below the notes. This seems natural enough to me but if you want the padding space to come between the text block and the footnotes then you can use \usepackage[bottom]{footmisc}


1

Assuming that you do not need the star versions of the \section et al: \documentclass[12pt]{report} \usepackage{csuf-thesis} \usepackage{hyperref} \hypersetup{colorlinks=false} \nocopyright \setcounter{secnumdepth}{0} \makeatletter \def\section#1{\@startsection{section}{1}{\z@} {-7ex}{2ex \@plus 0.01ex} {\centering\ssp}{\underline{#1}}} ...


2

you had defined a fancy page style but commented out the use of that style, and even if it were uncommented you had over-written it multiple times with the empty and plain styles. Also there were several error and unclosed groups reported. \documentclass[12pt, oneside, a4paper, leqno]{report} \linespread{1.5} \usepackage{geometry} ...


3

Already many good and diverse answers. I am adding one for another completely expandable macro. Complete expandability's constraint saves us from having to cook up names for temporary macros. In the code below, one could make \Duration@i recursive and obtain in this way an expandable macro for conversion to sexagesimal notation, with arbitrary big integers ...


0

For writing code you can use the package listings (Documentation: http://texdoc.net/texmf-dist/doc/latex/listings/listings.pdf)


6

(Updated the Lua code after the OP clarified that rounding rather than truncation should be applied to the seconds in the duration calculations.) Here's a LuaLaTeX-based solution. The preamble sets up both a Lua function named formatted_duration and a TeX macro named \fdur. The TeX macro takes one argument (the duration in seconds and fractions of a ...


7

Here is a solution using apnum package: \input apnum \def\duration#1{{\apFRAC=0 % "/" means integer division \def\zero{0}% \evaldef\S{#1/1}% \S: number of seconds (without fraction part) \evaldef\H{\S/3600}% \H: number of hours \evaldef\Hrest{\S - 3600*\H}% \Hrest: number of seconds without hours ...


8

You can do it with expl3 and its fp module. \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\duration}{m} { \didou_duration:n { #1 } } \fp_new:N \l_didou_duration_hrs_fp \fp_new:N \l_didou_duration_min_fp \fp_new:N \l_didou_duration_sec_fp \cs_new_protected:Nn \didou_duration:n { \fp_compare:nTF { #1 < 60 } {% ...


1

Very basic, not much can be done here. Otherwise customize the itemize list with enumitem package to provide other typesetting facilities. \documentclass{article} \begin{document} \begin{description} \item Foo We have something to say here \item Foobar We have to say something differently here \end{description} \end{document}


9

Using \pgfmathparse is problematic for this question because integer division fails with a "Dimension too large" error around 16500. In particular, without some additional care, any solution using \pgfmathparse will not be able to cope with the OP's example of 18249 because this number is too large. For large (integer) calculations the xint family of ...


7

As pointed out by Andrew, pgfmath cannot by default cannot handle numbers larger than 16383.99999; however, the pgfmath library can handle floating point numbers thereby allowing (nearly) arbitrarily large numbers to be handled. The limitation then becomes the precision, and ultimately certain digits are truncated. Floating Point Version This function ...


5

The first equation below features the frational term shifted down so that the fraction bar is at the same height as the lower horizontal stroke of the summation symbol. The second equation features a more standard look. Speaking for myself, I'd go with the look of the second equation. \documentclass{article} \usepackage{amsmath,amsfonts} ...


5

A simple fix for these annoying little size mismatchs in otherwise similar formulas is to use \vphantom : Since $\foo{B} = \foo{\sum_j b_jB_j}$ and $\foo{C} = \foo{\sum_{i\vphantom{j}} c_{i\vphantom{j}} C_{i\vphantom{j}}}$ by definition. One \vphantom should be sufficient of course, in the present case, the one of the \sum operator as its subscript is ...


1

Don't change \footnotesize... We need to change three components to address your three requirements. Change the footnote number. For this we need to adjust \@makefnmark, which starts out like this (from latex.ltx): \def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}} We can replace the insertion of \normalfont with ...


4

Another possible solution is having a minimum size automatically: \documentclass{minimal} \newcommand{\minsize}{\vrule width 0pt height 1.5ex depth 1ex\relax} \newcommand{\foo}[1]{\left[\minsize #1\right]} \begin{document} Since $\foo{B} = \foo{\sum_j b_jB_j}$ and $\foo{C} = \foo{\sum_i c_i C_i}$ by definition. Now it will scale up --- but not down: ...


10

The different height of the brackets is caused by the descender of the letter j compared to i. One way: Use k instead of j (or any other letter without descender) Or perhaps using \bigl[ and \bigr] is an option (or if scaling isn't an issue \big[ and \big]?) \documentclass{article} \usepackage{amsmath} \newcommand{\foo}[1]{\bigl[#1\bigr]} \begin{document} ...


0

The following code does everything except aligning the "left column" correctly. \documentclass[11pt]{article} \usepackage{sectsty} \usepackage{amsmath} \sectionfont{\fontsize{11}{15}\selectfont} \usepackage{xcolor} \usepackage{graphicx} \usepackage[usestackEOL]{stackengine} \usepackage[top=1cm, bottom=1cm, left=1cm, right=1.5cm]{geometry} \begin{document} ...


6

You're using the syntax of eqnarray, and are forgetting to load amsmath; compiling your example produces scores of errors and the output is almost arbitrary. \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{amsmath} \begin{document} \begin{align*} \sum_{i=1}^{k+1} i^{3} &= \biggl(\sum_{i=1}^{n} i^{3}\biggr) + i^3\\ &= ...


3

\documentclass{article} \usepackage[T1]{fontenc} \begin{document} \raggedright \texttt{\detokenize{C_n = {(z_1, ..., z_n) \in R^n : z_i \neq z_j \forall i \neq j}. I want to prove that pi_k(C_n) = 1 \forall k > 1. any ideas?}} \end{document}


1

Here's another enumitem approach, but automatic switching to \ttfamily using before={\ttfamily}. \documentclass[11pt]{report} \usepackage[utf8]{inputenc} \usepackage{textcomp} \usepackage[T1]{fontenc} \usepackage{enumitem} \newlist{itemtt}{itemize}{1} \setlist[itemtt,1]{label={\textbullet},before={\ttfamily}} \begin{document} \begin{itemtt} \item This ...


1

something like this : \documentclass{article} \usepackage{enumitem} \begin{document} \ttfamily \begin{itemize}[label=\textbullet] \item item1 \item item2 \end{itemize} \end{document}


3

Independent of the editor being used, we have latexindent by Chris (cmhughes). This should do a good job in beautifying the latex code by indenting everything. On the other hand there is a Align Columns option in texstudio (which a cousin of texmaker) where you select 1 & 2 & \mathbf M \\ 1 & -3 & \mathbf M \\ 1 & 6 & ...


2

There is no semibold version but you could scale up a smaller font size (the code I use is okay for a short portion like a title but not suitable for longer text!): \scalebox and resizebox of the graphicx package can be used too. It is up to you to decide if this looks pleasing ... \documentclass{article} \usepackage[T1]{fontenc} \usepackage{lmodern} ...


1

Since you use titleps, replace loading it with the option pagestyles of titlesec, and use its ‘easy’ interface. You won't even have to use the optional argument of \section: \documentclass{book} \usepackage{lipsum}% just to generate text for the example \usepackage[pagestyles]{titlesec} \newpagestyle{main}[\small]{ % define header ...


2

You should avoid setting the font of a sectional units within the argument. Not only does that force you to also supply an optional argument to circumvent these font settings to make it's way into the ToC, you run the risk that you're not being consistent in your formatting. While there are many options available for setting the sectional unit font, here's ...


3

\renewcommand\figurename{Figure} should work.


2

The KOMA-Script classes provide an option parskip to use a skip instead a par indent. Remove both lines \parskip 0.1in and \parindent 0in from your code and use \documentclass[...,parskip=half-,...]{scrbook} to get a similar skip between paragraphs. KOMA-Script classes load and use package typearea to calculate the margins and the text body. If you have ...


7

Note that play.cls is designed to typeset specifically this kind of material and can be customised in various ways. Here's a simple, default example: \documentclass{play} \title{A Play} \author{Will} \newcommand*\character[1]{\textsc{#1}} \begin{document} \maketitle \begin{thesetting} Setting for play. \character{Character} is $\phi$ing. ...


4

\documentclass{article} \usepackage{enumitem} \usepackage{lipsum} \begin{document} \begin{itemize}[leftmargin=5em,labelwidth=5em,labelsep=0pt, label={\smash{\small\itshape\begin{tabular}[t]{@{}l@{}}Stage\\ Directions\end{tabular}}}, align=left,font=\bfseries] \item\lipsum[3] \item[Tom] \lipsum[1] \item[Jerry] \lipsum[2] \end{itemize} ...


3

Without a MWE answering your question is like looking into a dirty crystal ball, so if this is not what you want, please send window cleaner... Code taken from http://tex.stackexchange.com/a/289036/36296 \documentclass{book} \usepackage{fancyhdr} \usepackage[margin=0.75in,head=2cm,top=1.5cm,bottom=2.5cm,includehead]{geometry} \usepackage{lastpage} ...


3

Try the following \makeatletter \renewbibmacro*{begentry}{% \ifkeyword{Key}{\sffamily}{}% \iffieldundef{shorthand} {} {\global\undef\bbx@lasthash \printfield{shorthand}% \addcolon\space}% \ifboolexpr{test {\usebibmacro{bbx:dashcheck}} or test {\ifnameundef{shortauthor}}}% {}% {\printnames{shortauthor}% ...


2

I was looking for a similar approach recently and my question was solved by using lua code within my document Using LuaLaTeX to calculate lengths in cm to be used in TikZ drawing. In the attached code I have a question regarding Magnetism and all numbers are randomly generated, which will in turn create a new question + answers. I also included some ...


4

This answer uses the biblatex package with biber. First, the entries that need highlighting need to be defined. You do this by adding a keywords entry into the respective items. Let's say, you want to have bold entries with keyword bold and sans-serif entries with keyword sans. Then, you add the following to your preamble: \renewbibmacro*{begentry}{% ...


3

See, if the following example can help you: \documentclass{book} \usepackage{fancyhdr} \usepackage[margin=0.75in,head=2cm,top=1.5cm,bottom=2.5cm,includehead]{geometry} \usepackage{lastpage} \usepackage{graphicx} \renewcommand{\headrule}{}% to remove the line \lhead{\includegraphics[width=6cm,height=2cm]{example-image.png}}% use your logo \rhead{% ...


4

I would avoid using caption with memoir as it provides its own mechanism for setting sub-floats: \documentclass{memoir} \usepackage{graphicx} % Enable subfigures \newsubfloat{figure} \begin{document} \begin{figure} \hfill \subbottom[First subcaption]{% \includegraphics[width=3cm]{example-image-a}} \hfill \subbottom[Second subcaption]{% ...


6

When using subcaption with memoir there is no need to say \newsubfloat{figure}. Remove that line and it's seems to be fine. \documentclass[a4paper, 10pt, openany]{memoir} \usepackage[demo]{graphicx} \usepackage{caption} \usepackage{subcaption} % Enable subfigures %\newsubfloat{figure} %commented % Section numbering depth \maxtocdepth{subsection} ...


2

If you use the Biber backend, things should be as easy as \renewrobustcmd*{\bibinitperiod}{} \renewrobustcmd*{\bibinitdelim}{\addnbspace} as jon points out in the comments, or can be read in Remove periods after author initials, but leave spaces. If you for the live of you cannot bear to use Biber and want to stick to your BibTeX(-like) backend you ...


6

Here is an example without package titlesec. \documentclass{scrbook}[2015/10/03] \usepackage[T1]{fontenc} \usepackage{xcolor} \usepackage{charter} \definecolor{mybluei}{RGB}{28,138,207} \definecolor{myblueii}{RGB}{131,197,231} \addtokomafont{disposition}{\usefont{T1}{qhv}{b}{n}\selectfont\color{myblueii}} ...


2

Does this meet your conditions? \documentclass[ 11pt, pagesize=auto, version=last, chapterprefix=true ]{scrbook} \usepackage[T1]{fontenc} \usepackage[explicit]{titlesec} \usepackage{xcolor} \usepackage{charter} \definecolor{mybluei}{RGB}{28,138,207} \definecolor{myblueii}{RGB}{131,197,231} ...


5

chapterthumbs: Chapter Thumbs or Tabs in Book Class re. chapterthumb.sty. However, unless it has been updated, that package no longer works with current versions of the class. Also: How to get chapterthumbs match their chapter titles in KOMA-Script? flowfram's thumbtabs: How do I specify what text is in thumbtabs background: Show ...


1

In addition, if you absolutely want to make your bibliography by hand (which is not recommended, as it will probably not meet the standards), it's easier to use a description environment, which can break across pages, and can be customised with the enumitem package: \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} ...


2

After you get a TeX error you should look at the log file, not the pdf output. TeX does not attempt to make sensible typeset result as it recovers from an error. Cats, O., Reimal, T., & Susilo, needs to be Cats, O., Reimal, T., \& Susilo, the error message is quite explicit about the extra & ! Extra alignment tab has been changed to ...


2

You could put the comments in parboxes. \documentclass{article} \usepackage{mathtools} \begin{document} \begin{alignat*}{2} \lim_{x\to 1} \frac{x^2-1}{1-x} &= \lim_{x\to 1} \frac{(x-1)(x+1)}{-(x-1)} &\quad& \parbox{160pt}{\raggedright Factoring the numerator and factoring $-1$ from the denominator.} \\ ...


6

You can exploit \new@ifnextchar from amsmath: \documentclass[]{article} \usepackage{amsmath} \usepackage{newtxtext,newtxmath} \usepackage{syntax} \usepackage{xpatch} \makeatletter \pretocmd{\grammar}{\let\@ifnextchar\new@ifnextchar}{}{} \makeatother \renewcommand{\syntleft}{$\langle$\normalfont\ttfamily} \begin{document} \begin{grammar} <a> ::= ...


2

You could achieve the desired effect by using the \smashoperator macro, which is provided by the mathtools package, with the [r] option. This informs LaTeX that an overlap should be allowed between the material placed below the summation symbol and the material that follows after the summation symbol. \documentclass{article} \usepackage{mathtools} % for ...


1

See if \mathrlap{...} from mathtools package gives what you like to obtain: \documentclass[border=3mm,preview]{standalone} \usepackage{mathtools} \begin{document} \[y=\sum\limits_{\mathrlap{x \in A[1...i-1]}} x\] \end{document}


5

The first part of your question is not specific to the syntax package. The problem is that in environments such as array and tabular and grammar, \\ directly followed by an opening square bracket is assumed to introduce an adjustment to vertical spacing. And a space beforehand doesn't prevent the next relevant token counting as the [. You don't want an ...


4

From siunutx manual markers are often given in tables after the numerical content. It may be table-align-text-post desirable for these to close up to the numbers. Whether this takes place is controlled by the table-align-text-pre and ...-post option You can remove space before the closing parenthesis with table-align-text-post = false. Your ...



Top 50 recent answers are included