title: Subsections as an enumerate

text: I want to have subsections named all the same with a number behind it. The straight forward approach I came up with is this:               \section{User Stories}     \subsection*{Userstory 1}     This is story 1     \subsection*{Userstory 2}     This is story 2      But I though isn't this possible as a list? So I have tried a few things but none worked. I have just learned the basics of LaTeX, and I want to try some more advanced tricks in LateX, but it won't work. I have tried this and some things very similar to this:               \section{User Stories}     \begin{enumerate} [label=\subsection*{Userstory \arabic*}]         \item This is story 1         \item This is story 2     \end{enumerate}      Is this behaviour even possible to automatically? What is the best approach, for not typing the number and the title every time. Thanks in advance!


title: How to use LyX to create PDF file from the command line

text: I'm using LyX for technical documentation and want to automate the process of creating PDF files. Within LyX, I can simply click the button "View PDF (XeTeX)", and LyX performs the whole build process for me: it creates a .tex file, does some bibliography magic, and uses XeTeX to create the final PDF file. What I'm looking for is a way to call LyX from the command line and get the same result. So far, I've only managed to generate a plain .tex file (using `\--export-to xetex`). However, when I run xelatex on the generated file, it keeps showing errors that don't occur when building using LyX. Is there a way to get LyX to do the work? My system: Windows 7 64bit, LyX 2.1.0


title: Different section numbering styles for toc and body

text: I'm looking for a way to display section numbering differently in the text body and in the toc. I've set up the numbering in the body as               \renewcommand*\theparagraph{\arabic{subsubsection}(\alph{paragraph})}      so I get something like 2(a) for this level (and 2(a)(i) for the next). In the toc, I'd like this to just show as (a) or (i). I know you can set different section headers in the toc by using, eg               \subsection[toc]{body}      but I can't find something similar for numbering. Any help would be appreciated :) EDIT: I've included the full context of what I'm trying to do               \ProvidesPackage{aglc}     \NeedsTeXFormat{LaTeX2e}          \RequirePackage{parskip}     \RequirePackage{chngcntr}     \RequirePackage{titlesec}          \setcounter{secnumdepth}{5}     \setcounter{tocdepth}{5}          \counterwithin*{subsection}{section}     \counterwithin*{paragraph}{subsection}     \counterwithin*{subparagraph}{paragraph}          % AGLC Heading 1     % I Section     \renewcommand\section{\@startsection {section}{1}{\z@ }%         {-3.5ex \@plus -1ex \@minus -.2ex}%         {2.3ex \@plus  .2ex}{\normalfont \centering \large \sc }}          \renewcommand*\thesection{\Roman{section}}                                                % AGLC Heading 2     % A SubSection     \renewcommand\subsection{\@startsection {subsection}{2}{\z@ }%         {-3.25ex\@plus -1ex \@minus -.2ex}%         {1.5ex \@plus .2ex}{\normalfont \centering \large \emph }}          \renewcommand*\thesubsection{\Alph{subsection}}            % AGLC Heading 3     % 1 SubSubSection     \renewcommand\subsubsection{\@startsection {subsubsection}{3}{\z@ }%         {-3.25ex \@plus -1ex \@minus -.2ex}%         {1.5ex \@plus .2ex}{\normalfont \emph }}          \renewcommand*\thesubsubsection{\arabic{subsubsection}}          % AGLC Heading 4     % (a) Paragraph     \renewcommand\paragraph{\@startsection {paragraph}{4}{\z@ }%         {3.25ex \@plus 1ex \@minus .2ex}%         {1.5ex \@plus .2ex}{\normalsize \emph }}          \renewcommand*\theparagraph{\arabic{subsubsection}(\alph{paragraph})}          % AGLC Heading 5     % (i) SubParagraph     \renewcommand\subparagraph{\@startsection {subparagraph}{5}{\z@ }%         {3.25ex \@plus 1ex \@minus .2ex}%         {1.5ex \@plus .2ex}{\normalsize \emph }}          \renewcommand*\thesubparagraph{\arabic{subsubsection}(\alph{paragraph})(\roman{subparagraph})}          % I tried commenting out the above \renewcommands and adding the code here, but it didn't work correctly          \newcommand{\case}[1]{\emph{#1}}     \newcommand{\caseref}[1]{[\emph{#1}]}          \newcommand{\statute}[2][Qld]{\emph{#2} (#1)}          \newcommand{\latin}[1]{\emph{#1}}          \endinput


title: Changing number format in ToC

text: I'm using the `tocloft` package to alter the looks of my table of contents, but there's one thing I can't find in the documentation: splitting the number by level, to insert other delimiters than ".". I'd like to have my ToC formatted in the following way: > **1 § The First Section**   >       1 § 1. The First Subsection of the First Section   >       1 § 1. The Second Subsection of the First Section   >  **2 § The Second Section**   >  _etc..._ To set the section level numbering, I use `\renewcommand\cftsecaftersnum{ \S\ }` which works like a charm. But I can't figure out how to get between the section and subsection counter on the subsection numbers. For the record, numbers on the actual subsection headers are already using the desired format. It unfortunately does not carry over to the ToC...


title: Minimal \protected@edef example

text: I recently came across `\protected@edef` in the/a LaTeX2e source. Can anyone give me a minimal or simple example, where I need this? I know this has to do with fragile commands/robustness, but I am looking for a concrete example.


title: XeLaTeX portrait jpg photo insertion

text: I'm using XeLaTeX to produce photobooks. Searching for info on placing portrait jpg's on a page with adjacent column text similar to published photo books. Have no Problem with landscape mode with text at bottom. Any pointers gratefully received and will be followed up.


title: nccmath: fleqn numbering

text: The following example illustrates the incompatibility of nccmath/fleqn and hyperref               \documentclass{article}     \usepackage{nccmath}     \numberwithin{equation}{section}     \setlength{\parindent}{0.0ex}          % comment out hyperref to see proper equation references     \usepackage[colorlinks=true]{hyperref}          \begin{document}          \section{First section}     Hello world     \begin{fleqn}     \begin{equation}\label{eqnA}         \qquad\text{equation A:}\quad x + 3y = 7     \end{equation}     \end{fleqn}          \vspace{5in}     Goodby world     \begin{fleqn}     \begin{equation}\label{eqnB}         \qquad\text{equation B:}\quad 5x + 2y = 3     \end{equation}     \end{fleqn}          \newpage     \section{Second section}     reference to equation B: \eqref{eqnB}\\     reference to equation A: \eqref{eqnA}          \end{document}


title: include section name, as well as number in mdframed (theorem) header

text: In a `memoir` class document, I am using the following `mdtheorem` definition to provide a heading inside an `mdframe`, which has the effect of providing an increasing count(er) to each new reference to `{discuss}                   \mdtheorem{discuss}{Discuss Topic}[chapter]      Within the body of the document, I've inserted `begin{discuss}[\rightmark]` (following this page, http://glurl.co/dFD), which has taken me some of the way. It outputs: `Discuss Topic 1: 1 TITLE`. I.e., it repeats the discussion (topic/section) number and places the title in CAPS. I would like to only include the counter once AND have the topic title in normal case. Further to discuss with Gonzalo, it is clear that the following macro, which produces two different types of section (`\section` and `\osection`) headings, is effecting the output:                   \usepackage{titlesec}     \usepackage{tikz}\usetikzlibrary{shapes.misc}     \makeatletter     \newcommand\titlebar@{%sections     \tikz[baseline,trim left=3.1cm,trim right=3.0cm] {         \fill [black!15] (2.5cm,-1ex) rectangle (\textwidth+3.1cm,2.5ex);         \node [             fill=black!100!white,             anchor= base east,             rounded rectangle,             minimum height=3.75ex] at (3cm,0.01) {             \color{white}\textbf{T\thesection}                 };     }}     \newcommand\titlebar@@{%osections     \tikz[baseline,trim left=3.1cm,trim right=3.15cm] {         \fill [black!15] (2.5cm,-1ex) rectangle (\textwidth+3.1cm,2.5ex);         \node [             fill=black!100!white,             anchor= base east,             rounded rectangle,             minimum height=3.75ex] at (3cm,0.15) {         };     }}     \newcommand\titlebar{\@ifstar\titlebar@@\titlebar@}     \titleformat{\section}{\large\bfseries}{\titlebar}{0.1cm}{}     \renewcommand*{\thesection}{\arabic{section}}     \newcommand{\osection}[1]{\section*{\titlebar*#1}}     \makeatother


title: Splitting table over several pages

text: I would like the table below to split over 3 pages splitting each time at the nearest \midrule how can I do this? Currently it just prints what it can until it hits the bottom of the page where it stops?               \begin{tabular}{clcccccccc}     \toprule     \multicolumn{10}{c}{Simulation Results for n=30} \\     & & & & & & {$\sigma^2$} \\     \cline{3-10}     ($\rho_1$, $\rho_2$) & Estimator & 0.0001 & 0.25 & 1 & 25 & 50 & 75 & 100 & 400 \\     \midrule     (0.99,0.99)              & HK          & 13.65     & 100    & per gram    & 13.65     & 100  & per gram    & 13.65     & 100    \\                              & HKB         & 0.01      & 100    & each        & 0.01      & 100  & each        & 0.01      & 100 \\                               & LW          & 92.50      & 100   & each        & 0.01      & 100  & each        & 0.01      & 100\\                              & ICOMP       & 33.33      & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & S           & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GM          & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & AM          & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MED         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & JRR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & URR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & PCR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & PCR CI      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & R-K         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & R-K CI      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MCRR        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MCRR CI     & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & LRRE        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & OIRE        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GIREI       & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GIREII      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\     \midrule        (0.99,0.1)               & HK          & 13.65     & 100    & per gram    & 13.65     & 100  & per gram    & 13.65     & 100    \\                              & HKB         & 0.01      & 100    & each        & 0.01      & 100  & each        & 0.01      & 100 \\                               & LW          & 92.50      & 100   & each        & 0.01      & 100  & each        & 0.01      & 100\\                              & ICOMP       & 33.33      & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & S           & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GM          & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & AM          & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MED         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & JRR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & URR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & PCR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & PCR CI      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & R-K         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & R-K CI      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MCRR        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MCRR CI     & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & LRRE        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & OIRE        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GIREI       & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GIREII      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\     \midrule            (0.9,0.9)               & HK          & 13.65     & 100    & per gram    & 13.65     & 100  & per gram    & 13.65     & 100    \\                              & HKB         & 0.01      & 100    & each        & 0.01      & 100  & each        & 0.01      & 100 \\                               & LW          & 92.50      & 100   & each        & 0.01      & 100  & each        & 0.01      & 100\\                              & ICOMP       & 33.33      & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & S           & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GM          & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & AM          & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MED         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & JRR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & URR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & PCR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & PCR CI      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & R-K         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & R-K CI      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MCRR        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MCRR CI     & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & LRRE        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & OIRE        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GIREI       & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GIREII      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\     \midrule                   (0.9,0.1)               & HK          & 13.65     & 100    & per gram    & 13.65     & 100  & per gram    & 13.65     & 100    \\                              & HKB         & 0.01      & 100    & each        & 0.01      & 100  & each        & 0.01      & 100 \\                               & LW          & 92.50      & 100   & each        & 0.01      & 100  & each        & 0.01      & 100\\                              & ICOMP       & 33.33      & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & S           & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GM          & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & AM          & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MED         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & JRR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & URR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & PCR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & PCR CI      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & R-K         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & R-K CI      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MCRR        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MCRR CI     & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & LRRE        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & OIRE        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GIREI       & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GIREII      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\     \midrule        (0.7,0.3)               & HK          & 13.65     & 100    & per gram    & 13.65     & 100  & per gram    & 13.65     & 100    \\                              & HKB         & 0.01      & 100    & each        & 0.01      & 100  & each        & 0.01      & 100 \\                               & LW          & 92.50      & 100   & each        & 0.01      & 100  & each        & 0.01      & 100\\                              & ICOMP       & 33.33      & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & S           & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GM          & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & AM          & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MED         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & JRR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & URR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & PCR         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & PCR CI      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & R-K         & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & R-K CI      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MCRR        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & MCRR CI     & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & LRRE        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & OIRE        & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GIREI       & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                              & GIREII      & 8.99       & 100   & stuffed     & 33.33      & 100  & stuffed     & 33.33      & 100\\                                                                    \bottomrule      \end{tabular}


title: How can I make the item label in the description environment wrap?

text: \documentclass{article}          \begin{document}          \begin{description}     \item[This is a very very very very very very very very very very very very very very long header line:] blah blah     \end{description}          \end{document}      In the above, the item label ("This is a very ... long header line:") does not wrap. How can I make it wrap?


title: Beamer messes up colors and positioning

text: (This may have been asked before, but I couldn't find it.) Why does beamer put `no way' at the top left of the slide in blue, but at the center in black when I remove the curly brackets? Bug or feature?               \documentclass{beamer}               \begin{document}          \begin{frame}{hi}     {     no way     }     \end{frame}     \end{document}


