Hot answers tagged

9

Some remarks: "Long" arguments with paragraphs (\par tokens) can only be used for macros, which are defined with \long: \long\def\macro. This is the default for \newcommand. \setpage needs to be defined this way. \callpage, however, should not allow \par tokens, which are forbidden in \csname. It can be defined by \def or the star form \newcommand*. Since ...


6

You're wrong in thinking that \def is shorter. Maybe it looks shorter by number of characters, but it can save you from pulling your hair when some weird error shows up. Suppose you load a package you use only some features of, but that this package uses a macro named \setpage as part of its working when the feature you exploit is called. Can you see what ...


3

Why not just this? \documentclass{article} \newcommand{\listOfYears}[3]{% \begin{minipage}{0.08\textwidth} #1 \end{minipage}% \begin{minipage}{0.30\textwidth} #2 \end{minipage} \par \hspace*{.08\textwidth}% \begin{minipage}{0.30\textwidth} \textit{#3} \end{minipage} } \begin{document} \listOfYears{765}{235}{3098} \end{document} ...


3

By default, \section suppresses the indentation of the first paragraph, so \section{foo} \begin{multicols}{2} \begin{minipage}[t]{0.45\textwidth} xxxxxxxxxxx \end{minipage} starts the first minipage at the left margin. When you add content before the columns \section{foo} z paragraph indentation is suppressed before that content. Then there's a ...


3

Here's an example with tcolorbox, using breakable boxes for problem and proof and some customization. \documentclass[a4paper]{article} \usepackage[margin=1.5cm]{geometry} \usepackage[most]{tcolorbox} \newtcolorbox[auto counter]{problembox}[1][]{% colframe=white, %% Really? colback=lightgray, coltitle={black}, enhanced jigsaw, sharp corners, ...


3

As starting point can serve the following MWE: \documentclass[10pt,journal,compsoc]{IEEEtran} \usepackage{booktabs,tabularx} \newcolumntype{C}{>{\centering\arraybackslash}X} \usepackage{lipsum} \begin{document} \lipsum[1-3] \begin{table}[htb] \begin{minipage}{\linewidth} \begin{tabularx}{\columnwidth}{*{4}{C}} \toprule T & X & Y & ...


3

Unrelated to tabulary: you are missing the minipage width in all the new entries \begin{minipage} Note the error message ! Missing number, treated as zero. <to be read again> \begin{minipage} A which shows the location of the error being the A \begin{minipage} A is the same as \begin{minipage}{A} so it tries ...


3

Try this: apply a \raisebox{\dimexpr-\height+\ht\strutbox}{...} to the image. The explanation is that the two minipages are, in fact, aligned to their top baseline (as requested with the [t] option of minipage). The problem is that included image extends well above the top baseline, whereas the text does not. This occurs because \includegraphics always ...


2

The parfill option sets \parfillskip to 30pt. This means that TeX tries to leave at the end of a paragraph a space of 30pt. This doesn't work with your minipages. You can locally reset \parfillskip: \documentclass{article} \usepackage[parfill]{parskip} \begin{document} \begingroup \setlength{\parfillskip}{0pt}% \begin{minipage}{0.5\columnwidth} b ...


2

You don't need a \parbox: use the \thead command from makecell. It allows for line breaks in cells and a common formatting. Also, you can have a nice alignment of numbers with the S column type from siunitx. If you prefer a simpler code, without alignment of the decimal dot, use c columns` (second solution): \documentclass[12pt]{article} ...


2

Here is a solution with wrapfigure. I replaced the items of a description environment (wrapfigure won't work) with a special formatting of \paragraph with the titlesec package, in order to mimick the layoout of a description environment: \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{fourier, erewhon} ...


1

I had to make a few substitutions to get it to run on my system. First, your matrix equation was too wide for even landscape, so I broke it into two lines. Second, if you want the rotated box to be at the bottom left, you need to add \vspace*{\fill) before \rotatebox. (BTW, \vspace*{fill} does nothing inside a normal minipage.) Finally, I added a \fbox ...


1

If there should be nothing else than a splitted background, this can be done with tcolorbox package quite easily. \documentclass{article} \usepackage{blindtext} \usepackage{xcolor} \usepackage{geometry} \usepackage[most]{tcolorbox} \geometry{margin=0pt} \newtcolorbox{bgbox}[1][]{nobeforeafter,leftright skip=0pt,boxrule=0pt,enhanced jigsaw,sharp ...


1

I have rebuilt your code from scratch (but using your colors, font sizes, etc.) solely in Tikz. The code is shorter and easier to maintain in some cases. There are very minor differences in positions, but I tried to replicate your own as close as I could I have wrapped everything in a newcommand \mytitlepage with 5 arguments: \mytitlepage{ <title> }{ ...


1

I found a way to do the second option by inserting a strut and adjusting the minipage accordingly. The adjustbox package has everything available that is needed: \documentclass{article} \usepackage{graphicx} \usepackage{lipsum} \usepackage{wrapfig} \usepackage{calc} \usepackage{adjustbox} \newlength{\strutheight} \begin{document} ...


1

The tabular is set at its natural width. You seem to need the minipage for the footnote, so I kept it. You can use the tabular* environment, with the \extracolsep feature. \documentclass[10pt,journal,compsoc]{IEEEtran} \usepackage{booktabs} \usepackage{lipsum} \begin{document} \lipsum[1-3] \begin{table}[htp] \caption{A caption to the table}\label{capt} ...


1

Here is an alternative solution using minipages. \documentclass[demo]{beamer} \usepackage{biblatex} \begin{document} \begin{frame}{Workload Categorization} \begin{minipage}[t]{0.5\linewidth} Benchmark suites: \begin{itemize} \item 22 SPECcpu2006 \item 11 SPLASH2x \item 9 PARSEC 3.0 \item 6 NAS \end{itemize} \end{minipage}% ...


1

This is a bit hacked, but does work. We use two columns with a List in each one, so that the items are next to each other. Then we remove the bullets and indentation from the second list. Perhaps you want to fiddle with the width to get the distance between the two lists to your liking: \documentclass[demo]{beamer} \usepackage{enumitem} ...



Only top voted, non community-wiki answers of a minimum length are eligible