Tag Info

New answers tagged

0

A manual solution The cgloss4e package (which is loaded by both gb4e and linguex to format glossed examples) provides very little customization options for the gloss spacing. If you only have a relatively small set of examples which will need extra formatting, it's possible to do it by splitting up the examples manually. It's not an ideal solution, but it ...


2

Alternative solution that I have come up with. this is not what i wanted in first place but its something. I would be happy if some one can put Checked-box as the background for this one. And again there is some aligning problems with minipage but i will ignore this one for now. \documentclass{article} \usepackage[framemethod=TikZ]{mdframed} ...


2

I know Clemens loves \arrow{0} but his solution sounds complicated to me. Why don't you use \schemestart...\schemestop inside \chemname, which seems more natural? \documentclass{article} \usepackage{chemfig} \begin{document} \schemestart \chemname{% \schemestart \chemfig{R-[:30](=[:90]O)-[:-30]R} \arrow{0}[,.5] ...


2

If you place the first two compounds in a \subscheme{...} the whole subscheme gets a unique name that you can refer to in an arrow using the \arrow{@<name>--) syntax: \documentclass{article} \usepackage{chemfig} \begin{document} % uncomment to see the names: % schemedebug{true} \schemestart \subscheme{ \chemfig{R-[:30](=[:90]O)-[:-30]R} ...


4

Taking some hints from Package xparse \SplitList last token, you can define a list processor that performs your request iteratively: \documentclass{article} \usepackage{graphicx,xparse}% http://ctan.org/pkg/{graphicx,xparse} \newcounter{itemcntr} \NewDocumentCommand\createanswerbox{O{,\,} >{\SplitList{,}}m} {% \setcounter{itemcntr}{0}% Start at 1. ...


6

Using pdfTeX (i.e., use latex or pdflatex to compile) and a transliteration for 'ancient' Greek: \documentclass[12pt]{article} \parindent0pt \useackage[T1]{fontenc}% \usepackage[utf8]{inputenc}% \usepackage[polutonikogreek,latin,english]{babel} % switch to language environments \newcommand{\latin}[1]{% ...


1

You can peek ahead and see whether there is an \ritem following an \rposition (using \@ifnextchar). If this is the case, just gobble it (using \@gobble). Of course, if it will always be followed by an\ritem, you can just gobble it regardless. Here's a way using the first (conditional) approach: \documentclass{article} % Short (i.e., one- to two-line) ...


2

You could use conditionals. Here's a some (re)definitions using etoolbox: \usepackage{etoolbox} \providebool{nopar} \renewcommand{\rposition}[1]{% \rnote{#1}% % set 'nopar' = true \booltrue{nopar}} \renewcommand{\ritem}{% \ifbool{nopar}% % if nopar = true, do nothing except set 'nopar' false {\boolfalse{nopar}}% % if nopar = false, ...


2

Since compounds are per default centered with respect to arrow in chemfig's schemes I usually use an invisible arrow (type 0) with length 0 (\arrow{0}[,0], the second optional argument scales the arrow relative to the basic length, the “compoundsep”) to center compounds: \documentclass{article} \usepackage{chemfig,chemmacros} \begin{document} ...


5

The class book does not include starred chapters into the table of contents. The \tableofcontents and \listoffigures use a starred chapter internally, therefore I guess that you are using package tocbibind that includes both \tableofcontents and \listoffigures in the table of contents. The first can be disabled by option nottoc: \documentclass{book} ...


3

I don't get a Contents line in the following MWE \documentclass{book} \usepackage{lipsum} \begin{document} \tableofcontents% \chapter{First} \lipsum% \chapter{Second} \lipsum% \end{document} Do you have a line that is something like \addcontentsline{toc}{chapter}{Contents} near to \tableofcontents? The \addcontentsline will add an ...


2

Using sasnrdisplay a front-end to the list­ings. code: \documentclass[12pt]{article} \usepackage[english,noautotitles-r]{SASnRdisplay} % front-end to the list­ings package % http://www.ctan.org/tex-archive/macros/latex/contrib/sasnrdisplay \lstdefinestyle{r-output}{ style = r-style, style = r-output-user, } % Incase code output numbering is not required, ...


3

You can use the titlesec package and its \titleformat and \titlespacing commands. \documentclass{book} \usepackage[pass,showframe]{geometry} \usepackage{titlesec} \titleformat{\chapter}[display] {\filleft\Large} {\chaptername\ \thechapter} {5ex} {\bfseries\MakeUppercase} \titlespacing*{\chapter} {0pt} {-15pt} {60pt} \begin{document} ...


8

Briefly, there are two options in R, these are "Sweave library" (not my favorite) and "knitr library". After using both, I recommend using knitr. What do you need? First, you need install knitr in R, >install.packages("knitr") And load it: >library(knitr) Then you create a regular \LaTeX file and save it with the extension .Rnw (foo.Rnw) I ...


5

The simplest thing to do is to load the verbatim package in your document's preamble; then you can put \verbatiminput{output.txt} in your document. This will include the contents of your text file, set it in a typewriter font, and not change the formatting at all. A more full-featured solution involves loading the listings package, as suggested by Marco ...


5

For example \documentclass{article} \usepackage{listings} \begin{document} \lstset{moredelim=[is][\itshape]{[}{]}} \begin{lstlisting}[frame=single] Array1: 78 54 31 54 92 86 23 54 65 54 54 38 100 92 86 59 54 70 [59 54 91 65 54 31 54 31 54 70 100 91 92 55 70 54 51 61 91 65 59 54 38 54 81 61 92 59 54 38 54 96 61 92] 59 54 38 54 81 54 92 90 54 92 ...


6

The command \renewcommand\contentsname{\Large{TABLE OF CONTENTS}} is wrong as the \....name macros are just supposed to have and (expandable) macro with the text to use to allow for localisation. A font command is not expandable so will not work in all contexts. If you were to put in a font command you should keep it local to the command, \Large does not ...


5

${\scriptstyle<}1\mathrm{ms}$ perhaps?


2

The code \documentclass[11pt,a4paper]{book} \title{title here} \author{author here} \date{date here} \begin{document} \maketitle \end{document} produces the output Edit: As pointed out by @Gonzalo Medina, if you want to use the article class, just change the first line of the code to \documentclass[titlepage]{article}.


4

That's the amsart class, see http://www.ctan.org/pkg/amsart for more details.


3

Try the package cals. I wrote it with a similar need in mind.


4

I claim this is a problem with the dvi driver bleeding the coloured panels too far, but I see the same with dvipng You can compensate by over-printing an uncoloured table over the top so the rules are on top of the colour not adjacent. Compare and \documentclass{standalone} \usepackage[table]{xcolor} \begin{document} \def\foo#1{\begin{tabular}{ ...


3

To get a cell spanning several rows, you can use the multirow package. \backslashbox works well with this within its implemantion limits - the slash is constructed as a LaTeX picture, and so there are only a limited number of slopes for the line allowed. \documentclass[12pt]{article} \usepackage{slashbox,multirow} \begin{document} ...


4

The standard way to cope with this kind of problems is to use \@seccntformat, the macro that takes care of formatting the section number (any level below chapter, in the standard classes). The usual definition is \csname the#1\endcsname \quad where #1 is the counter associated to the current section level. So if you define \def\@seccntformat#1{% ...


0

You can go to the file pseudocode.sys (if you are using a pseudocode environment) and changing the word "algorithm" by "algorithme". The file is installed C/programfile/...Miktex...pseudocode


17

David did beat me by a couple of minutes, but this version here does indentation as requested and is not producing overfull lines (within reason): \documentclass{article} \makeatletter % this defines myverbatim environment. to change name replace "myverbatim" in all places below (strctly speaing it is only necessary in some but ... :-) ...


11

You just want the definition of verbatim without the \obeylines part: ! \documentclass{article} \usepackage[T1]{fontenc} \makeatletter \newenvironment{exB}{% \trivlist \item\relax \let\do\@makeother \dospecials \verbatim@font \@noligs \hyphenchar\font\m@ne \catcode`\ \active \catcode`\^^M\active \catcode`\\\active \lccode`\~`\\% ...


1

It looks like a job for package tabularx: \documentclass{article} \usepackage{tabularx} \begin{document} \noindent \begin{tabularx}{\linewidth}{|l|X|} \hline LocationProvider & Description \\ \hline network & Uses the mobile network or WI-Fi to determine the best location.Might have a higher precision in closed rooms than GPS. \\ \hline gps ...


2

"l" means left aligned so everything in the cell comes out in a single row and if you have a lot of material you end up exceeding the available width on your page. Alternatives: use p{<width>} on one or more columns to have the text inside wrap the the specified <width> or use the package tabularx which allows you to get the column width for ...


9

You need to run this twice \documentclass{article} \usepackage{color} \makeatletter \def\savepos#1{\leavevmode\pdfsavepos\write\@auxout{% \gdef\string\save@#1{{\the\pdflastxpos sp }{\the\pdflastypos sp }}}} \def\xx#1{\expandafter\expandafter\expandafter\@firstoftwo\csname save@#1\endcsname} ...


2

As shown in Command for special text with reserved LaTeX symbols, \documentclass{article} \usepackage{verbatim} \renewcommand\encodingdefault{T1} \newenvironment{venv}{\verbatim\venvinner}{\endverbatim} \makeatletter \newcommand\venvinner[1][]{{\nfss@catcodes\scantokens{\gdef\tmp{#1}}}\tmp} \makeatother \begin{document} \begin{venv}[\sffamily] This should ...


5

Similar as the definition for the tt fontfamily, you can build a sf family to use \sffamily: \documentclass{article} \usepackage{fancyvrb} \makeatletter \begingroup \catcode`\`=\active \gdef\FV@fontfamily@sf{% \def\FV@FontScanPrep{\FV@MakeActive\`}% \def\FV@FontFamily{\sffamily\edef`{{\string`}}}} \endgroup \makeatother \begin{document} \noindent ...


6

Maybe simply: \documentclass{article} \begin{document} \makeatletter %\def\verbatim@font{\normalfont\ttfamily} % original one \def\verbatim@font{\normalfont\sffamily} \makeatother \begin{verbatim} Sans serif, indeed. \end{verbatim} \end{document}


4

I wrote a LaTeX template to imitate the features I use most often in Word. The code is below, and here's a blog post I wrote about it, which includes a sample PDF. \documentclass[12pt]{article} % Emulate MS Word \usepackage{wordlike} % One inch margins \PassOptionsToPackage{margin=1in}{geometry} % Remove footnote indentation ...


3

It seems that consecutive \tabucline create even more gaps. This seems to work: \tabucline[tableheadcolor]{1-1}\noalign{\kern-\arrayrulewidth} \tabucline[paleblue]{2-2}\noalign{\kern-\arrayrulewidth} \tabucline{3-6}


1

With PSTricks. \documentclass[preview]{standalone} \usepackage{pst-node,multido} \def\mybox#1{\psframebox{\makebox[3cm]{#1}}} \begin{document} \offinterlineskip \psmatrix[rowsep=.5] \mybox{A}\\ \mybox{B}\\ \mybox{C} \endpsmatrix \multido{\ia=1+1,\ib=2+1}{3}{\ncline{\ia,1}{\ib,1}} \end{document}


3

You can use \hhline (hhline package) instead and colour a line the same as the background colour for the first two segments.


7

Here you can specify the width of the boxes (it will be adjusted to fit if too short) and the separation between the boxes. \documentclass{article} \usepackage{keyval} \makeatletter \define@key{cascading}{width}{\cascading@wd=#1} \define@key{cascading}{sep}{\def\cascading@sep{#1}} \newdimen\cascading@wd \newcommand{\cascadingblocks}[2][]{% ...


6

Another option, using TikZ and chains: \documentclass{article} \usepackage{tikz} \usetikzlibrary{chains} \begin{document} \begin{tikzpicture}[ start chain=going below, node distance=3mm, every node/.style={on chain,join}, every join/.style={-}, block/.style={draw, text width=3cm,align=center} ] \foreach \i in {1,...,5} \node[block] {Text \i}; ...


1

\def\theequation{S\arabic{equation}} I assume that you use it in article. Definition for report or book should be a bit modified. MWE: \documentclass{article} \begin{document} \def\theequation{S\arabic{equation}} \begin{equation} 2+2=4 \end{equation} \end{document}


3

The Code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \begin{tikzpicture} [auto, block/.style = {rectangle, draw, text width = 6em, align =center}, line/.style = {draw, thick, -}] \matrix[every node/.style = block, row sep=6mm]{ \node (t1) {Text 1}; \\ \node (t2) {Text 2}; \\ \node (t3) {Text 3}; \\ \node (t4) ...


14

\documentclass{article} \begin{document} \lineskip0pt \framebox[3cm]{\strut Text1} \makebox[3cm]{\strut\vrule} \framebox[3cm]{\strut Text2} \makebox[3cm]{\strut\vrule} \framebox[3cm]{\strut Text3} \end{document}


0

I contacted the package maintainer, who confirmed that it is a bug. He quickly responded and provided a fix a few hours later which he intends to include in the next update of paracol to version 1.2.


5

Use aligned: \begin{equation*} \begin{aligned} m_{12}(\{ \emph{Red},\emph{Blue} \}) = K' * \bigl[ & m_{1}(\{ \emph{Red},\emph{Blue} \})*m_{2}(\{ \emph{Red},\emph{Blue} \}) \\ + & m_{1}(\{ \emph{Red},\emph{Blue} \})*m_{2}(\{ \emph{Red},\emph{Blue},\emph{Green} \}) \\ + & m_{2}(\{ \emph{Red},\emph{Blue} \})*m_{1}(\{ ...


5

Have you tried using the align environment? \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} m_{12}(\{Red,Blue\})&=K'*[m_1 (\{Red,Blue\})*m_2(\{Red,Blue\})\\ &\qquad +m_1(\{Red,Blue\})*m_2(\{Red,Blue,Green\})\\ &\qquad +m_2(\{Red,Blue\})*m_1(\{Red,Blue,Green\})] ...


2

I cannot help for the observed issue, that I must confirm. But if you would invoke the sectioning commands as intended by the package, everything would work fine (code shortened to be almost minimal): Note, that I removed the package option for paper and font size, since a4 and 11pt are the defaults anyway (and the documented option setting for paper size ...


0

The question doesn't specifically ask for LaTeX, yet all answers so far are in LaTeX, none in TeX. My solution, which, of course, you can put into a \def or simply straight into the text if you only need it once: C\raise .8ex \hbox{$_{++}$} Assuming 10pt size of the font; the '++' is in script style, which is size 7. Would it be better to use ...


4

For more automation, you may want to define a new command \bitem, as follows: \documentclass{article} \newcommand\bitem[1]{\item{\bfseries #1}\\} \begin{document} \begin{enumerate} \bitem {Specify a mean equation for the returns} by testing for serial dependence of $r_t$ an, if necessary, building an ARMA model \bitem {Test for ARCH ...


1

Use \textbf{...} around text that you want to embolden and \\ to break a line. \documentclass{article} \usepackage{enumerate} \begin{document} \begin{enumerate}[\bfseries1.] \item \textbf{Specify a mean equation for the returns}\\ by testing for serial dependence of $r_t$ an, if necessary, building an ARMA model \item \textbf{Test for ARCH Effects}\\ using ...


4

Not with xlop, but with some labor with expl3 you can do it. \documentclass{article} \usepackage{xparse,l3regex} \ExplSyntaxOn \NewDocumentCommand{\showmult}{mm} { \anna_showmult:nn { #1 } { #2 } } \tl_new:N \l__anna_temp_tl \tl_new:N \l__anna_factora_tl \tl_new:N \l__anna_factorb_tl \tl_new:N \l__anna_result_tl \tl_new:N \l__anna_table_tl \seq_new:N ...



Top 50 recent answers are included