title: Text alignment issue in custom Table of Contents

text: As you can see from the image below, I have an issue with the text alignment of extra long chapter names. How can I fix it so that the text will not go further left than the start of the chapter name? That is, I don't want any text to be underneath the "Appendix A" part. I added that red line just to show how I'd like it aligned, if possible. ![enter image description here](http://i.stack.imgur.com/Gh3C7.png) Here's my MWE:               \documentclass{book}     \let\cleardoublepage\clearpage          \RequirePackage{titletoc}     \RequirePackage{tikz}     \RequirePackage[explicit]{titlesec}     \RequirePackage{DejaVuSansCondensed}     \RequirePackage[normalem]{ulem}     \RequirePackage[       left=2.25in,       right=0.75in,       top=1.25in,       bottom=1.25in,       marginparwidth=1.75in,       marginparsep=.25in,       asymmetric]{geometry}          \renewcommand*\familydefault{\sfdefault} % Set default font          %%% Table of Contents ----------------------------------------------------------     \setcounter{tocdepth}{1} % Show only Chapters and Sections          %%% Change font/color/layout of TOC     \makeatletter     \titlecontents{chapter}[-2em]     {\color{cyan}\bfseries\LARGE\addvspace{3mm}}     {\makebox[4.4em][r]{\@chapapp}\contentslabel{-0.25em}\hspace{1.9em}}     {}     {\hspace{3em}\contentspage}     \g@addto@macro{\appendix}{%       \addtocontents{toc}{\protect\renewcommand*{\protect\@chapapp}{\protect\appendixname}}%     }     \makeatother          \titlecontents{section}[5.3em]     {\color{cyan}\large\itshape\addvspace{3mm}}     {\contentslabel{0em}\hspace{3.2em}}     {}     {\hspace{3em}\contentspage}     [\addvspace{0mm}]          %%% Chapter Header ----------------------------------------------------------     \makeatletter     \titleformat{\chapter}       {\normalfont\sffamily\Huge\scshape}       {}{0pt}       {\thispagestyle{empty}    % Remove page number on new chapters       %\setcounter{definition}{0}       \begin{tikzpicture}[remember picture,overlay]         \node[yshift=-3cm] at (current page.north west)           {\begin{tikzpicture}[remember picture, overlay]             \draw[fill=cyan] (0,-1) rectangle               (25cm,3cm);             \draw[fill=cyan] (0,-24) rectangle               (25cm,-25cm);             \ifttl@label% <---------------------- Added condition on \ifttl@label               \node[anchor=west,xshift=.21\paperwidth,yshift=-.01\paperheight,rectangle]                   {\color{white}\LARGE \MakeUppercase{\@chapapp} \Huge\thechapter};             \fi% <------------------------------- end condition on \ifttl@label            \end{tikzpicture}           };        \end{tikzpicture}\endgraf       \vskip-.7cm       \color{cyan}\Huge\raggedright\leftskip-1cm        \noindent\MakeUppercase{#1}\endgraf       }     \makeatother          \titlespacing*{\chapter}{0pt}{10pt}{0pt}{}          \titleformat{\section}{\color{cyan}\itshape\LARGE}{\llap{\thesection} #1}{1em}{}[\titleline{\color{cyan}\titlerule[1pt]}]     \titleformat{\subsection}{\color{cyan}\normalfont\large}{\; #1}{1em}{}          \begin{document}       \tableofcontents       \chapter{Turing Machines}         \section{The Turing Machine}         \section{Variations of the Turing Machine}           %\subsection{Non-deterministic Turing Machines}         \section{The Church-Turing Thesis}       \chapter{Decidability}         \section{The Universal Turing Machine}            \appendix       \chapter{ON COMPUTABLE NUMBERS, WITH AN APPLICATION TO THE ENTSCHEIDUNGSPROBLEM}     \end{document}


title: ifsym package problem

text: I am using a template from the following web-page: Template of Latex I came up with a problem where I want to use "ifsym" package symbols and I could not get them. Actually, I want to use a symbols to present rain and error. Suggestions are welcome. Moreover, how can I extend the margins a little bit more.


title: looking a way to create toggle region in PDF generated by pdflatex

text: I am looking a way to generate a toggle region in PDF compiled by pdflatex. Something like this implemented with javascript in html http://www.randomsnippets.com/2008/02/12/how-to-hide-and-show-your-div/ I remember long time ago I saw a post online to implement this function but I can't find that post anymore.


title: How to define translations for text inserted by a custom command?

text: How would I go about having the output of a custom command depend on the language chosen (e.g. insert "Example" in English, "Exemple" in French and "Beispiel" in German)? I'm using XeTeX with `polyglossia`, but it would of course be even nicer to have a solution that would work with `babel` as well.


title: Logfile very large

text: Everytime I compile my file, I get a message from TeXstudio saying > The logfile is very large (> 2 MB) are you sure you want to load it? This is mostly because I am updating the bibliography, while to a large extent the .bib file is not correctly formatted (it is simply an output from Endnote actually). **My question is:** Is there any way for me to avoid getting the warning from TeXstudio and permanently assign that I want to load the log file? (otherwise, I am not able to see the Errors, and the bibliography is not even made). **Edit:** It seems like the error is not coming from the bibliography after all, but from a **lot** of messages like these:                   {leaving hbox group (level 16) entered at line 4}         {leaving simple group (level 15) entered at line 4}         {leaving hbox group (level 14) entered at line 4}         {leaving math choice group (level 13) entered at line 4}         {entering math choice group (level 13) at line 4}      Thanks in advance


title: Grouping cells in a tabular environment

text: I'm drawing a grid structure using a tabular environment. Some cells are empty, some cells are filled and some cells contain a symbol. Nothing spectacular there. ![grid \(generated\)](http://i.stack.imgur.com/AAKGh.png)               \documentclass{article}          \usepackage[table]{xcolor}     \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \setlength{\extrarowheight}{3pt} %for superscripts in tabular          \begin{document}          \newcommand{\xx}{\cellcolor[gray]{0.5}}          \begin{table}[h]         \centering         {\tt         \begin{tabular}{ *{11}{| C{0.4cm}}| }             \hline             N   &     & \xx &     & N   &     & \xx &     &     &     &     \\ \hline                 & N   &     & N   &     & N   &     & N   &     & \xx &     \\ \hline                 &     &     &     &     &     & \xx &     &     & \xx & \xx \\ \hline             \xx &     & \xx &     &     &     &     & \xx &     &     &     \\ \hline                 &     & \xx &     &     &     & \xx &     &     &     &     \\ \hline                 & \xx &     &     &     & \xx &     &     &     &     &     \\ \hline                 &     &     &     &     &     & \xx &     &     &     & \xx \\ \hline                 &     &     & \xx & \xx & \xx &     &     &     & \xx &     \\ \hline             \xx &     &     &     &     &     &     &     &     & \xx &     \\ \hline             \xx &     &     &     &     &     &     & \xx &     & \xx & \xx \\ \hline                 & \xx &     &     &     &     & \xx & \xx & \xx & \xx & \xx \\ \hline         \end{tabular}}     \end{table}          \end{document}      What I'm trying to do, though, is add brackets to group the empty cells in groups of four. I run into a problem when I simply add [ and ] to the contents of the cells: the content does no longer fit the cells and it wraps to a line slightly below the original line (in the process expanding the cell vertically), as the width is set. The bracket would also be centered, as that is default behaviour for my cells. Does anyone have any suggestion how I can mimic the behaviour as drawn in the following picture? Perhaps some sort of overlay that does not influence the drawing of the table itself? Note that I have no problem with manually inserting the [ and ] in the right places, so there's no need for automatically counting four empty fields. ![grid \(drawn\)](http://i.stack.imgur.com/h6rCA.png)


title: Dynamically insert full-page image at nearest page break

text: The situation: I have a document that essentially consists of many pages of plain text. I would like to include a full-page image at the page break nearest to a given line. It is important that the image be inserted at a pre- existing page break (i.e. that there not be excess trailing whitespace on the page preceding the inserted image). In other words, I want to start with a document looking like this: ![](http://i.imgur.com/wa67r4i.png) I would then like to be able to insert some sort of command in the text at the red mark that causes the image to be inserted at the nearest page break, thus giving me a result that looks like this: ![](http://i.imgur.com/eKVkV9T.png) The page containing the image should contain no other content (i.e. no header/footer/etc), and the image should be resized so that it fills the entire page (the images will already be of the correct aspect ratio). * * * Here's what I've tried so far. In all of these cases, `my_image.*` is an image that has been sized to the same aspect ratio as my document (in this case, `ebook`, which is 2:3, so my images are mostly 800x1200 pixels). **First** , the naive approach:               \documentclass[ebook]{memoir}     \usepackage{pdfpages} % to include the image-pdf     \usepackage{blindtext}          \begin{document}         \blindtext[10] % some plain text         \includepdf{my_image.pdf} % the image I want to be positioned somewhere around here         \blindtext[10] % some more plain text     \end{document}      This obviously fails, because it inserts the image exactly at the position I requested, which may not be at a page break. I can of course manually futz with the positioning of the `\includepdf` so that it falls immediately after the end of the last paragraph that is immediately before a page break, but this is unpleasant and also not a practical solution since I have a somewhat large number of these images (at various positions throughout my document) to deal with. **Second** , an approach that attempts to use floats:               \documentclass[ebook]{memoir}     \usepackage{pdfpages} % to include the image-pdf     \usepackage{blindtext}          \begin{document}         \blindtext[10] % some plain text         \begin{figure}             \includepdf{my_image.pdf} % the image I want to be positioned somewhere around here         \end{figure}         \blindtext[10] % some more plain text     \end{document}      What this ends up doing is it makes `my_image.pdf` the "background" of one of the pages rather than placing `my_image.pdf` on a separate page. I then tried adding `\pagebreak` before `\begin{figure}`, before `\includepdf{my_image.pdf}`, before `\end{figure}`, and after `\end{figure}`; none of these did anything useful either. **Third** , I tried using some code from this tex.SE answer, and futzing with vertical margins (based on looking at the output of the `layout` package):               \documentclass[ebook,oneside]{memoir}     \usepackage{blindtext}     \usepackage{graphicx}     % \adjustimg and \centerimg from <http://tex.stackexchange.com/a/39148/31395>     \newcommand{\adjustimg}{% Horizontal adjustment of image       \ifodd\value{page}\hspace*{\dimexpr\evensidemargin-\oddsidemargin}\else\hspace*{-\dimexpr\evensidemargin-\oddsidemargin}\fi%     }     \newcommand{\centerimg}[2][width=\textwidth]{% Center an image       \makebox[\textwidth]{\adjustimg\includegraphics[#1]{#2}}%     }          \begin{document}         \blindtext[10]         \begin{figure}           \vspace{-\voffset} \vspace{-1in} \vspace{-\headsep} \vspace{-\topmargin} \vspace{-\headheight}           \centerimg[width=\paperwidth,height=\paperheight]{my_image.jpg}         \end{figure}         \blindtext[10]     \end{document}      This seemed to get the job done, but then I stuck it back into my original document, which has headers and footers. Add the following header/footer code to the preamble:               \makepagestyle{nstyle}     \makeevenhead {nstyle}{HEADER TEST LEFT}{MID}{RIGHT}     \makeoddhead  {nstyle}{HEADER TEST LEFT}{MID}{RIGHT}     \makeevenfoot {nstyle}{FOOTER TEST LEFT}{MID}{RIGHT}     \makeoddfoot  {nstyle}{FOOTER TEST LEFT}{MID}{RIGHT}     \pagestyle{nstyle}      This gives me the strange result that the headers are hidden (presumably behind the image?), but the footers display over the image. I don't understand why this would happen, but either way, it's a deal-breaker for me. This entire setup (what with the long series of `\vspace` and so forth) is extraordinarily inelegant anyway, so I assume this must not be a good way of approaching the problem anyway. * * * So at this point, I'm kind of at a loss for how to approach this problem. (I'm a total novice at latex, though, so I wouldn't be surprised if there's a straightforward solution I just don't know about.) Note: I'm not sure if this matters, but I'm using `xetex` to compile (I need foreign script support). * * * EDIT: It seems likely to me that the best approach to solving this problem is to use `\includegraphics` inside a `figure` environment (i.e. some variant of the **third** approach I attempted above). The issues I'm facing are:   * I can't figure out how to remove headers/footers from the page that the `figure` ends up on. Or, alternatively, I can't figure out how to make the image appear "above" the footer (in the z-direction).   * I don't have a clean/elegant way of getting the graphic to occupy the entire page. If there isn't a clean/elegant way, so be it, though I do hope there's something better than throwing a series of 5 `\vspace`s at the problem.  (Note: I think my example above with the picture of the tree might have been misleading - the images I'm actually working with don't have a transparent or white background, and so it is important that there be no whitespace surrounding them. Ordinarily I'd deal with this using `pdfpages`, but I haven't found a way to get pdf pages to float properly.)


title: Using one key to set another key (in pgfkeys)

text: When I make a TikZ picture, I sometimes use absolute coordinates, and when I do, I find **Martin Scharrer's`showgrid` TikZ library** very handy. (It lays "graph paper" underneath my canvas, and puts numbers along the edges.) Here's a bit of code to illustrate that. (Note that the `showgrid` library has to be downloaded from **Martin's website**.)               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{showgrid} % http://latex.scharrer-online.de/general/wiki/showgrid          \begin{document}          \begin{tikzpicture}[show grid=all]         \draw (3,2) -- +(45:3);     \end{tikzpicture}          \end{document}      What I would like is to have a custom environment that takes a `draw guides` option. When `draw guides` is set, various debugging aids will be drawn (such as the names of nodes), and `show grid=all` will be activated. The code below shows my attempt to do this. It doesn't work, and I think the problem might be to do with the fact that the `show grid` key resides in the `/tikz/` directory, but `draw guides` resides in the `/wickerson/` directory. I've tried to `cd` into that directory at the opportune time, but it doesn't seem to have helped.               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{showgrid} % http://latex.scharrer-online.de/general/wiki/showgrid          \pgfkeys{/wickerson/.cd,       draw guides/.code = {%          % here do some other stuff, like enabling          % the printing of node names         \pgfkeys{/tikz/.cd,show grid=all}}       }          \newenvironment{wickersonpicture}[1][]{%       \pgfkeys{/wickerson/.cd,#1}       % do some stuff       \begin{tikzpicture}     }{%       \end{tikzpicture}     }          \begin{document}          \begin{wickersonpicture}[draw guides]         \draw (3,2) -- +(45:3);     \end{wickersonpicture}          \end{document}


title: Reusing entry in bibliography file with some modifications

text: Lets say I have entry like this:               @book{FT-GT,       author={Drew Fudenberg and Jean Tirole},       title={{G}ame {T}heory},       publisher={The MIT Press},       year={1991},       address={Cambridge}     }      I now that I can quote it like `\cite{FT-GT}` and it will all be generated smoothly. But what if I wanted to achieve something like:               @book{FT-GT-DEF1,       author={Drew Fudenberg and Jean Tirole},       title={{G}ame {T}heory},       publisher={The MIT Press},       year={1991},       address={Cambridge},       pages={50--55}     }          @book{FT-GT-DEF2,       author={Drew Fudenberg and Jean Tirole},       title={{G}ame {T}heory},       publisher={The MIT Press},       year={1991},       address={Cambridge},       pages={66--67}     }          % FT-GT-DEF3, FT-GT-DEF4, and so on...      Would I be able to obtain it without copy-pasting and modifying previous entries? Is there some smart way to achieve several quotations from the same book/article without typing several times the same information over and over?


title: Error using htlatex with tikz forest package, invalid SVG generated

text:
htlatex is supposed to support tikz with `\def\pgfsysdriver{pgfsys- tex4ht.def}` and it does on some `tikz` examples, but for some other examples, it gives bad svg images. **UPDATE** I was able to reduce the problem to a simpler example. I left the orginal question as appendix. But this is simpler MWE. The problem shows up when using math inside tikz, and only when math is a little complicated, like fraction. Here is an example that work with htlatex:               \documentclass{article}     \ifdefined\HCode     \def\pgfsysdriver{pgfsys-tex4ht.def}     \fi     \usepackage{tikz,graphicx}     %     \usetikzlibrary{trees}     \begin{document}     \begin{tikzpicture}      \node {root}        child {node {$a=b$}};     \end{tikzpicture}     \end{document}      then `htlatex foo.tex` and this is the HTML: ![enter image description here](http://i.stack.imgur.com/zXoHC.jpg) So, it works. Now I changed the above, only changed the math from $a=b$ to $\frac{a}{b}$ and now it failed               \documentclass{article}     \ifdefined\HCode     \def\pgfsysdriver{pgfsys-tex4ht.def}     \fi     \usepackage{tikz,graphicx}     %     \usetikzlibrary{trees}     \begin{document}     \begin{tikzpicture}      \node {root}        child {node {$\frac{a}{b}$}};     \end{tikzpicture}     \end{document}      then `htlatex foo.tex` gives error ![enter image description here](http://i.stack.imgur.com/Z335A.jpg) This is the HTML file generated by htlatex:               <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"         "http://www.w3.org/TR/html4/loose.dtd">             <title></title>      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">      <meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">      <meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">            <meta name="src" content="t4.tex">      <meta name="date" content="2013-07-19 08:58:00">      <link rel="stylesheet" type="text/css" href="t4.css">
<object data="t4-1.svg" width="33.99898 " height="77.82672 " type="image/svg+xml">
SVG-Viewer needed.
</object>                 And this below is the content of the SVG file generated for the above case where it failed which is referenced in the above HTML               <?xml version="1.0" encoding="iso-8859-1" standalone="no"?>      <?xml-stylesheet href="t4.css" type="text/css"?>      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24.74933pt" height="57.62027pt" viewBox="-12.37466 -51.2119 24.74933 57.62027 ">      <g transform="translate(0, 6.40837 ) scale(1,-1) translate(0,51.2119 )">          <g>       <g stroke="rgb(0.0%,0.0%,0.0%)">       <g fill="rgb(0.0%,0.0%,0.0%)">       <g stroke-width="0.4pt">       <g>       <g>       <g>       <g transform="matrix(1.0,0.0,0.0,1.0,-9.04169,-3.0754)">       <g fill="rgb(0.0%,0.0%,0.0%)">       <text style="stroke:none" transform="scale(1,-1) translate(9.04169,0)" text-anchor="middle"  font-size="10">      root</text>      </g>       </g>       </g>       </g>       <g>       <g>       <g>       <g transform="matrix(1.0,0.0,0.0,1.0,-3.3688,-44.43053)">       <g fill="rgb(0.0%,0.0%,0.0%)">       <text style="stroke:none" transform="scale(1,-1) translate(3.36882,0)" text-anchor="middle"  font-size="10">      </text>      </g>       </g>       </g>       </g>       <path d=" M  0.0 -6.60837 L  0.00002 -33.94635  " style="fill:none"/>       </g>       </g>       </g>       </g>       </g>       </g>                   </g>      </svg>       The strange thing, is that the file `t40x.png` which is referenced from inside the svg file is actually there and does show the fraction fine. So the problem is with the SVG file? Here is the `t40x.png` ![enter image description here](http://i.stack.imgur.com/jYdhx.jpg) So, the math was generated OK, it seems to be an SVG issue or something like this. I hope the above helps shed light on where the problem is. **Update july 19, 2013 5 pm** The problem boils down to parsing error in the above SVG. When verifying the XML code in the SVG file above, using http://www.w3schools.com/xml/xml_validator.asp, it gives this error ![enter image description here](http://i.stack.imgur.com/y4PtE.jpg) So the question is: What can be done to fix such errors? WHy is this error showing up? Anything one can do to post process these .svg files and fix them using some sort of script (`perl`, `sed`, etc..) until a permanent fix is found so that one can use `htlatex` to generate `tikz` pictures with math in them? **update july 19, 2013 7 pm** It was suggested in the chat to try mathjax with htlatex to see if that will make it display the math with tikz picture. I tried and it did not have an effect. Instead of posting things here again, I'll just post a link to my Latex cheat sheet where these are documented here If anyone else has another suggestion for me to try, I'll be happy to do it. I would like to be able to make simple diagrams using tikz with math in the labels but want to convert these to html as well not just pdf. ## Appendix (original question) Here is an example where it works with tikz               \documentclass{article}     \ifdefined\HCode     \def\pgfsysdriver{pgfsys-tex4ht.def}     \fi     \usepackage{tikz,graphicx}          \begin{document}           \begin{tikzpicture}     \draw (0,0) --(1,2);     \end{tikzpicture}     \end{document}      compiling with `htlatex foo.tex` gives a web page which shows the picture OK. But with this example, using `forest` package, the web page gives an error               \documentclass{article}     \ifdefined\HCode     \def\pgfsysdriver{pgfsys-tex4ht.def}     \fi     \usepackage{tikz,graphicx}     \usepackage{forest}     \begin{document}           \begin{forest} for tree={draw,align=center}     [second order partial differential equation          [elliptic                 [Laplace]             [Poisson]             ]         [parabolic]         [hyperbolic]     ]     \end{forest}          \end{document}      compiling with `htlatex foo.tex` then loading the html file gives the error ![enter image description here](http://i.stack.imgur.com/vlUXR.jpg) Why does one get an error from some `tikz` examples and not from others? I tried BOTH solutions given in this answer Htlatex and Tikz creates sometimes incorrect svgs (the accepted one and the one before it). But could not get an image using either one. Here I show the first solution given               \documentclass{article}     \usepackage{tikz,graphicx}     \usetikzlibrary{external}     \makeatletter     \@ifpackageloaded{tex4ht}{     \tikzexternalize[mode=only graphics]     }{     \tikzexternalize     }     \makeatother          \tikzset{     png export/.style={       /pgf/images/external info,       /pgf/images/include external/.code={%         \includegraphics            [width=\pgfexternalwidth,height=\pgfexternalheight]            {##1.png}%        }       }     }          \tikzset{png export}     \usepackage{forest}               \begin{document}           \begin{forest} for tree={draw,align=center}     [second order partial differential equation          [elliptic                 [Laplace]             [Poisson]             ]         [parabolic]         [hyperbolic]     ]     \end{forest}          \end{document}      Then run the same sequence of commands shown:                 pdflatex t3 -shell-escape       for i in *.pdf; do convert -density 300 $i `echo $i | sed -e 's/\.pdf/\.png/g'`; done       htlatex t3.tex      but the HTML now just showed the text, no lines and no graphics: ![enter image description here](http://i.stack.imgur.com/9MK5K.jpg) It should look like this (in pdf) ![enter image description here](http://i.stack.imgur.com/bFIrO.jpg) **How can I get the package forest to work with htlatex?** I am using TL 2013, and updated all packages. On Linux mint 15.


title: Alignment in an alignat environment

text: The following code has three alignments in an alignat environment. I am displaying equivalent expressions for $\vert xy + xz + yz \vert$ and for $\vert x + y + z \vert$. I want all the "=" to be aligned. They are. I want the first "+" in lines 1, 2, and 5 after $\vert xy + xz + yz \vert$ to be aligned with each other and with the first "+" in lines 2, 3, 4, 5 and 7 after $\vert x + y + z \vert$. Most of them are aligned. The first "+" in lines 2 and 3 after $\vert x + y + z \vert$ are slightly off due to the unseemly short space between the "+" and the "[". Why is the spacing not appropriate in these two lines? Why are all these "+" artificially shifted rightward? Do I have to insert an empty space "{}" to the left of the "+" in these lines to get the appropriate space? In another post, someone suggested using the "\mathrlap" command to get proper alignment. It gave me the proper alignment in that post. I don't know what it does, and so I don't know how to adapt it for this new code. I thought that it meant to make a box of no width and to put the text to the right of it. Is that right? (The third alignment is correct.)               \documentclass[10pt]{amsart}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{newlfont}     \usepackage{mathtools}     \usepackage{tikz}          \begin{document}          \begin{alignat*}{3}     \MoveEqLeft[2] \vert xy + xz + yz \vert^{2} \\     &= 3 &&+ \bigl[&&\cos(2a + b + c) + \cos(a + 2b + c) + \cos(a + b + 2c) \\     &&&&&+ \cos(a - b) + \cos(a - c) + \cos(b - c)\bigr] \\     &&&+ \bigl[&&\cos(a - b) + \cos(a - c) + \cos(b - c) \\     &&&&&- \bigl(\cos(2a + b + c) + \cos(a + 2b + c) + \cos(a + b + 2c)\bigr) \bigr] \\     &= 3&&\mathrlap{{}+ 2\bigl(\cos(a - b) + \cos(a - c) + \cos(b - c)\bigr).}     \intertext{Likewise,}     \MoveEqLeft[2] \vert x + y + z \vert^{2} \\     &= \mathrlap{[\cos{a} + \cos{b} + \cos{c}]^{2} + [\sin{a} + \sin{b} + \sin{c}]^{2}} \\     &= 3 &&\mathrlap{+ 2\cos{a}\cos{b} + 2\cos{a}\cos{c} + 2\cos{b}\cos{c}} \\     &&&\mathrlap{+ 2\sin{a}\sin{b} + 2\sin{a}\sin{c} + 2\sin{b}\sin{c}} \\     &= 3&& + \bigl[&&\cos(a + b) + \cos(a + c) + \cos(b + c) \\     &&&&&+ \cos(a - b) + \cos(a - c) + \cos(b - c)\bigr] \\     &&&+ \bigl[&&\cos(a - b) + \cos(a - c) + \cos(b - c) \\     &&&&&- \bigl(\cos(a + b) + \cos(a + c) + \cos(b + c)\bigr) \bigr] \\     &= 3&&\mathrlap{{}+ 2\bigl(\cos(a - b) + \cos(a - c) + \cos(b - c)\bigr).}     \end{alignat*}     \end{document}


title: Why \ref{} gives (null)?

text: I label an equation with: `\label{x}`. I refer to it with: `\ref{x}`. But my output gives: "(xnull)" rather than the expected "(x)". Any suggestions? A MWE:               \documentclass[11pt]{article}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{latexsym}     \usepackage{array}     \def\null{{\rm null}\,}     \begin{document}     \title{MWE}     \maketitle          Consider ...     \begin{equation}       \label{restriction}       1=1     \end{equation}     Equation (\ref{restriction}) ...     \end{document}


title: LaTeX doesn't compile after redefining \maketitle

text: Here is my main file:               \documentclass{report}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[francais]{babel}          \include{definitions/pagetitre}          \title{Text}          \author{Text}          \sujet{Text}          \motsclefs{Text}          \datedebut{September 26th}     \datefin{December 3, 2005}          \superviseurs{Name1 \textsc{Blabla} (ACRONYM)}          \proverbe{A leader is someone who steps back from the entire system and tries to build a more collaborative, more innovative system that will work over the long term.}     \auteurproverbe{Robert Reich, United States Secretary of Labor (1993--1997)}          \begin{document}          \maketitle          \paragraph{Lorem ipsum}     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vestibulum risus nec dapibus aliquam. Phasellus ultricies egestas erat sed mollis. Etiam euismod tortor ut ante rutrum consequat. Nunc id sem convallis, iaculis diam quis, facilisis nulla. Aliquam leo lorem, ultricies.          \end{document}      And here is definitions/pagetitre.tex:               %%%%%%%% Feuilles de style page de titre %%%%%%%%%%          \makeatletter     \def\maketitle{%         \thispagestyle{empty}%\vbox to \vsize{%         \LARGE             \begin{flushright}%                 \@sujet\\Â Â                  \hrulefill             \end{flushright}%         \vfill         \begin{center}%             \textbf{\huge \@title}\\             \vspace{1cm}%             \Large{ \@author}%         \end{center}%     \par     \vfill          \large         \begin{tabularx}{\textwidth}{lX}%             \textbf{Keywords} & \@motsclefs\\[0.2cm]             \textbf{Dates} & \@datedebut  --- \@datefin\\[0.2cm]             \textbf{Supervisors} & \@superviseurs         \end{tabularx}%     Â Â %Â Â }%     Â Â \clearpage     \vfill     \Large     \emph{\og\@proverbe\fg}     \begin{flushright}         \@auteurproverbe     \end{flushright}     \vfill     \normalsize     %\clearpage     Â Â }          \def\date#1{\def\@date{#1}}     \def\author#1{\def\@author{#1}}     \def\title#1{\def\@title{#1}}     \def\departement#1{\def\@departement{#1}}     \def\filiere#1{\def\@filiere{#1}}     \def\motsclefs#1{\def\@motsclefs{#1}}     \def\datedebut#1{\def\@datedebut{#1}}     \def\datefin#1{\def\@datefin{#1}}     \def\sujet#1{\def\@sujet{#1}}     \def\proverbe#1{\def\@proverbe{#1}}     \def\auteurproverbe#1{\def\@auteurproverbe{#1}}     \def\superviseurs#1{\def\@superviseurs{#1}}                    % Valeurs par dÃ©faut     \proverbe{}     \auteurproverbe{}     \sujet{}     \departement{}     \filiere{}     \motsclefs{}     \datedebut{\today}     \datefin{\today}     \superviseurs{\@author}       Does anyone know why it does not compile? The error is LaTeX doesn't know the command \maketitle... And when I delete the command \maketitle, it works, but the custom title doesn't appear at all.


title: How to translate a set of PSTricks objects and rotate it?

text: To illustrate the problem, consider a simple example with which you are familiar: A mechanical system that consists of a block lying on an inclined plane. I attached a Cartesian coordinate system to the block and also displayed the weight vector. I want to draw the system easily with minimal calculation and the simplest workflow. **The first step:** I draw each part separately as follows: ![enter image description here](http://i.stack.imgur.com/gj6Fy.png)               \documentclass{article}     \usepackage{pstricks-add}          \def\block{%         \psaxes[ticks=none,labels=none,linestyle=dashed]{->}(0,0)(-2,-2)(2,2)[$x$,0][$y$,90]         \psframe*[linecolor=gray,opacity=0.5](-1,-0.5)(1,0.5)         \psdots[linecolor=red](0,-0.5)         \psline{->}(1.5;-45)         \uput[-45]{45}(1.5;-45){$\vec{w}$}       }     \begin{document}          \begin{pspicture}[showgrid=bottom](-3,-9)(6,2)         \block         \pspolygon(-1,-2)(5,-8)(-1,-2|5,-8)         \psdots[linecolor=blue](1,-4)     \end{pspicture}          \end{document}      **The next step:** I attempted to merge them as follows: ![enter image description here](http://i.stack.imgur.com/j8xNv.png)               \documentclass{article}     \usepackage{pstricks-add}          \def\block{%         \psaxes[ticks=none,labels=none,linestyle=dashed]{->}(0,0)(-2,-2)(2,2)[$x$,0][$y$,90]         \psframe*[linecolor=gray,opacity=0.5](-1,-0.5)(1,0.5)         \psdots[linecolor=red](0,-0.5)         \psline{->}(1.5;-45)         \uput[-45]{45}(1.5;-45){$\vec{w}$}       }     \begin{document}          \begin{pspicture}[showgrid=bottom](-3,-9)(6,2)         \rput{-45}(1,-4){\block}         \pspolygon(-1,-2)(5,-8)(-1,-2|5,-8)         \psdots[linecolor=blue](1,-4)     \end{pspicture}          \end{document}      Do you see the weird part? Half of the block was submerged into the inclined plane. I want to fix it. **The general question is:** How to translate a system of PSTricks objects such that a certain point (belongs to the system) is coincident with a destination point and rotate the system about the certain point? Note: If you have another tricky idea but simpler, please let me know.


title: Alignment of lines with Grid

text: I am trying to draw the following figure. In this figure, I am trying to provide the dimensions of the rectangular blocks. ![enter image description here](http://i.stack.imgur.com/Nh9bz.png) I draw the figure using following code-               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}          \begin{tikzpicture}          \tikzset{%         dimen/.style={<->,>=latex,thin,every rectangle node/.style={fill=white,midway,font=\sffamily}},         symmetry/.style={dashed,thin},     }          \tikzstyle{lightGrayBoxStyle}=[fill=gray!20,draw=black,minimum height=0.5cm,minimum width=0.5cm]          \begin{scope}[local bounding box=scope1]          \draw [draw=black, fill=gray,step=0.5] (0,0) grid  (3,1.5) rectangle (0,0);     \node[lightGrayBoxStyle] at (2.25,0.75) (b4) {};     \node[lightGrayBoxStyle] at (1.75,0.75) (b3) {};     \node[lightGrayBoxStyle] at (1.25,0.75) (b2) {};     \node[lightGrayBoxStyle] at (0.75,0.75) (b1) {};          \draw [dimen,-] ([xshift=-1.4cm]b1.south) -- ([xshift=-1.4cm]b1.north) node  {$s_1 = 1$};     \draw [dimen,<-,rotate=-90] ([yshift=-1.2cm]b1.north) -- ++(-7pt,0);     \draw [dimen,<-,rotate=90] ([yshift=1.2cm]b1.south) -- ++(-7pt,0);     \draw[dashed] ([xshift=-0.75cm]b1.south) --([xshift=-2.0cm]b1.south);     \draw[dashed] ([xshift=-0.75cm]b1.north) --([xshift=-2.0cm]b1.north);          \draw [dimen,<->] ([yshift=1.1cm]b1.west) -- ([yshift=1.1cm]b4.east) node {$s_2 = 4$};          \draw[dashed] ([yshift=0.75cm]b1.west) --([yshift=1.25cm]b1.west);     \draw[dashed] ([yshift=0.75cm]b4.east) --([yshift=1.25cm]b4.east);     \node[draw=none] at (1.5,-0.75) {$(s_1,s_2) = (1,4)$};          \end{scope}          \begin{scope}[local bounding box=scope2,shift={($(scope1.east)+(1.5cm,-0.5cm)$)}]          \draw [draw=black, fill=gray,step=0.5] (0,0) grid  (2,2) rectangle (0,0);          \node[lightGrayBoxStyle] at (0.75,0.75) (b1) {};     \node[lightGrayBoxStyle] at (1.25,0.75) (b2) {};     \node[lightGrayBoxStyle] at (0.75,1.25) (b3) {};     \node[lightGrayBoxStyle] at (1.25,1.25) (b4) {};          \draw [dimen,-] ([yshift=1.6cm]b1.west) -- ([yshift=1.6cm]b2.east) node[above=2pt]{$s_2 = 2$};          \node[draw=none] at (1.00,-0.75)  {$(s_1,s_2) = (2,2)$};          \draw [dimen,<-] ([yshift=1.6cm]b1.west) -- ++(-7pt,0);      \draw [dimen,<-] ([yshift=1.6cm]b2.east) -- ++(+7pt,0);     \draw[dashed] ([yshift=1.25cm]b1.west) --([yshift=1.8cm]b1.west);     \draw[dashed] ([yshift=1.25cm]b2.east) --([yshift=1.8cm]b2.east);          \draw[dashed] ([xshift=-0.75cm]b3.north) --([xshift=-1.5cm]b3.north);     \draw[dashed] ([xshift=-0.75cm]b1.south) --([xshift=-1.5cm]b1.south);          \draw [dimen,-] ([xshift=-1.2cm]b1.south) -- ([xshift=-1.2cm]b3.north) node[rotate=90,yshift=0.40cm] {$s_1 = 2$};     \draw [dimen,<-,rotate=-90] ([yshift=-1.2cm]b3.north) -- ++(-7pt,0);     \draw [dimen,<-,rotate=90] ([yshift=1.2cm]b1.south) -- ++(-7pt,0);          \end{scope}          \begin{scope}[local bounding box=scope3,shift={($(scope2.east)+(1.0cm,-0.75cm)$)}]          \draw [draw=black, fill=gray,step=0.5] (0,0) grid  (1.5,3) rectangle (0,0);     \node[lightGrayBoxStyle] at (0.75,0.75) (b1) {};     \node[lightGrayBoxStyle] at (0.75,1.25) (b2) {};     \node[lightGrayBoxStyle] at (0.75,1.75) (b3){};     \node[lightGrayBoxStyle] at (0.75,2.25) (b4) {};          \node[yshift=1.15cm,rotate=90] at (b4.north) {$s_2=1$};     \draw[dashed] ([yshift=0.75cm]b4.west) --([yshift=1.85cm]b4.west);     \draw[dashed] ([yshift=0.75cm]b4.east) --([yshift=1.85cm]b4.east);               \draw [dimen,<->] ([xshift=-1.2cm]b1.south) -- ([xshift=-1.2cm]b4.north) node[rotate=90] {$s_1 = 4$};          \draw[dashed] ([xshift=-0.75cm]b4.north) --([xshift=-1.3cm]b4.north);     \draw[dashed] ([xshift=-0.75cm]b1.south) --([xshift=-1.3cm]b1.south);     \draw [dimen,<-] ([yshift=1.2cm]b4.west) -- ++(-7pt,0);      \draw [dimen,<-] ([yshift=1.2cm]b4.east) -- ++(+7pt,0);               \node[draw=none] at (0.7,-0.75) {$(s_1,s_2) = (4,1)$};          \end{scope}          \end{tikzpicture}     \end{document}      Now the problem is, the junction of the grid lines and the dimension lines I have circled in red seems to be mis-aligned. How do I make sure that these lines are aligned? If there is a better way of drawing this figure, I would be glad to know. I would also like to add an addition question. Is it possible to align all the text at the bottom of every rectangle aligned?


title: pgfplots: Tilted and Rotated sphere

text: I can make sphere with `pgfplots` through the following code.               \documentclass[tikz]{standalone}     \usepackage{pgfplots}     \pgfplotsset{compat=1.8}     \begin{document}     \begin{tikzpicture}              \begin{axis}[%             axis equal,             width=10cm,             height=10cm,             axis lines = none,         %    xlabel = {$x$},         %    ylabel = {$y$},         %    zlabel = {$z$},             ticks=none,             enlargelimits=0.3,             view/h=45,             scale uniformly strategy=units only,         ]           \addplot3[%             opacity = 0.5,             surf,             z buffer = sort,             samples = 21,             variable = \u,             variable y = \v,             domain = 0:180,             y domain = 0:360,         ]         ({cos(u)*sin(v)}, {sin(u)*sin(v)}, {cos(v)});              \end{axis}     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/0hk3Y.png) I'm wondering how to get such rotated tilted sphere with `pgfplots`. Thanks ![enter image description here](http://i.stack.imgur.com/fVjYs.png)


title: Convert pdf image to png. TiKZ

text: I'm making a small automata with TiKZ and I need to convert it to a png without having all the empty space around. Right now I get a whole page but I only want the automata. I have followed the instructions from this link but I couldn't make it work. Compile a LaTeX document into a PNG image that's as short as possible My original code:                 \documentclass{article}            \usepackage{tikz}       \usetikzlibrary{automata,positioning}            \begin{document}       \begin{tikzpicture}[shorten >=1pt,node distance=6cm,on grid,auto]            \node[state,initial] (q_0)   {$q_0$};        \node[state,accepting](q_3) [right=of q_0] {$q_3$};            \path[->]        (q_0) edge              node {bb+(a+ba)(ab)*(a+bb)} (q_3);            \end{tikzpicture}       \end{document}


title: \hfill underlining in a tabular environment

text: I would like to make a name and address fill-in-the-blank in a neat rectangle with a lined space where the information should be filled in. At first I came up with this:               \begin{tabular}{ll}     \multicolumn{2}{l}{NAME\underline{\hspace{15em}}\\     \multicolumn{2}{l}{ADDRESS\underline{\hspace{15em}}} \\     \multicolumn{2}{l}{CITY\underline{\hspace{15em}}} \\     STATE\underline{\hspace{3em}} & ZIP\underline{\hspace{8em}}     \end{tabular}      But this yields a ragged right edge and tinkering with the \hspace{} parameters is a non-starter. I tried this:               \begin{tabular}{ll}     \multicolumn{2}{l}{NAME\underline{\hspace{15em}}\\     \multicolumn{2}{l}{ADDRESS\underline{\h fill}} \\     \multicolumn{2}{l}{CITY\underline{\hfill}} \\     STATE\underline{\hspace{3em}} & ZIP\underline{\hfill}     \end{tabular}      But I get no underlines at all with the \hfills. I don't want to simply make this a tabular with \hlines because that will result in underlined field names or gaps between the field names and the underlining.


title: Editing bst file to change (X) to (No. X)

text: I've done my own bst file using the _makebst.tex_ , which produces the following output: ![enter image description here](http://i.stack.imgur.com/zppgc.jpg) That is exactly what I need except for the fact that it should place the particle for number "No." inside the brackets, i.e., **12** (No. 1) instead **12** (1). Can this be done by editing the bst file?


title: Modest changes in LaTeX dialect possible?

text: I would like to create my own LaTeX-derivative markup language. (I asked similar questions before, but this is more limited.) Advice would be useful. ### First Question: I believe there are three main categories of macros between the begin-document and end-document (which I will call the "main document"):   1. markup (e.g., `\textit`, `\begin{quote}`)   2. characters (e.g., `\kappa`, `\Bbb{A}`)   3. programming (e.g., `\newcommand`, `\let`, `\newtheorem`). Is this classification reasonable, or am I omitting a logical class of macros? I believe everything that can be typeset in LaTeX can still be typeset if I removed #3 from the main document and banned it into the preamble. This means that once my preamble is read, the set of allowed macro names will be fixed, and I just have true markup in my document. Another program could then, in principle, interpret markup (and interpret it differently) without having to be itself TeX. ### Second Question: Is there a long-cut to `{ }` environments? This is when used by itself, not when used to delineate arguments of macros. I mean `hello {\it there}` as opposed to `hello \textit{there}`. I am wondering if I can "ban" the plain environment use of the parens in my document, and rely on styling instead. In rare cases where needed, I would then say `\begin{env} ... \end{env}`. But I have not run into such a situation. ### Third question: Is it possible to change catcodes in the main document, but as soon as LaTeX expands (enters = runs) a macro, the standard catcode definitions hold again? (I.e., so that I can still run all macros that were defined in packages without me having to make changes). If this is the case, then I could define my own LaTeX dialect. My documents would have the power of standard LaTeX in the preamble, and then               \usepackage[version=2]{newdocument}     \begin{newdocument}        modified catcodes, outside markup     \end{newdocument}      where the newdocument would be my own version. as for me, I would want   * `|` becomes my cell separator in tabulars   * `&` become the entity operator, just as in html, i.e., `&kappa;` and `&hashmark;`   * `\\\` be replaced with something like `\nl`   * `$` be freed up (i.e., no longer a catcode). my users would have to use `\m{...}` for math expressions.   * `%` be freed up (i.e., no longer be a special catcode). 15% is now what it should be. Less important:   * `#` become the remark operator. without programming, no longer needed otherwise   * `\\#` be banned in exchange for `&hashmark;` Now, processing the input text is easy with Lua or Perl or..., but I would like the documents to remain portable, so this would have to be a standard LaTeX package written in TeX. (If this is easy, I will want to hire someone to implement this. If this is hard, then it's a no go.) /iaw


title: align environment has too much white space

text: How can I let the following code look good ?               \begin{align*}     &\text{Als} &&a,b \in H\\      &\Rightarrow   &&a,b\in H_1 \land a,b \in H_2 &&\text{Definitie van doorsnede}\\     &\Rightarrow  &&ab^{-1}\in H_1 \land ab^{-1}\in H_2 &&\text{Group axioma's}\\     &\Rightarrow  &&ab^{-1}\in H  &&\text{Definitie van intersectie}\\     &\Rightarrow  &&H\leq G &&\text{Ondergroep test}     \end{align*}       No there is just way too much whitespace. Is there a way to control the amount of whitespace ? Hm.. in codecogs it does look good. So this is how I would want it to look: ![Image](http://i.stack.imgur.com/XzmhQ.png)


title: Beamer - Array problem

text: I encounter some trouble with the following array in the frame :               \begin{frame}     \frametitle{Measurability of  - Third case}          \begin{block}{Expression of }          Let  the unique solution of  on  :\\     \[ t^* = \big( x_2-V_{ref}-\frac{V_L}{a} \big) \frac{Ta}{V_U-V_L} \]          Let  integer,     \[ Sign(V_r(t)-x_2) = \left{     \begin{array}{cc}     -1 & if\qquad iT \leq t < t^*+iT\\     [-1;1] & if\qquad t = t^* + iT\\     1 & if\qquad iT \leq t < t^*+iT\\     \end{array}     \right. \]     \end{block}          \end{frame}          %---------------------------------------------------      Here is the error message I get :               Runaway argument?     \frametitle {Measurability of  - Third ca\ETC.     ! File ended while scanning use of \frame.     <inserted text>      \par      <*> pres.tex      Please, has anyone any idea ?


title: Automatic linebreak in align environment in macros

text: I have given a selfdefined command like               \newcommand{\AND}[2]{\left(#1 \vee #2 \right)}      which makes sure that I always give the correct number of parameters to my formula and which handles the parentheses as well. Now, when I use this command in a `align` environment and the arguments become very long, then a linebreak becomes nessecary. Here's the problem: In the `align` environment I have to set linebreaks myself, however between `\left` and `\right` linebreaks aren't allowed. So, is there any way to have a automatic linebreak here, which also keeps the correct size of the parentheses? My only workaround so far is not to use the macro in these situations, which results in unclean code. The `breqn` package doesn't seem to fix this problem.               \documentclass[11pt, draft]{scrbook}     \usepackage{amsmath}     \usepackage{breqn}          \newcommand{\AND}[2]{\ensuremath{\left(#1\vee#2\right)}}          \begin{document}     \begin{align*}     aaa&= \AND{\sum^a_b \AND{\AND{\AND{\AND{\AND{\AND{\AND{\AND{\AND{\AND{a}{b}}{b}}{b}}{b}}{\AND{\AND{a}{\AND{a}{b}}}{\AND{a}{\AND{a}{b}}}}}{b}}{b}}{a}}{\AND{a}{\AND{\AND{a}{b}}{b}}}}{\frac{a}{\frac{a}{b}}}}{\sum^a_b \AND{c}{\frac{a}{\frac{a}{b}}}}\\     &= b     \end{align*}     \end{document}      EDIT: After fiddling around for a while, I came up with a small workaround that solves a part of the problem, but not all. I defined a new command which inserts a linebreak and handles the parenthesis for this linebreak:               \documentclass[11pt, draft]{scrbook}     \usepackage{amsmath}     \usepackage{mathtools}          \newcommand{\AND}[2]{\ensuremath{\left(#1\vee#2\right)}}     \newcommand{\ANDbr}[2]{\ensuremath{%     \begin{lgathered}[t]%     \left(#1 \vee \vphantom{#2} \right. \\     \left.\vphantom{#1\vee}#2\right)     \end{lgathered}%     }}          \begin{document}     \begin{align*}     aaa&= \ANDbr{\AND{\AND{\AND{a}{b}}{\AND{\frac{a}{b}}{c}}}{\AND{\AND{\sum_a^b a}{p}}{\AND{a}{b}}}}{\AND{\AND{\AND{a}{b}}{\AND{a}{b}}}{\AND{\AND{a}{b}}{\AND{a}{b}}}}\\     &= b     \end{align*}     \end{document}      This seems to work as long as I need only one linebreak. Inserting `\ANDbr` for a second time messes things up however. EDIT2: I tried to add `\allowbreak` into the definition of `\AND`, but it didn't change anything.


title: \appendix chapter number not display

text: I am using following commands for Appendix:               \appendix      \chapter{First Appendix}      \input{AppendixA}      and it display chapter but without chapter number.               Frist Appendix  (no appendex number A)     .1 section title     .1.1 subsection title      I browsed this forum and found some tips but they could not solve my problem. if i use these commands:               \appendix \renewcommand{\thechapter}{\arabic{chapter}}     \renewcommand{\thesection}{A.\arabic{section}}          \chapter{First Appendix}      \input{AppendixA}     \chapter{Second Appendix}      \input{AppendixB}      then out put is:               Frist Appendix   0 (appendex number starts from 0 not A)     A.1 section title     A.1.1 subsection title          Frist Appendix  0 (it repeat same number with all chapters)     A.1 section title     A.1.1 subsection title      Customized class file can be found here. May be it is due to conflict with other packages, i am using following packages:               \documentclass[12pt, english, squeezeCommittee, fancyChapter, fancyPart]{these-LUNAM}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{longtable}     \usepackage{amsmath,amssymb,amsfonts,amsthm,stmaryrd}     \usepackage{mathabx}     \usepackage{algorithm}     \usepackage{algorithmic}     \usepackage{lscape}     \usepackage{textcomp}     \usepackage{graphics}     \usepackage{todonotes}     \usepackage{appendix}     \usepackage{paralist} % %for inline  numbering     \usepackage{makeidx}     \makeindex          % to resize tables     \usepackage{graphicx}     \usepackage{multirow}     \usepackage{csvsimple}          % to draw graphics in latex     \usepackage{array}     \newcolumntype{C}{>{$}c<{$}}     \usepackage{tikz}      \usetikzlibrary{positioning, shapes, arrows}     \tikzset{         events/.style={ellipse, draw, align=center},     }     \usepackage{glossaries}     \geometry{inner=4.5cm, outer=2.5cm, top=2.5cm, bottom=2cm}     \usepackage{times}     \RequirePackage[bookmarks,%                     colorlinks,%                     urlcolor=blue,%                     citecolor=blue,%                     linkcolor=blue,%                     hyperfigures,%                     pagebackref,%                     pdfcreator=LaTeX,%                     breaklinks=true,%                     pdfpagelayout=SinglePage,%                     bookmarksopen=true,%                     bookmarksopenlevel=2]{hyperref}     \usepackage{url}     \usepackage{hyperref}     \usepackage{breakurl}          % to set      \setcounter{secnumdepth}{5}     \setcounter{tocdepth}{5}          \usepackage{minitoc}


title: How to rearrange a tikzpicture in a page that uses the class suftesi

text: I drew an ER schema for a database and put it in my mini-thesis written using `suftesi`. This class has the peculiarity of adding a mini-column beside the main column of contents, used for notes. This results in my `tikzpicture` (coded using `tikz-er2` by Pàvel Calado) not being centered in the page. Is there a way to solve this problem? I added a screenshot to better show this problem: ![enter image description here](http://i.stack.imgur.com/WNFdi.png) EDIT: This is the source .tex file and the tikz-er2.sty file bundle. puu.sh/1Jq1m


title: Chessboard Display Error

text: When displaying chessboards using the Chessboard Package, the border at the top of board does not line up with the actual top of the board. Relevant code and picture below. Thoughts?               \documentclass{amsart}     \usepackage{chessboard}     \begin{document}          \chessboard          \end{document}      ![Chessboard Display Error](http://i.stack.imgur.com/rhEnv.png)


title: How can I define NaN in LaTeX3

text: LaTeX3 `l3fp` offers a way to check if a variable has a an infinite value. The following code defines a number and then sets its value to π/2. It then calculates tan(π/2) to get a large result.               \ExplSyntaxOn       \fp_new:N \mynumber       \fp_new:N \pi_half       \fp_div:Nn \pi_half{\c_pi_fp/2}       \fp_tan:Nn  \mynumber{\pi_half}       \texttt{\mynumber}\\            \fp_if_infinity:NTF \c_infinity_fp {NaN}{Do~something~with~\number}\\          \ExplSyntaxOff      In many languages the indeterminate form is normally indicated by NaN what would be a good strategy to define a macro to test for this in `expl3` for all cases of `NaN`, such as division by zero etc?


title: How to locate rejected index enteries

text: Some of my index entries are being rejected for some reason. How do I determine which index entries were rejected? For instance if I uncomment the `\def` at the top of the MWE below I see the message in the console. All this does is switch from suing `\tiny` to `\small`. Not sure why one would be ok but the other. > Scanning input file TestIndex.idx...done (0 entries accepted, 10 rejected) I searched for the word `rejected` in `imakeidx.sty` but that word is not in that file, so not sure where this message is coming from. The above is just one cause of the entries being rejected. I need to know what are some of the other causes as I have some rejected without using `\small`. ## References:   * This is a follow up to Index hyperlinks to open a PDF file. ## Code:               %\def\UseSmallInIndex{}%          \documentclass{article}     \usepackage{datatool}% database     \usepackage{imakeidx}% indexing     \usepackage{hyperref}% For cross references     \usepackage{xcolor}%     \makeindex          % ---------- Process Each Word:     %     % http://tex.stackexchange.com/questions/12810/how-do-i-split-a-string     \makeatletter     \def\ProcessEachWord#1{%         \begingroup%         \edef\@tempa{#1\space}%         \gdef\@tempb{#1}%         \expandafter\endgroup%         \expandafter\ReadWords\@tempa\relax%     }%     \def\ReadWords#1 #2\relax{%           \ProcessWord[\@tempb]{#1}%  #1 = substr, #2 = rest of string           \begingroup%           \ifx\relax#2\relax% is #2 empty?              \def\next{\endgroup\EndProcessWords}% your own end-macro if required           \else%              \def\next{\endgroup\ReadWords#2\relax}%           \fi%           \next%     }%     \makeatother     % ----------                \newcommand{\ProcessWord}[2][]{%         \ifdefined\UseSmallInIndex%             \index{#2!#1\href{run:#1.pdf}{\small\textcolor{red}{pdf}}}%         \else%             \index{#2!#1\href{run:#1.pdf}{\tiny\textcolor{red}{pdf}}}%         \fi%     }%     \newcommand{\EndProcessWords}{}          \begin{document}     \DTLnewdb{DB}%     \DTLnewrow{DB}%      \DTLnewdbentry{DB}{FileName}{Now good enough}%      \DTLnewrow{DB}%      \DTLnewdbentry{DB}{FileName}{Now good enough for you and me}%           \DTLforeach{DB}{\FileName=FileName}{%         \section{\FileName}%         \par\noindent\href{run:\FileName.pdf}{\FileName}%         \ProcessEachWord{\FileName}%     }%          \printindex     \end{document}


title: How to add a tikz/pgf command to section command

text: I need to draw a simple symbol with tikz/pgf to a chapter command, for example:               \documentclass{book}     \usepackage{tikz}          \begin{document}          \chapter{hello tikz\tikz\node{pgf};}          \end{document}      but this does not work, is there anyway to fix this? thanks.


title: Trying to align external images within a tikz tree

text: I'm trying to generate a tikz tree that includes images (square pdf's) in the outermost nodes. (incidently, I'm generating these images using R and Sweave on the fly, but that's not pertanent to my problem). I can't get the images to both; a) align nicely in the node b) be surrounded by the bounding box of the node Here's a reduced example               \documentclass[final,t]{beamer}     \usepackage[english]{babel}     \usepackage[latin1]{inputenc}     \usepackage[orientation=landscape,size=a0,scale=0.85]{beamerposter}     \usepackage{tikz}     \usetikzlibrary{decorations.pathmorphing,backgrounds,positioning,fit,trees,mindmap,arrows,shapes}          \begin{document}     \begin{frame}     \begin{figure}[!h]     \centering     \begin{tikzpicture}[align=center, show background grid,     grow cyclic,     level 1/.style={level distance=10cm,sibling angle=90},     level 2/.style={text width=2.5cm,level distance=8cm, sibling angle=60},     level 3/.style={level distance=8cm, sibling angle=45}]     \node [draw]{What Would you Like To Show ?} %root         child { node [minimum width=6cm, draw]{Composition} %Subtree 1             child {node [draw]{Changing over Time}                 child{node [draw]{Few Periods}                      child{node [draw]{Only Relative Differences Matter}                          child{node [anchor=south west,inner sep=5pt, minimum width=7cm, draw] at (0,0) { \includegraphics[width=6cm]{graphPostertikz-stacked100col} } }                     }                     child{node [draw]{Relative and Absolute Differences Matter}                          child{node [anchor=south west,inner sep=5pt, minimum width=7cm, draw] at (0,0) { \includegraphics[width=6cm]{graphPostertikz-stackedcol} } }                     }                 }                 child{node [draw]{Many Periods}                      child{node [draw]{Only Relative Differences Matter}                          child{node [anchor=south west,inner sep=5pt, draw] at (0,0) { \includegraphics[width=6cm]{graphPostertikz-stacked100area} } }                     }                     child{node [draw]{Relative and Absolute Differences Matter}                          child{node [anchor=south west,inner sep=5pt, draw] at (0,0) { \includegraphics[width=6cm]{graphPostertikz-stackedarea} } }                     }                 }             }         }     ;     \end{tikzpicture}     \end{figure}     \end{frame}     \end{document}      But in the resulting tree, the two images without a minimum width setting are nicely left aligned, but the bounding box is narrower than the image. Where I have tried aminimum width, the image starts int he middle of the node and still goes over the edge. Any ideas ? EDIT: As pointed out, my minimal example, wasn't particularly minimal, I've commented out / removed a few bits.


title: Problem with babel, ragged2e and parbox

text: I have the following code:               \documentclass{minimal}     \usepackage[french]{babel}     \usepackage[newcommands]{ragged2e}          \begin{document}       \begin{center}         \parbox{9cm}{           \textsc{     Jesus a dit~: \og Je suis le bon berger~;      le bon berger donne sa vie pour les brebis \fg{}           }         }       \end{center}     \end{document}      The paragraph usually gives good results, but with this specific sentence, I get something ugly: ![ragged2e with babel](http://i.stack.imgur.com/JBGzX.png) The case is quite rare (I have tens of other boxes that work fine) so I could just force the carriage return for this one, but I'd like to understand why it does this...


title: How to set title for a single page inside document

text: I would like to ask for an advise about how to set title of the single page inside the document (not the title page, but regular page in document). I'd like to have picture on whole page with caption in title of the page. For whole document I use the `article` class.


title: How to write centered multi-line conclusion in inference rule?

text: I'm using the semantic package to write inference rules and I have trouble with the following:               \usepackage[inference]{semantic}     \usepackage{amsmath}               \begin{equation}       \inference{ expr }{ \begin{aligned} long_expr1 \\ long_expr2 \end{aligned} }     \end{equation}      In this code, I want `long_expr1` and `long_expr2` to be centered. However, the aligned environment aligns them on the right. How can I fix this?


title: How to display caption at the bottom of a figure

text: I am not able to show the caption at the bottom of figure. I always get in the middle. I would appreciate your help. Below is the code.               \documentclass[fleqn,12pt,a4paper]{article}     \usepackage{fontspec,xltxtra,xunicode}     \usepackage{fancyhdr}     \pagestyle{fancy}     \usepackage{color}     \usepackage{setspace}     \usepackage{hyperref}     \usepackage{cmll}     \usepackage{tabularx}     \usepackage{pifont}     \usepackage{amstext, amsmath}     \usepackage{enumerate}     \setmainfont[Script=Devanagari]{Sanskrit2003}     %     \begin{document}     \begin{figure}[htb]     \begin{center}     {\setlength{\unitlength}{6mm}     \begin{picture}(13,13)(0,0)     \put(-2,-0.5){\framebox(6,3){ What are Pragruhya}}     \put(8,-4){\framebox(7,3.2){     \shortstack{A monosyllabic \\with the exception of }}}     \put(4,1){\vector(1,2){4}}     \put(8,0){\framebox(7,3){     \shortstack{that come\\ after the of }}}     \put(4,1){\vector(1,1){4}}     \put(8,4){\framebox(7,3){     \shortstack{ or \\are called }}}     \put(4,1){\vector(1,-2){4}}     \put(8,-8){\framebox(7,3){     \shortstack{ A ending in \\are called }}}     \put(4,1){\vector(1,-1){4}}     \put(8,8){\framebox(7,4){     \shortstack{ in when \\followed by the \\word in the }}}     \put(4,1){\vector(1,0){4}}     \end{picture}     }     \end{center}     \caption{Some More Sutras}     \end{figure}     \end{document}


title: Vertical align a marginpar with the first line of a paragraph

text: > **Possible Duplicate:**   >  Align marginpar with beginning of paragraph Is there a way to vertical align a marginpar with the first line of a paragraph, instead of the last?


title: How to display an encyclopedia-like range of topics per chapter or per page in ConTeXt?

text: At the top of the page in many reference books or encyclopedias, there is always a range stating which topics are covered within a given area, e.g.:   * A volume of encyclopedias will say "A-B" to indicate that topics beginning with "A or "B" will appear there.   * The header of a dictionary will say "aardvark to animal", indicating that such topics can be found on that particular page. I have a document formatted like this:               \part{A}         \chapter{Animals}             \custommacro{Koalas}             \custommacro{Kangaroos}          \chapter{Animation}             \custommacro{Disney}             \custommacro{Japanese}             \custommacro{South American}     \part{B}         \chapter{Beans}             \custommacro{Kidney Beans}             \custommacro{Green Beans}             \custommacro{Jelly Beans}      From this data, how can I display this sort of information?   * The volume covers "A-B".   * A particular part covers "Animals-Animation".   * A particular chapter covers "Disney-South American".   * A particular page in the book contains parts of the articles about "Green Beans-Jelly Beans".


title: TikZ coordinate transformation resulting in miscalculated node position

text: Why does the coordinate transformation in the following example result in a miscalculated position for `E`?               \documentclass[border=4pt]{standalone}     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{tkz-euclide}     \usetkzobj{all}     \begin{document}          \begin{tikzpicture}[x=0.5in, y=0.5in]%% <-- calculation of "E" is incorrect     %%\begin{tikzpicture}%% <-- calculation of "E" is correct            \coordinate (Q) at (0,0);       \coordinate (A) at (-170:1);       \coordinate (B) at (-70:1);       \coordinate (C) at (-20:1);       \coordinate (D) at (50:1);            \tkzInterLL(A,C)(B,D)        \tkzGetPoint{E}            \draw (A) --  (C);       \draw (B) --  (D);            \node[circle,fill,inner sep=1pt]  at (E) {};          \end{tikzpicture}          \end{document}


title: Avoiding breaks in vertical bars in a tabular environment

text: I'm having problems defining the width of a vertical line. I want those 2 lines in the pic to join:               \documentclass{article}     \begin{document}     \begin{tabular}{r|p{11cm}}     \ {Feb, 2014 - } & Master Thesis Student \\     \ {Present} & \emph{INEB, Porto}\\      & \footnotesize{"Exploring degradable Gatg Dendrimers as Nucleic Acid Vectors Targeted to the Nervous System"}\\     \multicolumn{2}{c}{} \\          \vspace{0.5em}          %------------------------------------------------          \ {Feb, 2013 - } & Intern \\     \ {Jul, 2013} & \emph{Stockholm University, Sweden}\\      & \footnotesize{Developed bachelor thesis at the Center for Biomembrane Research during an Erasmus Programme. "Production of secretory proteins in the periplasm of \textit{E. Coli}"}\\     \multicolumn{2}{c}{} \\     ...     \end{tabular}     \end{document}      ![pic](http://i.stack.imgur.com/ykZxJ.png)


title: Signalling error in "expandable context"

text: I'm reviewing a few old macros of mine to make them fully expandable. One of the macros takes one argument, which should either be a two-digit or a four- digit integer (>1955). The macro then converts two-digit numbers to four-digit years in the range 1956-2055, and then goes on to do some other stuff (basically based on the difference between current year and the given year). I want to make this expandable since I want to be able to use it in for example `\href{mailto:foo\mymacro{98}bar@example.com}{Mail me!}`. Now, reviewing the code, I can see that I used lots of assignments, but using `\numexpr` I can get rid of all of this, although at the cost of making the same computation several times as I branch through the different cases. But I also used to have a bit of sanity checking: If `#1` is greater than 99 but smaller than 1956, I issue a `\PackageError` explaining the problem. If the sanity check holds, this is simply skipped, so its non-expandability is not a problem. Also, when used in ordinary text, the error works as expected. However, inside `\href`, the error becomes               Undefined control sequence.     \GenericError  ...                                                                         #4  \errhelp \@err@     ...      which is not very helpful. Is there a way to provide the user with an indication of the problem? PS: I'm not sure if "expandable context" is the right way to describe the situation. Feel free to suggest a better title. _Edit:_ As an example, assume I want `\mymacro` to expand to the absolute value of the difference between the given year and `\year`. If the input is less than 100, we should interpret it as a year in the range 1956-2055. Input in the range 100-1955 should give an error. What I have now is something like               \def\mymacro#1{%       \ifnum\numexpr#1>1955 %         \ifnum\numexpr\year-#1\relax<0 %           \number\numexpr#1-\year\relax         \else           \number\numexpr\year-#1\relax         \fi       \else         \ifnum#1>99 %           ERROR!%         \else           \ifnum#1>56 % 19xx             \number\numexpr\year - 19#1\relax           \else % 20xx             \ifnum\numexpr\year - 20#1\relax<0                \number\numexpr20#1 - \year\relax             \else               \number\numexpr\year - 20#1\relax             \fi           \fi         \fi       \fi     }          %\def\test#1{#1: a\mymacro{#1}b}     \def\test#1{#1: \href{http://a\mymacro{#1}b}{Link}}     \test{96} \test{1996}; \test{08} \test{2008}; \test{11} \test{2011};     \test{20} \test{2020}          \test{123}      (the a and b are just there to check that spaces don't creep in). So I'd like to replace ERROR! by something which tells the user about the problem, preferably using a message that includes the offending `#1`.


title: How to cite two references and include their pages with natbib?

text: \cite[p.~11]{Author1:2003a}      This inserts the number of page only for one author like "(Author1, 2003, p. 11)" However, I would like something like "(Author1, 2003, p. 11, Author2, 2003, p. 22)" Any idea?


title: Change border of a few cells in a table

text: Let's say I have a table with 4 columns and 8 rows. The top row is the label for each of the rows below. Suppose I want the cell borders for rows 4 and 5 to be thicker than the rest of the cells in the table. Is there a way to accomplish this in LaTeX?               \begin{table*}[ht]     {\normalsize     \hfill{}     \large     \begin{tabular}{|c|c|c|c|c|}     \hline \bf ID & \bf Raw Score & \bf Num & \bf Total Hits & \bf Avg \\      \hline 217842950 & 8282 & 9 & 10059 & 0.176658 \\      \hline 264307945 & 7700 & 13 & 11076 & 0.304803 \\      \hline 111824111 & 6170 & 16 & 9467 & 0.348262 \\      \hline 331180650 & 1705 & 31 & 2668 & 0.360945 \\      \hline 436114131 & 1540 & 6 & 1773 & 0.131416 \\      \hline 546694115 & 1460 & 6 & 1685 & 0.133531 \\      \hline 467026458 & 1058 & 36 & 1237 & 0.144705 \\      \hline      \end{tabular} }     \hfill{}     \caption{Scores for the top-7 IDs .}     \label{tb:tablename}     \end{table*}      Above is the table I have. I'm unsure how I would even go about changing the border around any row (or cell)


title: MetaUML: via emp package for LaTeX gives no output

text: The following example prints only the figure's caption:               \documentclass[a4paper,11pt]{article}          \usepackage{emp}     \ifx\pdftexversion\undefined     \usepackage[dvips]{graphicx}     \else     \usepackage[pdftex]{graphicx}     \DeclareGraphicsRule{*}{mps}{*}{}     \fi          \begin{document}          \begin{empfile}     \begin{empcmds}     input metauml;     \end{empcmds}          \begin{figure}     \centering     \begin{emp}[classdiag](20, 20)     Class.A("A")()();     Class.B("B")()();     B.e = A.w + (-20, 0);     drawObjects(A, B);     link(inheritance)(B.e -- A.w);     \end{emp}     \caption{A class diagram}     \end{figure}     \end{empfile}          \end{document}      Environment: Ubuntu 11.04 (amd64), TexLive 2009, MetaUML 0.2.5, TeXMaker 2.2.1. **EDIT** : Here's full example with replacement of `\ifx ... \fi` with suggestion based on `ifpdf` package:               \documentclass[a4paper,11pt]{article}          \usepackage{emp}     \usepackage{ifpdf,graphicx}     \ifpdf       \DeclareGraphicsRule{*}{mps}{*}{}     \fi          \begin{document}          \begin{empfile}     \begin{empcmds}     input metauml;     \end{empcmds}          \begin{figure}     \centering     \begin{emp}[classdiag](20, 20)     Class.A("A")()();     Class.B("B")()();     B.e = A.w + (-20, 0);     drawObjects(A, B);     link(inheritance)(B.e -- A.w);     \end{emp}     \caption{A class diagram}     \end{figure}     \end{empfile}          \end{document}      Processing still gives no graphical output. Only figure's caption is printed.


title: beamerarticle - problem with commands in sections

text: I encountered the following problem with the beamerarticle package. If I use commands like \textit{} I get the following error massage:               ./test.tex:7: Argument of \@sect has an extra }.     <inserted text>                  \par Runaway argument?     {\normalfont \Large \bfseries }{\beamer@sortzeroread {\beamerx@\textit \ETC.     ./test.tex:7: Paragraph ended before \@sect was complete.     <to be read again>                     \par      l.7 \section{Test \textit{test} test}          ?      l.7 \section{Test \textit{test} test}          ?       Here is a minimal example:               \documentclass{article}     \usepackage{beamerarticle}     \begin{document}     \section{Test \textit{test} test}     \end{document}      Without the package or without the \textit{} the example works. Furthermore, if I use an optional argument in the section, it works as well, but if it contains any formatting commands. That is,               \section[\textit{test}]{Test \textit{test} test}      works, while               \section[test]{Test \textit{test} test}      doesn't. Any ideas what is going on here or how to solve it?


title: starred version of \DeclareMathOperator not working

text: I am using Kile as my LaTeX editor. I have defined a star for DeclareMathOperator but it does show the behavior of `\limits`, the subscript appears only in the sides rather than below. But using maptop works `\item$\mathop{\inf}\limits_x$`. The starred version of operator name is also not working as expected. Please tell me if i am missing something. Here is my code:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8x]{inputenc}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{amsopn}     \DeclareMathOperator*{\argmax}{argmax}                                          % argmax     \DeclareMathOperator*{\argmin}{argmin}                %opening     \title{Convex Optimization - Points to be clarified}     \author{Venkatesh}               \begin{document}          \section*{Convex sets theory}     \begin{enumerate}       \item what is a positive semi definite matrix and positive semdi definite cone $S_+^n = \{X \in S^n | X \succeq 0 \}$ ?       \item what is domain \textbf{dom} $f$ ?       \item$\mathop{\inf}\limits_x$       \item$\argmax{_c^b} f(b)$       \item$\operatorname*{rank}_v(x)$      \end{enumerate}               \end{document}


title: RGB Colors in TikZ and conversion with ghost script to PNG

text: Since a few days I am trying to find a solution for the folowing problem: I am creating a Tikz picture with a simple rectangele and fill the rectange with a special RGB color. The code looks like this:               \documentclass[a4paper,10pt]{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \fill[color={rgb:red,50;green,5;blue,5}](0.0,0.0)--(0.0,20.0)--(15.0,20.0)--(15.0,0.0)--(0.0,0.0);     \end{tikzpicture}     \end{document}      Then I create a PNG from this Pdf file with a Shell Skript: `gs -r200x200 -sDEVICE=png16 -sOutputFile=test.png -dBATCH -dNOPAUSE test.pdf` At last I read the output image with Java and read the RGB Color of a pixel inside the rectangle. The resulting color values have alwys a big difference to the value I have set in TikZ. I think the problem is somewhere in ghost script. I would be happy of any ideas to solve this.