Tag Info

New answers tagged

1

The preferred option is to crop the whitespace from the PDF file directly. If for some reason this is not possible, I provide a few options in this answer. Using the bb option by design does overprinting. If you want the portion outside the specified bounding box to not be printed, you have to set the clip option or equivalently, use the starred form ...


2

Using \centering instead of \begin{center}...\end{center} fixed the problem (Miktex with Lualatex on Windows) [2]. When using \begin{center}...\end{center} additional vertical space is introduced inside the float environment. I suspect this might throw off LaTeXs computing of margins. In general the usage of \begin{center}...\end{center} is discouraged in ...


1

You can use the copyrightbox package for that: \documentclass{article} \usepackage{graphicx} \usepackage{caption} \usepackage{afterpage} \usepackage{mwe} \usepackage{copyrightbox} \newcommand{\footnotelabeled}[2]{% \addtocounter{footnote}{1}% \footnotetext[\thefootnote]{\label{#1}#2}} \newcommand{\footnoteref}[1]{$^{\ref{#1}}$} \begin{document} \lipsum[2] ...


0

Here is a slightly modified view on the float placement using a forced location - using the [H] float specifier from float: \documentclass{article} \usepackage{graphicx,float,etextools,lipsum,refcount} \makeatletter \newcommand{\markfootnote}{\edef\@currentlabel{\thefootnote}} \g@addto@macro{\footnotemark}{\markfootnote} \makeatother \begin{document} ...


3

The best practice is never use page footnotes inside floats. You can make show footnotes in a more "orthodox" way using \foonotemark inside the float and\footnotetext[2]{Source of the other image} outside, or a normal \footnote{} inside the float with the ftnxtra package. However, keep in mind that what is inside a float environment can fleet as the wind, ...


1

\queuepage works like \afterpage but will not run until the previous \queuepage is done. \documentclass{article} \usepackage{graphicx} \usepackage{caption} \usepackage{afterpage} \usepackage{mwe} \newcounter{nextqpage}% incremented when queued \newcounter{lastqpage}% incremented when used \newcommand{\queuepage}[1]% #1 = same as \afterpage ...


2

You can use \raisebox \documentclass{beamer} \title{Ackermann's function} \date{} \begin{document} \begin{frame}[t] \titlepage \raisebox{2mm}[0pt][0pt]{% \makebox[\textwidth][c]{\includegraphics[scale=0.35]{example-image-a}} } %% \raisebox{distance}[height][depth]{text} Name: ... Prof.: ... Subject: ... University: ... \end{frame} ...


0

This solution is based on using proportional glue instead of distances. It is easier to set up than a true least squares solution, but when two legend entries are too close together, all the other entries are thrown off slightly. I use \coordinate to convert axis coordinates to absolute coordinates which I can use outside the axis environment. However, if ...


3

This solution is based on making the unit of measurement on the x-axis equal to the width of the graphic, and the unit of measurement on the y-axis equal to the height of the graphic. That being the case, a coordinate like (1,1) would indicate the upper right corner of the graphic (north east in TikZese), (0.5,0.5) would be the geometric center of the ...


3

First solution with calc TiKZlibrary: \documentclass[a4paper,10pt]{scrreprt} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{geometry} \geometry{a4paper,left=25mm,right=25mm, top=25mm, bottom=25mm} \usepackage{tikz} \usetikzlibrary{positioning,calc} \begin{document} \begin{tikzpicture} \node[inner sep=0pt] (probe) at ...


3

Another case study of the message: Don't nest tikzpictures! The \tikz{} contents inherit the node options due to being in the same scope hence it doesn't start a fresh copy of tikzpicture environment. If you want to group things together use scopes and shift the scope. \documentclass[tikz]{standalone} \usetikzlibrary{positioning} ...


0

figure means float and floats are designed to, well, float. LaTeX puts there where it thinks best. If you don't want them to move, don't use a figure environment. You can use the \captionof command from caption or capt-of for the captions. \documentclass{article} % Specifies the document class \usepackage[demo]{graphicx} % To use graphics and ...


2

Here you go. I have defined a new command \bccbar which takes an additional argument \bccbar[text = B]{<end value>}{<Starting value>} Code: \documentclass{article} \usepackage{bchart} %------------------------------------------- % Bars: \newcommand{\bccbar}[3][]{ % Set defaults: \renewcommand{\bcbarcolor}{blue!20} ...


2

Use \begin{frame}[t] \maketitle \end{frame} and remove \vskip-0.59cm% so that the frame starts from top. \documentclass{beamer} \usepackage{tikz} % Custom title page \setbeamertemplate{title page} { %\vskip-0.59cm% \hskip-.7cm% \inserttitlegraphic% \vfill% \begin{beamercolorbox}[sep=6pt]{title} \usebeamerfont{title}\inserttitle\par% ...


4

You haven't said what "the issue" is. If you use no option, or [c] then the alignment point for the parbox is its vertical centre. If you use [t] the alignment point is the baseline of its top row. As far as I can tell none of the \parbox in the example code are needed as they are just duplicating the p columns. I guess you want something like ...


1

May be the float package is useful for you: \documentclass{article} \usepackage{float,lipsum,graphicx} \floatstyle{ruled} % try boxed \newfloat{fancyfloat}{tb}{fan}[section] \floatname{fancyfloat}{Fancy float} \begin{document} \listof{fancyfloat}{List of fancy floats} \section{Lore ipsum} \lipsum[1] \begin{fancyfloat} \hfill Some dummy content ...


2

Not quite finished, but correctly floating, as I would say. Just use the float option of tcolorbox environments. \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \usepackage{lipsum} \usepackage[most]{tcolorbox} \newtcolorbox{mybox}{colback=black!5!white,colframe=blue!75!black,float} \newtcolorbox[auto counter,number ...


0

You can control the placement (more or less) using the figure options. \usepackage{tikz} \usetikzlibrary{positioning} \usepackage{lipsum} \usepackage{tcolorbox} \newtcolorbox{mybox}{colback=black!5!white,colframe=blue!75!black} ...


3

Both starred and regular chapters in book class have 50pt space from the top of the page. If you want to get rid of them add the following in your preamble \usepackage{xpatch} \makeatletter \xpatchcmd{\@makechapterhead}{\vspace*{50\p@}}{}{}{} \xpatchcmd{\@makeschapterhead}{\vspace*{50\p@}}{}{}{} \makeatother If you want some other distance, you can add ...


0

Although I couldn't put the figure at the bottom, this has been a good approach: \documentclass[10pt, conference, compsocconf]{IEEEtran} \usepackage{graphicx} \usepackage{float} \title{new document} \begin{document} \makeatletter \g@addto@macro\@maketitle{ \begin{figure}[H] \setlength{\linewidth}{\textwidth} \setlength{\hsize}{\textwidth} ...


0

figure is used specifically if you want the figure to float. To add a proper caption, use captionof. Try this \documentclass{article} \usepackage{rotating} \usepackage{pgfplots} \usepackage{tikz} \usetikzlibrary{arrows,positioning,calc} \usepackage{caption} \makeatletter \newcommand*{\centerfloat}{% \parindent \z@ \leftskip \z@ \@plus 1fil \@minus ...


5

Here's a working example. I've reformatted it a fair bit and added some styles to help keep straight what's doing what. \documentclass[12pt,tikz,border=3mm]{standalone} \usetikzlibrary{arrows.meta,% positioning,% shapes,calc%% } \tikzset{%% ura hub/.style={circle, anchor=center, ...


5

This is simply because your are using rounded corners rectangles. So, you should compensate for the trim effect (if you want the arrows to touch the rectangles) by issuing the option shorten >= -2pt, shorten <= -2pt. You can manually control the shorten distance. Note that you need only to compensate the two edges to node e3. Here is the modified ...


1

Using a different approach, based on my answer at What are the ways to position things absolutely on the page?, I introduce \atxy{x-pos}{y-pos}{content} to place something on the current page at a specified location, and then \ateveryxy{x-pos}{y-pos}{content} to do the same for all pages from the invocation forward. \documentclass{article} ...


7

This was a long standing bug if you add \usepackage{fixltx2e} it should be fixed. It is also fixed (by default) in the upcoming 2015 LaTeX release.


5

First, as percusse says, you won't need that page long initial code but load \usetikzlibrary{tikzmark}. Second, \HatchedCell should come after tabular as noted by Paul Gaborit and inside table environment. Further, I have used \newcommand{\rom}{} as you didn't tell. Also, watch out for some comments I have made inside the code. Here is the polished code ...


-2

After the graphics or listing, add this code: \vfill \rule[\baselineskip]{0pt}{\baselineskip}


5

Zallman Caps is installed as part of TeX Live in the form of a type1 font. There is no .sty file but the support files for use with LaTeX are all there and the .sty is easy to write. Here's a version which I compiled with pdfLaTeX: \documentclass[11pt]{article} \begin{filecontents}{Zallman.sty} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{Zallman}[2007/11/24 ...


2

cfr's answer is not quite correct, though it is close enough for practical purposes. It is true that tikzmark does not create a node, but neither does it create a coordinate. It doesn't create anything, it does almost the bare minimum needed to mark a point on the page and no more (not quite the bare minimum, there's \pgfmark which is the absolute bare ...


5

Here, I stack a box that contains a rendition of the accent. I introduce \accentletter[\accentbox]{letter} to accomplish the task, where the user creates various \accentboxes to meet his/her needs. I used \smash on my \accentbox definitions so as not to disturb line spacing, but that is a choice left up to the taste of the user. ...


10

If you are willing to buy a font, some sites let you search for the existence of a particular character (e.g., myfonts.com). But you won’t find many sets of ornamental initials that include Ś. If you have a font with the combining acute accent, all is well. Here’s an example with Eadui, a free font. \documentclass[12pt,a5paper]{book} ...


4

As an extension to cfr's answer, you can define your own \tikzmark \documentclass{article} \usepackage{tikz} \newcommand{\tikzmark}[2]{% \tikz[overlay,remember picture,baseline]\node [anchor=base] (#1) {#2}; } \newcommand{\DrawHLine}[3][]{% \begin{tikzpicture}[overlay,remember picture] \draw[shorten <=0.2em, #1] (#2.west) -- (#3.east); ...


3

tikzmark creates coordinates and coordinates do not have distinct anchors because they are points. So coordinate.west would be just the same as coordinate.east and there's no point defining them. [Drawing on percusse's comment, they are all equivalent to coordinate.center which is just the same as coordinate.]


3

\documentclass[11pt,a4paper,roman]{moderncv} % moderncv themes \moderncvstyle{casual} \moderncvcolor{blue} \usepackage[scale=0.75]{geometry} \name{John}{Doe} \title{Curriculum Vitae} \photo[80pt][0.4pt]{example-image-A} %%%%%% The following passage moves 'Curriculum Vitae' from ...


1

Labels can be added at center of nodes. You can use this option instead of an independent node. \documentclass[landscape,8pt]{article} \usepackage{varwidth} \usepackage{tikz} \usepackage[]{qrcode} \usepackage{graphicx} \setkeys{Gin}{keepaspectratio} \begin{document} \topskip0pt % https://github.com/zxing/zxing/wiki/Barcode-Contents ...


1

The problem you have is well explained in pgfmanual, section "17.5.3 Advanced Placement Options". It's a long section but it's worth to read it. \node [circle, draw, right=of split] (adder2) {\(+\)}; right=of split is equivalent to right=1cm of split which shifts adder2 1cm right from split and fixes adder2 anchor to west. \node [circle, draw, above ...


5

Here are several ways to make double arrows over symbols. \documentclass{article} \usepackage{amssymb} \usepackage{accents} \makeatletter \def\Rightarrowfill{$\m@th\mathord= \mkern-6mu \cleaders\hbox{$\mkern-2mu\mathord= \mkern-2mu$}\hfill \mkern-6mu \mathord\Rightarrow$} \def\Overrightarrow#1{\vbox{\m@th\ialign{##\crcr ...


3

Maybe a stack? The use of \useanchorwidth in the true condition means that the size of the overset does not affect the underlying math spacing. \documentclass{article} \usepackage{stackengine,amsfonts} \stackMath \def\useanchorwidth{T} \begin{document} \[ \stackon[1pt]{v}{\,\scriptscriptstyle\Rightarrow} \in \mathbb{Z}^{N\times N} \] \end{document}


1

I'm now using: \usepackage{placeins} \let\Oldsection\section \renewcommand{\section}{\FloatBarrier\Oldsection} \let\Oldsubsection\subsection \renewcommand{\subsection}{\FloatBarrier\Oldsubsection} \let\Oldsubsubsection\subsubsection \renewcommand{\subsubsection}{\FloatBarrier\Oldsubsubsection} This is shamelessly plugged from the union of this and ...


0

Not sure why you don't want footnotes at the foot. Maybe you actually don't want footnotes at all, but rather endnotes? Then you can have the notes directly after the text. \documentclass{article} \usepackage{endnotes} \begin{document} foo\endnote{bar} bar\endnote{foo}. \theendnotes \end{document}


1

Try the following if it works for you: \documentclass[oneside]{book} \usepackage{graphicx,mwe} \begin{document} \subsection{Begin subsection} \begin{figure}[htp] \raggedleft %note: there's going to be another image next to this later \includegraphics[width=5cm]{example-image-a}\\ \noindent - Point 1 under the first description\\ - Point 2 under the first ...


5

Similar to Harish's answer with more details on positioning syntax I think there is a confusion about the positioning syntax. It doesn't use polar coordinates but if given only one argument it applies to both horizontal and vertical shifts. So you can say below right = <horizontal shift> and <vertical shift> of <ref> Also it changes the ...


5

If you load positioning library, then below right=of will be vertically aligned with a right=of node. However, you can use shift to put a node relative to an existing node. Further, you can also hard code the distances using positioning library. \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} ...


1

You can fine tune the offsets to be big enough without excess white space using \draw. \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{calc} \begin{document} \begin{minipage}{4 in} \centering \begin{tikzpicture} \begin{axis}[ylabel={Y label},xmin=-1,xmax=1,width=3in,height=2in] \addplot coordinates {(-1,-1) (1,1)}; \coordinate ...


4

Your tabular is too wide and doesn't fit in the page. To overcome this, insert your tabular inside \resizebox{\linewidth}{!}{....}. MWE: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[color=red,opacity=0.1,contents={}]{background} \usepackage{hyperref} \usepackage{indentfirst} \usepackage{caption} \usepackage{listings} ...


1

when code for a figure is input within a block of text, processing of the figure will be deferred until the end of the paragraph. figures (and other floats) are processed only in vertical mode. for this reason, it's recommended that floats always be input between paragraphs. in the present case, the problem can be solved by inserting a blank line in the ...


1

There seem to be white margins in the PNG file, if you get an overfull \hbox warning. Just open the file in an image editor (Gimp or whatever) and remove the white margins there. The new version of the file can then be included by \includegraphics[width=\linewidth]{...} to use the full line width for the image. If the fonts are still to small, then the ...


26

What a fascinating problem! As it turns out this is (probably) a bug in LaTeX in there since the dawn of time, but as it touches so delicate areas (where TeX has its limitations) I'm not sure there could be a safe cure for it even if we want to attempt it --- I offer a solution later on, but that may have other issues I haven't thought about yet. So what ...



Top 50 recent answers are included