I'm using sharelatex and pdflatex as a compiler. I am using the memoir class. (It's for a book.)  At first I used .png images but the compiler always took too long so I converted all my image files to .pdf in order to gain a smaller file size=faster compilation speed and I realized that vector images' quality are better than raster so I want to keep working with vector formats (and I didn't use .svg or .eps because sharelatex doesn't support them).  The image has to fit the page's width margins (for the vector image) or if it does ever exceed, it can be floated(but still centered; and again, I used this trick for png images but they were too big and never loaded properly).  I've tried many solutions, but none of them managed to work. They used to work when the extension was still .png. But once I've switched to pdf they're all broken. (or worked differently so I didn't got my results).  I'm going to add the document's frames so it'll be easier to get an idea of how much the image is off-bounds to the center.  \documentclass[14pt]{memoir} \usepackage[utf8]{inputenc}  \usepackage{graphicx} \graphicspath{ {images/} }  \usepackage[paperwidth=6in, paperheight=9in, margin=0.9in, showframe]{geometry}  \begin{document}  \begin{center} \includegraphics[scale = 1]{001} \end{center}  \end{document}   Which got me this:   \documentclass[14pt]{memoir} \usepackage[utf8]{inputenc}  \usepackage{graphicx} \graphicspath{ {images/} }  \usepackage[paperwidth=6in, paperheight=9in, margin=0.9in, showframe]{geometry}  \begin{document}  \begin{center} \includegraphics[scale = 1]{001_pngversion} \end{center}  \end{document}   Result:   Which gives me the high resolution png version. Somehow, it looks like more aligned to the left...? Maybe it was because it's too big, it exceeded the page limits and couldn't center properly?  I then decided to use the \centering trick and the \linewidth trick to resize it:  \documentclass[14pt]{memoir} \usepackage[utf8]{inputenc}  \usepackage{graphicx} \graphicspath{ {images/} }  \usepackage[paperwidth=6in, paperheight=9in, margin=0.9in, showframe]{geometry}  \begin{document}  \begin{center} \includegraphics[width=1\linewidth]{001} \end{center}  \end{document}   Which got me this, the exact result I was looking for:   Now, let's try the same trick with pdf images:  \documentclass[14pt]{memoir} \usepackage[utf8]{inputenc}  \usepackage{graphicx} \graphicspath{ {images/} }  \usepackage[paperwidth=6in, paperheight=9in, margin=0.9in, showframe]{geometry}  \begin{document}  \begin{figure} \centering \includegraphics[width=1\linewidth]{001} \end{figure}  \end{document}   Results:   Which obtained the same exact result as the FIRST ONE (failed one)  I then tried \begin{figure} \begin{floatrow} or \centerfloat , etc but it still failed. Only worked for pngs...  What I want to achieve is the result I got from the png version, while using .pdf images.  (On a side note, could someone explain the difference in using /centering, /centerline, and /centerfloat? While I was looking for answers concerning centering floating images that surpassed the page's margins. Which one is usually recommended?)
I'm inserting an image with a simple:  \includegraphics[height=5cm]{filename.png}   This results in an image that maintains the aspect ratio, and so gives me something like 6cm width. I only really want the left side of the image though, and would like to crop it to 50% width. Is it possible to do this?  If possible, I'd like to do this in a portable way (i.e. something that other authors of this document won't have to install packages for, and something that works with a reasonably old version of pdflatex - our computers at work are in sore need of an upgrade).
Let us view our deleted comments I ran into something a couple of weeks ago that I'd never seen before: A filesystem (ext3 I believe) installed to a storage device without a partition. In essence /dev/sdb was the entire filesystem. I know many filesystems can be extended into empty space, so doing this allows extending without dealing with LVM or some other kind of volume manager, but are there any other advantages for setting up storage this way?  The specific case I saw was as the ephemeral data volume for a number crunching server, the boot and root volumes were traditional partitions on a different storage device entirely. - I'm using a \chapterstyle{tandh} because I want my chapters numbered. In order to get a References chapter numbered as well I used the following code:  \renewcommand{\bibsection}{% \chapter{\bibname}}   That worked fine, I got my References chapter numbered!!   But now, in order to get my references in a author-year style I'm using the natbib package. Seems like the package ignores my code and the References chapter is not numbered anymore.  Can someone help me? Command not found $ (dollar sign) Any command that starts with $ returns  command not found   How can I fix this?  I am  using 16.10 Ubuntu. Is there an (easy) way to create or personalize .bst files? When you prepare an article for a journal (in my case, Quantum Information and Computation, Rinton Press), often they ask you to use some format for your references; in my case, the following:     [1] R. Calderbank and P. Shor (1996), Good quantum error          correcting codes exist,  Phys. Rev. A, 54, pp. 1098-1106.      [2] M.A. Nielsen and J. Kempe (2001), Separable states   are  more disordered globally than locally, quant-ph/0105090.      [3] A.W. Marshall and I. Olkin (1979), Inequalities:   theory of majorization and its applications, Academic Press (New   York).   The issue is, sometimes (and this is the case) they do not provide a .bst style file for bibtex users. I (and I guess many other people) prefer not to copy all the references of a bibtex file one by one into a tex document. So here is the question I am trying to answer:     What is the easiest way to create a .bst file? (for Rinton or any other publisher)   At first sight, I thought this would be very easy to do: after all, a .bst file is just a mere script to give format to a list. Strangely to me, after a long search I have been unable to find a simple clean solution to this problem. These are the the options I have been looking at:   I have tried to adapt a previous .bst file: concretely, apsrev4-1.bst, which has a similar format. Other people have tried this solution before , . However, it is an ugly option. First, it requires going through the script of the .bst and understanding it. Second, the script format used in different .bst files differs (quite annoyingly), so it is not easy to modify them unless you do understand what's written. The above solution is quite hideous and you really lose time on it, so I was wondering: isn't there any software tool (hopefully with a GUI) that does this job? It should, after all, pretty easy to program for a .bst script expert some sort of program to generate .bst files. There are some related questions in this site asking for something similar , ; there I have seen a couple of proposed apps, but going through their manuals they seem not so easy to use. Isn't there some software tool available to generate a .bst in less than 1 hour of work?   Remarks: ideally I would like to use/personalize/create .bst styles that support eprint fields (e.g. aps4-1.bst). Showing that the class of all sets of a particular cardinality is not a set. How to show that the class of all sets of a particular cardinality ,say $h$ is not a set.   My argument:  I assume that I've shown the following lemma.  Lemma: If $X$ is an infinite set of cardinality $h$ , $a\ne x$ for every $x\in X$ then $\{a\}\cup X$ is of cardinality $h$ too i.e. adding new element to an infinite set doesn't change cardinality.  Let $h$ be an infinite cardinal number. Let $T_h=\{x:\text{x is a set of cardinality h}\}$. Suppose $T_h$ is a set.   Let $a$ be any set and consider any $t\in T_h$. Let $R=t\cup \{a\}$. Using the above lemma, $R\in T_h$.   So, $a\in R\subset \bigcup T_h$. As $T_h$ is a set then $\bigcup T_h$ is also a set.  As $a$ was arbitrary set then we have, $a\in\bigcup T_h$ for every set $a$. Hence, the set $\bigcup T_h$ contains all sets which meas that the collection of all sets is a set, contradiction.    If $h$ is non-zero finite cardinal number. Define $T_h$ the same way as above. Let $a$ be any set, Let $A_1=a, A_{n+1}=A_n\times a$. Consider $A=\{A_1,A_2,...,A_h\}$. So, $A\in T_k$. Hence, $a=A_1\in \bigcup T_h=K$. So K is a set containing all sets $a$ since $a$ was arbitary,contradiction.  My main question is, Is there any flaws in my argument? If yes, point it out please.   If the argument is valid, Is there any standard proof to show the same fact? Does "corresponding author" carry an implied meaning? After reading the question , I got the impression that (at least in the writers' field) the "corresponding author" flag could carry an implied meaning, such as "did more work than the other authors", or "is a more senior author". Is it the case?  I am in mathematics, a field where we typically sort the authors alphabetically, and I've never given any importance to that role (apart from "this author is willing to answer a couple of extra e-mails, if needed"). Given an integer $n$, we are asked to investigate about the existence of integer divisors of $n^2+1$ of the form $4k+3$. Can you provide some insights about it? Passing more then 100 arguments to ColdFusion function throws an error Why is a normal subgroup of $G_1\times G_2$ with trivial intersections with $G_1$ and $G_2$ is abelian? Let $G=G_1\times G_2$ be a direct product, and let $H\triangleleft G$ be a normal subgroup such that $H\cap G_1=H\cap G_2=\{1\}.$ Then $H$ is abelian.     I considered the commutators of two elements in $H$, trying to show that it must be $1,$ but I don't see how this works. Any hint is very welcomed and appreciated. Thanks in advance. Bug in editor for numbered lists? I noticed what seemed to be a bug in the way the stackoverflow editor handles numbered lists. I did a search on meta for this and it didn't come up, but if it is a duplicate, I'll delete the question.  Consider the following code:  Here are some points:  1. One 2. Two 3. Three  Here are some more points which continue the theme:  4. Four 5. Five   When you actually type this into the text editor, this is the result:  Here are some points:   One Two Three   Here are some more points which continue the theme:   Four Five   In this case, the ordered list resets after the break. This is probably just an edge case (and not necessarily worth fixing), but I ran into the problem today and figured this would be a good place to raise the topic! My workaround was to use back-ticks around the numeral, but then you lose the hanging indent. (ie, 1. One)  Might this be worth fixing? Is it expected behavior? Or am I doing it wrong? how can I extrude curve shapes onto curve without tapering I'm stuck. Can't figure out how I can extrude a closed curve onto a NURBS curve without it looking tapered.   I notice that when it's set to "2D" there is no tapering, but I want to do it on 3d.  Thanks for help. Equivalent of typedef in C# Is there a typedef equivalent in C#, or someway to get some sort of similar behaviour? I've done some googling, but everywhere I look seems to be negative. Currently I have a situation similar to the following:  class GenericClass&lt;T&gt;  {     public event EventHandler&lt;EventData&gt; MyEvent;     public class EventData : EventArgs { /* snip */ }     // ... snip }   Now, it doesn't take a rocket scientist to figure out that this can very quickly lead to a lot of typing (apologies for the horrible pun) when trying to implement a handler for that event. It'd end up being something like this:  GenericClass&lt;int&gt; gcInt = new GenericClass&lt;int&gt;; gcInt.MyEvent += new EventHandler&lt;GenericClass&lt;int&gt;.EventData&gt;(gcInt_MyEvent); // ...  private void gcInt_MyEvent(object sender, GenericClass&lt;int&gt;.EventData e) {     throw new NotImplementedException(); }   Except, in my case, I was already using a complex type, not just an int. It'd be nice if it were possible to simplify this a little...  Edit: ie. perhaps typedefing the EventHandler instead of needing to redefine it to get similar behaviour. I have several files with the same base filename. I'd like to remove all but one  foo.org #keep foo.tex #delete foo.fls #delete foo.bib #delete etc   If I didn't need to keep one, I know I could use rm foo.*.    demonstrates ^ to negate a match. Through trial and error, I was able to find that  rm foo.*[^org]   does what I need, but I don't really understand the syntax.   Also, while not a limitation in my use case, I think this pattern also ignores foo.o and foo.or. How does this pattern work, and what would a glob that ignores only foo.org look like? How can I shutdown my Android phone using an adb command? How do I halt an android phone using adb command? I can reboot, but I don't know how to halt.  I tried shutdown -k wait command, but it did not work. Shouldn't the badge requirements scale? Many badges have fixed requirements, such as:   Answer score of 100 or more   However different websites means a different level of difficulty: the more active users a website has, the easier the badge is to get.  On a new and/or low-view website getting this badge may be impossible for several months; on a website like stack overflow now you can obtain it in a day, and it's relatively easy (compared to other SE sites).  Do you think it would be a good idea to implement a formula that allows the required score to scale? The more active users voting, the more votes are required to get it?  If yes how would you handle people who got it for a post that no longer meets the requirements? Calculate sum of squares of first $n$ odd numbers Is there an analytical expression for the summation $$1^2+3^2+5^2+\cdots+(2n-1)^2,$$ and how do you derive it? With all the various races in the federation, how do the humans manage to dominate it? Prevent execution of parent event handler Prove that for sufficiently large $x$, $(\log x)^p<x$ where $p$ is a positive integer.